protected void linkEnableExV_OnClick(object sender, EventArgs e) { LPWeb.BLL.LoanConditions lcon = new LPWeb.BLL.LoanConditions(); foreach (GridViewRow row in gridList.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox chkSelect = (CheckBox)row.FindControl("ckbSelect"); if (chkSelect != null && chkSelect.Checked && !string.IsNullOrEmpty(chkSelect.ToolTip)) { var ID = Convert.ToInt32(chkSelect.ToolTip); lcon.UpdateExternalViewing(ID, true); } } } BindGvList(); }
protected void Page_Load(object sender, EventArgs e) { #region 校验页面参数 // FileId bool bValid = PageCommon.ValidateQueryString(this, "FileId", QueryStringType.ID); if (bValid == false) { PageCommon.WriteJsEnd(this, "Missing required query string.", "window.top.CloseGlobalPopup();"); return; } string sFileId = this.Request.QueryString["FileId"]; this.iFileId = Convert.ToInt32(sFileId); // ConditionID bValid = PageCommon.ValidateQueryString(this, "ConditionID", QueryStringType.ID); if (bValid == false) { PageCommon.WriteJsEnd(this, "Missing required query string.", "window.top.CloseGlobalPopup();"); return; } string sConditionID = this.Request.QueryString["ConditionID"]; this.iConditionID = Convert.ToInt32(sConditionID); #endregion Loans LoansMgr = new Loans(); #region 加载Loans信息 DataTable LoansInfo = LoansMgr.GetLoanInfo(this.iFileId); if (LoansInfo.Rows.Count == 0) { PageCommon.WriteJsEnd(this, "Invalid File Id.", "window.top.CloseGlobalPopup();"); return; } DataTable PipelineInfo = LoansMgr.GetLoanPipelineInfo(this.iFileId); if (PipelineInfo.Rows.Count == 0) { PageCommon.WriteJsEnd(this, "Invalid File Id.", "window.top.CloseGlobalPopup();"); return; } #endregion #region 加载LoanConditions信息 LPWeb.BLL.LoanConditions LoanConditionsMgr = new LPWeb.BLL.LoanConditions(); DataTable ConditionInfo = LoanConditionsMgr.GetLoanConditionsInfo(this.iConditionID); if (ConditionInfo.Rows.Count == 0) { PageCommon.WriteJsEnd(this, "Invalid Condition ID.", "window.top.CloseGlobalPopup();"); return; } #endregion #region 加载LoanNotes信息 LoanNotes LoanNotesMgr = new LoanNotes(); DataTable NoteList = LoanNotesMgr.GetConditionNoteList(this.iFileId, this.iConditionID); this.rptNoteList.DataSource = NoteList; this.rptNoteList.DataBind(); #endregion if (this.IsPostBack == false) { #region Borrower string sBorrowerName = LoansMgr.GetLoanBorrowerName(this.iFileId); this.lbBorrower.Text = sBorrowerName; #endregion #region Property Address string PropertyAddr = LoansInfo.Rows[0]["PropertyAddr"].ToString(); string PropertyCity = LoansInfo.Rows[0]["PropertyCity"].ToString(); string PropertyState = LoansInfo.Rows[0]["PropertyState"].ToString(); string PropertyZip = LoansInfo.Rows[0]["PropertyZip"].ToString(); string sPropertyAddress = PropertyAddr + ", " + PropertyCity + ", " + PropertyState + " " + PropertyZip; this.lbPropertyAddress.Text = sPropertyAddress; #endregion #region Point Folder and Point filename string PointFolder = PipelineInfo.Rows[0]["Point Folder"].ToString(); this.lbPointFolder.Text = PointFolder; string Filename = PipelineInfo.Rows[0]["Filename"].ToString(); this.lbPointfilename.Text = Filename; #endregion this.lbConditionName.Text = ConditionInfo.Rows[0]["CondName"].ToString(); } }
/// <summary> /// list bind /// </summary> public void BindGvList() { string strWhere = " FileId = " + FileID; #region 条件 //status switch (ddlAllStatuses.SelectedValue.Trim()) { case "": break; case "Pending": strWhere += " and (Status is null or Status ='') "; break; case "Received": strWhere += " and Status ='Received' "; break; case "Submitted": strWhere += " and Status ='Submitted' "; break; case "Cleared": strWhere += " and Status ='Cleared' "; break; } //due dates switch (ddlAllDueDates.SelectedValue) { case "0": break; case "1": strWhere += " and datediff(d,getdate() ,due) < 0"; break; case "2": strWhere += " and datediff(d,getdate() ,due)<= 0"; break; case "3": strWhere += " and datediff(d,getdate() ,due) = 0 "; break; case "4": strWhere += " and datediff(d,getdate() ,due)= 1 "; break; case "5": strWhere += " and datediff(d,getdate() ,due) <= 7 and datediff(d,getdate() ,due) >= 0 "; break; } //gdc CR40 if (!string.IsNullOrEmpty(ddlType.SelectedValue.Trim())) { strWhere += " and CondType= '" + ddlType.SelectedValue.Trim() + "'"; } #endregion LPWeb.BLL.LoanConditions lcon = new LPWeb.BLL.LoanConditions(); int count = 0; gridList.DataSource = lcon.GetList(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, strWhere, out count); gridList.DataBind(); AspNetPager1.RecordCount = count; }
protected void Page_Load(object sender, EventArgs e) { // json示例 // {"ExecResult":"Success","ErrorMsg":""} // {"ExecResult":"Failed","ErrorMsg":"Failed to do sth."} #region 校验页面参数 string sError_Lost = "Lost required query string."; string sError_Invalid = "Invalid query string."; if (this.Request.QueryString["FileId"] == null) { this.Response.Write("{\"ExecResult\":\"Failed\",\"ErrorMsg\":\"" + sError_Lost + "\"}"); this.Response.End(); } string sFileId = this.Request.QueryString["FileId"]; if (PageCommon.IsID(sFileId) == false) { this.Response.Write("{\"ExecResult\":\"Failed\",\"ErrorMsg\":\"" + sError_Invalid + "\"}"); this.Response.End(); } if (this.Request.QueryString["ConditionId"] == null) { this.Response.Write("{\"ExecResult\":\"Failed\",\"ErrorMsg\":\"" + sError_Lost + "\"}"); this.Response.End(); } #endregion int iFileId = Convert.ToInt32(sFileId); string sConditionIds = this.Request.QueryString["ConditionId"]; string[] sConditionIDArr = sConditionIds.Split(','); string sErrorMsg = string.Empty; LPWeb.BLL.LoanConditions lcon = new LPWeb.BLL.LoanConditions(); LPWeb.BLL.LoanActivities lActive = new LPWeb.BLL.LoanActivities(); #region Update Condition(Mark as Received) UpdateConditionsRequest req = new UpdateConditionsRequest(); UpdateConditionsResponse resp = new UpdateConditionsResponse(); try { Conditions[] myConditions = new Conditions[sConditionIDArr.Length]; if (sConditionIDArr.Length < 1) { this.Response.Write("{\"ExecResult\":\"Success\",\"ErrorMsg\":\"\"}"); return; } int iConditionIdx = 0; foreach (string sConditionID in sConditionIDArr) { int iConditionId = 0; string sConditionName = ""; if (Int32.TryParse(sConditionID, out iConditionId) == false) { continue; } //Get Condition Status DataTable dtCondition = lcon.GetLoanConditionsInfo(iConditionId); if (dtCondition != null && dtCondition.Rows.Count > 0) { string sStatus = dtCondition.Rows[0]["Status"].ToString().Trim(); string Received_Date = dtCondition.Rows[0]["Received"].ToString().Trim(); sConditionName = dtCondition.Rows[0]["CondName"].ToString().Trim(); if (sStatus == "Cleared" || sStatus == "Received") { if ((Received_Date != null) && (Received_Date != string.Empty)) { continue; } } } else { continue; } Conditions condition = new Conditions(); condition.ConditionId = iConditionId; condition.Name = sConditionName; condition.Status = "Received"; myConditions.SetValue(condition, iConditionIdx); iConditionIdx++; } req.ConditionList = new Conditions[iConditionIdx]; int i = 0; foreach (Conditions myCon in myConditions) { if (myCon == null) { continue; } req.ConditionList.SetValue(myCon, i); i++; } if (req.ConditionList.Length < 1) { this.Response.Write("{\"ExecResult\":\"Success\",\"ErrorMsg\":\"\"}"); return; } #region Invoking WCF ServiceManager sm = new ServiceManager(); using (LP2ServiceClient service = sm.StartServiceClient()) { req.FileId = iFileId; req.hdr = new ReqHdr(); req.hdr.UserId = CurrUser.iUserID; resp = service.UpdateConditions(req); if (resp == null || resp.hdr == null) { this.Response.Write("{\"ExecResult\":\"Failed\",\"ErrorMsg\":\"UpdateConditions is NULL\"}"); return; } sErrorMsg = resp.hdr.StatusInfo; if (resp.hdr.Successful == true) { foreach (Conditions conObj in req.ConditionList) { if (conObj == null) { continue; } //Update Loan Condition Status lcon.UpdateConditionStatusToReceived(conObj.ConditionId, CurrUser.sFullName); //Insert Loan Activities LPWeb.Model.LoanActivities lActiveMode = new LPWeb.Model.LoanActivities(); lActiveMode.FileId = iFileId; lActiveMode.ActivityName = "Marked Condition – " + conObj.Name + " as Received"; lActiveMode.ActivityTime = DateTime.Now; lActiveMode.UserId = CurrUser.iUserID; lActive.Add(lActiveMode); } this.Response.Write("{\"ExecResult\":\"Success\",\"ErrorMsg\":\"\"}"); return; } else { sErrorMsg = "Update Condition Exception: " + sErrorMsg; this.Response.Write("{\"ExecResult\":\"Failed\",\"ErrorMsg\":\"" + sErrorMsg + "\"}"); return; } } #endregion Invoking WCF } catch (System.ServiceModel.EndpointNotFoundException) { sErrorMsg = string.Format("Exception: Point Manager is not running."); LPLog.LogMessage(LogType.Logerror, sErrorMsg); this.Response.Write("{\"ExecResult\":\"Failed\",\"ErrorMsg\":\"" + sErrorMsg + "\"}"); return; } catch (Exception ex) { sErrorMsg = string.Format("error: {0}", ex.Message); LPLog.LogMessage(LogType.Logerror, sErrorMsg); sErrorMsg = "Point Manager Exception: Database timeout expired"; this.Response.Write("{\"ExecResult\":\"Failed\",\"ErrorMsg\":\"" + sErrorMsg + "\"}"); return; } #endregion }