//private void GetCurrentLoan(DataTable dt) // { // if (!string.IsNullOrEmpty(dt.Rows[0]["PropertyAddr"].ToString())) // { // txtStreetAddress1.Text= dt.Rows[0]["PropertyAddr"].ToString(); // } // if (!string.IsNullOrEmpty(dt.Rows[0]["LoanType"].ToString())) // { // } // if (!string.IsNullOrEmpty(dt.Rows[0]["ProspectLoanStatus"].ToString())) // { // lblStatus.Text = dt.Rows[0]["ProspectLoanStatus"].ToString(); // } //} protected void btnAdd_Click(object sender, EventArgs e) { try { #region Create Lead – Other Income/Comments tab try { LoanNotes ln = new LoanNotes(); ln.UpdateNoteAndProspectIncomeAndProspectAssets(1, txtComments.Text.Trim(), txtOtherMonthlyIncome.Text.Trim(), txtLiquidAsset.Text.Trim()); } catch (Exception ex) { PageCommon.AlertMsg(this, "Failed to save contact and prospect for borrower."); return; } #endregion } catch { PageCommon.WriteJsEnd(this, "Please enter the borrower information!", "window.parent.location.href=window.parent.location.href"); } }
protected void btnSave_Click(object sender, EventArgs e) { string err = ""; string sNote = this.txtNote.Text.Trim(); try { if (this.txtNote.Text.Trim() == "") { PageCommon.AlertMsg(this, "Please input the note!"); return; } DateTime dtNow = DateTime.Now; string senderName = this.CurrUser.sFirstName + " " + this.CurrUser.sLastName; bool exported = UpdatePointNote(this.iFileId, dtNow, senderName, out err); LoanNotes LoanNotesMgr = new LoanNotes(); LoanNotesMgr.InsertConditionNote(this.iFileId, this.iConditionID, sNote, this.chkExternalViewingEnabled.Checked, this.CurrUser.sFirstName + " " + this.CurrUser.sLastName); // success PageCommon.WriteJsEnd(this, "Add Note successfully.", "window.top.RefreshConditionsTab();window.top.CloseGlobalPopup();"); } catch (Exception exception) { err = "Failed to add note, reason:" + exception.Message; PageCommon.WriteJsEnd(this, err, PageCommon.Js_RefreshSelf); } }
protected void btnSave_Click(object sender, EventArgs e) { string err = ""; try { if (tbxNote.Text.Trim() == "") { PageCommon.AlertMsg(this, "Please input the note!"); return; } //if(tbxNote.Text.Trim().Length>500) //{ // PageCommon.AlertMsg(this, "The note length must be less than 500 characters!"); // return; //} int fileId = int.Parse(hfdFileId.Value); var curUser = new LoginUser(); string senderName = curUser.sFirstName + " " + curUser.sLastName; string sLocalTime = hfLocalTime.Value; DateTime dtNow = Convert.ToDateTime(sLocalTime); bool exported = UpdatePointNote(fileId, dtNow, senderName, out err); var model = new Model.LoanNotes { Note = tbxNote.Text, FileId = fileId, Created = dtNow, //DateTime.Now, Sender = senderName, Exported = exported, ExternalViewing = cbExternalViewing.Checked }; var bllLoanNotes = new LoanNotes(); bllLoanNotes.Add(model); if (!exported) { PageCommon.WriteJs(this, err, "parent.ClosePopupWindow();"); } else { PageCommon.WriteJs(this, "Added note successfully.", "parent.ClosePopupWindow();"); //PageCommon.WriteJsEnd(this, "Add note Failed.", PageCommon.Js_RefreshSelf); } } catch (Exception exception) { err = "Failed to add note, reason:" + exception.Message + " LocalTime:" + hfLocalTime.Value; LPLog.LogMessage(err); PageCommon.WriteJsEnd(this, err, PageCommon.Js_RefreshSelf); } }
/// <summary> /// /// </summary> /// <param name="iFileId"></param> /// <param name="sComments"></param> private void CreateLoanNotes(int iFileId, string sComments) { #region create LoanNotes LPWeb.Model.LoanNotes LoanNotesModel = new LPWeb.Model.LoanNotes(); LoanNotesModel.FileId = iFileId; LoanNotesModel.Created = DateTime.Now; LoanNotesModel.Sender = this.CurrUser.sFirstName + " " + this.CurrUser.sLastName; LoanNotesModel.Note = sComments; LoanNotes LoanNotesMgr = new LoanNotes(); LoanNotesMgr.Add(LoanNotesModel); #endregion }
protected void lnkDisable_Click(object sender, EventArgs e) { string NoteIDs = this.hdnNoteIDs.Value; if (NoteIDs == string.Empty) { PageCommon.WriteJsEnd(this, "Please select a note first.", PageCommon.Js_RefreshSelf); return; } LoanNotes LoanNotesMgr = new LoanNotes(); LoanNotesMgr.EnableExternalViewing(NoteIDs, false); // Success PageCommon.WriteJsEnd(this, "Disable External Viewing successfully.", PageCommon.Js_RefreshSelf); }
private void BindPage(int fileId, int noteId) { var bllLoans = new Loans(); var bllLoanNotes = new LoanNotes(); var bllContact = new Contacts(); Model.Loans modelLoan = bllLoans.GetModel(fileId); if (modelLoan != null) { lblProperty.Text = modelLoan.PropertyAddr + " " + modelLoan.PropertyCity + " " + modelLoan.PropertyState + " " + modelLoan.PropertyZip; } var curUser = this.CurrUser; lblSender.Text = curUser.sFirstName + " " + curUser.sLastName; lblBorrower.Text = bllContact.GetBorrower(fileId); if (noteId > 0) { Model.LoanNotes modelNotes = bllLoanNotes.GetModel(noteId); tbxNote.Text = modelNotes.Note; lblSender.Text = modelNotes.Sender; cbExternalViewing.Checked = modelNotes.ExternalViewing; #region 加载Condition信息 DataTable LoanNotesInfo = bllLoanNotes.GetLoanNotesInfo(noteId); if (LoanNotesInfo.Rows.Count > 0) { if (LoanNotesInfo.Rows[0]["LoanConditionId"] != DBNull.Value) { int iConditionID = Convert.ToInt32(LoanNotesInfo.Rows[0]["LoanConditionId"]); BLL.LoanConditions LoanConditionsMgr = new BLL.LoanConditions(); DataTable ConditionInfo = LoanConditionsMgr.GetLoanConditionsInfo(iConditionID); if (ConditionInfo.Rows.Count > 0) { this.lbCondition.Text = ConditionInfo.Rows[0]["CondName"].ToString(); } } } #endregion } }
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(); } }
private bool SaveLoanNotes() { if (NoteSaved) { return(true); } string err = ""; string Note = Request.Form["tbxNote"].ToString().Trim(); bool cbExternalViewing = true; if (Request.Form["cbExternalViewing"] == null || string.IsNullOrEmpty(Request.Form["cbExternalViewing"].ToString())) { cbExternalViewing = false; } else { cbExternalViewing = Request.Form["cbExternalViewing"].ToString().ToUpper() == "ON" ? true : false; } try { if (Note == "") { //PageCommon.AlertMsg(this, "Please input the note!"); //ErrorMsg("Please input the note!"); return(true); //gdc CR43 为空时不添加Note ,需要在调用前综合判定 Note 和 Attachment } //if (Note.Length > 500) //{ // //PageCommon.AlertMsg(this, "The note length must be less than 500 characters!"); // ErrorMsg("The note length must be less than 500 characters!"); // return false; //} int fileId = iLoanID; var curUser = new LoginUser(); string senderName = curUser.sFirstName + " " + curUser.sLastName; DateTime dtNow = Convert.ToDateTime(sLocalTime); dtNow.AddMinutes(2); dtNow.AddSeconds(5); var req = new AddNoteRequest { FileId = fileId, Created = dtNow,//DateTime.Now, NoteTime = dtNow, Note = Note, Sender = senderName, hdr = new ReqHdr { UserId = curUser.iUserID } }; ServiceManager sm = new ServiceManager(); using (LP2ServiceClient client = sm.StartServiceClient()) { AddNoteResponse res = client.AddNote(req); bool exported = res.hdr.Successful; var model = new Model.LoanNotes { Note = Note, FileId = fileId, Created = dtNow,//DateTime.Now, Sender = senderName, Exported = exported, ExternalViewing = cbExternalViewing }; var bllLoanNotes = new LoanNotes(); bllLoanNotes.Add(model); NoteSaved = true; if (!exported) { //PageCommon.WriteJs(this, res.hdr.StatusInfo, "parent.ClosePopupWindow();"); ErrorMsg(res.hdr.StatusInfo); return(false); } else { //PageCommon.WriteJs(this, "Add note successfully.", "parent.ClosePopupWindow();"); //PageCommon.WriteJsEnd(this, "Add note Failed.", PageCommon.Js_RefreshSelf); return(true); } } } catch (System.ServiceModel.EndpointNotFoundException ee) { LPLog.LogMessage(ee.Message); //PageCommon.AlertMsg(this, "Failed to add note, reason: Point Manager is not running."); ErrorMsg("Failed to add note, reason: Point Manager is not running."); return(false); } catch (Exception exception) { err = "Failed to add note, reason:" + exception.Message + " LocalTime:" + sLocalTime; LPLog.LogMessage(err); // PageCommon.WriteJsEnd(this, err, PageCommon.Js_RefreshSelf); ErrorMsg(err); return(false); } }