using System; using CoreSavingLibrary; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CoreSavingLibrary.WcfCommon; using CoreSavingLibrary.WcfShrlon; using Sybase.DataWindow; using System.Web.Services.Protocols; namespace Saving.Applications.shrlon.dlg { public partial class w_dlg_sl_loanrequest_cleardet : PageWebDialog, WebDialog { private ShrlonClient shrlonService; private CommonClient commonService; protected String closeWebDialog; protected String refresh; public void InitJsPostBack() { closeWebDialog = WebUtil.JsPostBack(this, "closeWebDialog"); refresh = WebUtil.JsPostBack(this, "refresh"); } public void WebDialogLoadBegin() { String xmlDetail = ""; str_itemchange strList = new str_itemchange(); try { shrlonService = wcf.Shrlon; commonService = wcf.Common; } catch (Exception ex) { LtServerMessage.Text = WebUtil.ErrorMessage(ex); return; } this.ConnectSQLCA(); if (IsPostBack) { this.RestoreContextDw(dw_cleardet); } else { try { strList = WebUtil.str_itemchange_session(this); String xmlClear = strList.xml_clear; String contractNo = Request["contractNo"].ToString(); try { xmlDetail = Session["xmlloandetail"].ToString(); } catch { xmlDetail = dw_cleardet.Describe("DataWindow.Data.XML"); } if ((xmlDetail != null)&&(xmlDetail != "")) { int result = shrlonService.ViewLoanClearDetail(state.SsWsPass,state.SsCoopId, contractNo, xmlClear, ref xmlDetail); if (result == 1) { dw_cleardet.Reset(); // dw_cleardet.ImportString(xmlDetail, FileSaveAsType.Xml); DwUtil.ImportData(xmlDetail, dw_cleardet, null, FileSaveAsType.Xml); } else { dw_cleardet.Reset(); dw_cleardet.InsertRow(0); } } else { dw_cleardet.Reset(); dw_cleardet.ImportString(xmlDetail, FileSaveAsType.Xml); } } catch (Exception ex) { LtServerMessage.Text = WebUtil.ErrorMessage(ex); } } } public void CheckJsPostBack(string eventArg) { if (eventArg == "closeWebDialog") { OnCloseClick(); } if (eventArg == "refresh") { Refresh(); } } public void WebDialogLoadEnd() { if(dw_cleardet.RowCount>1) { DwUtil.DeleteLastRow(dw_cleardet); } dw_cleardet.SaveDataCache(); } public void OnCloseClick() { String xmlLoanDetail = ""; try { xmlLoanDetail = dw_cleardet.Describe("DataWindow.Data.XML"); } catch { xmlLoanDetail = null; } Session["xmlloandetail"] = xmlLoanDetail; HfChkStatus.Value = "1"; } public void Refresh() { } } }