protected void ButtonAppAckLetter_Click(object sender, EventArgs e) { int id = 0; //InvestorApplicationDS investor = new InvestorApplicationDS(); DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter dta = new DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter(); //DataUtils.InvestorApplicationTableAdapters.InvestorApplicationsTableAdapter dta = new DataUtils.InvestorApplicationTableAdapters.InvestorApplicationsTableAdapter(); DataUtils.InvestorDS.InvestorApplicationsDataTable dt = new InvestorDS.InvestorApplicationsDataTable(); dt = dta.GetDataById(id); if (dt.Rows.Count != 1) { throw new ArgumentException(String.Concat("InvestorApplication with Id ", id, " could not be found."), "InvestorApplication.Id"); } DataUtils.InvestorDS.InvestorApplicationsRow currentRow = dt.Rows[0] as InvestorDS.InvestorApplicationsRow; if (null != currentRow) { currentRow.CondCreditDecisionDate = DateTime.Now; currentRow.CondCreditDecisionBy = "pdvorak"; currentRow.CondCreditDecision = ((char)CondCreditDecisionResult.Accepted).ToString(); dta.Update(currentRow); } Response.Redirect("~/InvestorApplicantsNewAll.aspx"); }
protected void btnCondRejectModal_Click(object sender, EventArgs e) { int id = GetIdFromReqParam(); if (id <= 0) { throw new ArgumentException(String.Format("The Application Id {0} is not valid: ", id), "id"); } DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter dta = new DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter(); //DataUtils.InvestorApplicationTableAdapters.InvestorApplicationsTableAdapter dta = new DataUtils.InvestorApplicationTableAdapters.InvestorApplicationsTableAdapter(); DataUtils.InvestorDS.InvestorApplicationsDataTable dt = new InvestorDS.InvestorApplicationsDataTable(); dt = dta.GetDataById(id); if (dt.Rows.Count != 1) { throw new ArgumentException(String.Concat("InvestorApplication with Id ", id, " could not be found."), "InvestorApplication.Id"); } DataUtils.InvestorDS.InvestorApplicationsRow currentRow = dt.Rows[0] as InvestorDS.InvestorApplicationsRow; if (null != currentRow) { try { currentRow.CondCreditDecisionDate = DateTime.Now; currentRow.CondCreditDecisionBy = "pdvorak"; currentRow.CondCreditDecision = ((char)CondCreditDecisionResult.Rejected).ToString(); dta.Update(currentRow); SetErrorText(String.Empty); Response.Redirect("~/InvestorApplicantsNewAll.aspx"); } catch (Exception ex) { SetErrorText("Error saving Conditional Decision on Application Id: " + id.ToString() + ex.Message + ex.StackTrace); return; } } else { SetErrorText("Error finding Application Id: " + id.ToString()); } }
protected void btn_CondApprovedModal_Click(object sender, EventArgs e) { int investAppid = GetIdFromReqParam(); #region oldCode //InvestorApplicationDS investor = new InvestorApplicationDS(); //DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter idta = new DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter(); ////DataUtils.InvestorApplicationTableAdapters.InvestorApplicationsTableAdapter dta = new DataUtils.InvestorApplicationTableAdapters.InvestorApplicationsTableAdapter(); //DataUtils.InvestorDS.InvestorApplicationsDataTable dt = new InvestorDS.InvestorApplicationsDataTable(); //dt = idta.GetDataById(id); //if (dt.Rows.Count != 1) //{ // throw new ArgumentException(String.Concat("InvestorApplication with Id ", id, " could not be found."), "InvestorApplication.Id"); //} //DataUtils.InvestorDS.InvestorApplicationsRow invApp = dt.Rows[0] as InvestorDS.InvestorApplicationsRow; //if (null != invApp) //{ // DataUtils.InvestorDS.InvestorDataTable idt = new InvestorDS.InvestorDataTable(); // DataUtils.InvestorDSTableAdapters.InvestorTableAdapter ita = new InvestorTableAdapter(); // DataUtils.InvestorDS.InvestorRow newInv = idt.NewInvestorRow(); // DataUtils.InvestorDS.InvestorRow newInvOth; // newInv.InvestorApplicationId = invApp.Id; // newInv.LastName = invApp.Primary_LastName; // newInv.FirstName = invApp.Primary_FirstName; // newInv.DOB = invApp.Primary_DOB; // newInv.Res_Street1 = invApp.Primary_Res_Street1; // newInv.Res_Suburb = invApp.Primary_Res_Suburb; // newInv.Res_Postcode = invApp.Primary_Res_PostCode; // newInv.Res_State = invApp.Primary_Res_State; // newInv.Res_Country = invApp.Primary_Res_Country; // newInv.AssquireStatus = "N"; // newInv.AppliedDate = invApp.EntryDate; // newInv.Created = DateTime.Now; // newInv.CreatedBy = "dvorakpj"; // idt.AddInvestorRow(newInv); // try // { // int updates = ita.Update(idt); // if (updates != 1) // { // throw new ApplicationException("Failed to create a new permanent record for the Primary Investor from Application ID:" + id.ToString()); // } // } // catch (Exception ex) // { // this.txtValidationErrors.Visible = true; // this.txtValidationErrors.Text = "Failed to create a new permanent record for the Primary Investor from Application ID:" + id.ToString() + ex.Message + ex.StackTrace; // //this // } // if ((invApp.ApplicantType != "Single") && (invApp.IsOther_LastNameNull())) // { // //DataUtils.InvestorDS.InvestorDataTable idt = new InvestorDS.InvestorDataTable(); // newInvOth = idt.NewInvestorRow(); // newInvOth.PrimaryInvestorID = newInv.Id; // newInvOth.InvestorApplicationId = invApp.Id; // newInvOth.LastName = invApp.Other_LastName; // newInvOth.FirstName = invApp.Other_FirstName; // newInvOth.DOB = invApp.Other_DOB; // newInvOth.Res_Street1 = invApp.Other_Res_Street1; // newInvOth.Res_Suburb = invApp.Other_Res_Suburb; // newInvOth.Res_Postcode = invApp.Other_Res_PostCode; // newInvOth.Res_State = invApp.Other_Res_State; // newInvOth.Res_Country = invApp.Other_Res_Country; // newInvOth.AssquireStatus = "N"; // newInvOth.AppliedDate = invApp.EntryDate; // newInvOth.Created = DateTime.Now; // newInvOth.CreatedBy = "dvorakpj"; // idt.AddInvestorRow(newInvOth); // try // { // int updates2 = ita.Update(idt); // if (updates2 != 1) // { // throw new ApplicationException("Failed to create a permanent record for Other Investor for Application ID:" + id.ToString()); // } // } // catch (Exception ex) // { // this.txtValidationErrors.Visible = true; // this.txtValidationErrors.Text = "Failed to create a permanent record for Other Investor for Application ID:" + id.ToString() + ex.Message + ex.StackTrace; // return; // } // } // invApp.CondCreditDecisionDate = DateTime.Now; // invApp.CondCreditDecisionBy = "pdvorak"; // invApp.CondCreditDecision = ((char)CondCreditDecisionResult.Accepted).ToString(); // try // { // int updates3 = idta.Update(invApp); // } // catch (Exception ex) // { // this.txtValidationErrors.Visible = true; // this.txtValidationErrors.Text = "Failed to record credit decision for application ID:" + id.ToString() + ex.Message + ex.StackTrace; // return; // } //} #endregion oldCode #region updateApplic DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter dta = new DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter(); DataUtils.InvestorDS.InvestorApplicationsDataTable dt = new InvestorDS.InvestorApplicationsDataTable(); dt = dta.GetDataById(investAppid); if (dt.Rows.Count != 1) { throw new ArgumentException(String.Concat("InvestorApplication with Id ", investAppid, " could not be found."), "InvestorApplication.Id"); } DataUtils.InvestorDS.InvestorApplicationsRow currentRow = dt.Rows[0] as InvestorDS.InvestorApplicationsRow; if (null != currentRow) { try { currentRow.CondCreditDecisionDate = DateTime.Now; currentRow.CondCreditDecisionBy = "pdvorak"; currentRow.CondCreditDecision = ((char)CondCreditDecisionResult.Accepted).ToString(); dta.Update(currentRow); SetErrorText(String.Empty); } catch (Exception ex) { SetErrorText("Error saving Conditional Decision on Application Id: " + investAppid.ToString() + ex.Message + ex.StackTrace); return; } } else { SetErrorText("Error finding Application Id: " + investAppid.ToString()); return; } #endregion //now create a permanent investor record string errmsg = SaveInvestorPermRecord(investAppid); string properrmsg = SavePropertyPermRecord(investAppid); SetErrorText(errmsg); Response.Redirect("~/InvestorApplicantsNewAll.aspx"); }
protected void ButtonAppAckLetterSentModal_Click(object sender, EventArgs e) { int id = 0; // read current InvAppId if (String.IsNullOrEmpty(this.HiddenField1.Value)) { return; } else if (!Int32.TryParse(this.HiddenField1.Value, out id)) { return; } //get inv app row form DB for update DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter dta = new DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter(); DataUtils.InvestorDS.InvestorApplicationsDataTable dt = new InvestorDS.InvestorApplicationsDataTable(); dt = dta.GetDataById(id); if (dt.Rows.Count != 1) { throw new ArgumentException(String.Concat("InvestorApplication with Id ", id, " could not be found."), "InvestorApplication.Id"); } DataUtils.InvestorDS.InvestorApplicationsRow currentRow = dt.Rows[0] as InvestorDS.InvestorApplicationsRow; if (null != currentRow) { //bool condApproved = false; try { //condApproved = (("A" == currentRow.CondCreditDecision) || ("L" == currentRow.CondCreditDecision)); if (!String.IsNullOrEmpty(currentRow.CondCreditDecision)) { this.txtValidationErrors.Text = "Cannot send a letter of acknowledgement to already conditionally decisioned application."; //currentRow.AutoAcceptedInformed = DateTime.Now; //currentRow.AutoAcceptedInformedBy = "pdvorak"; //currentRow.AutoRejectedInformed = DateTime.Now; //currentRow.AutoRejectedInformedBy = "pdvorak"; this.DetailsView1.DataBind(); return; } else { currentRow.AppAckLetterSent = DateTime.Now; currentRow.AppAckLetterSentBy = "pdvorak"; currentRow.Modified = currentRow.AppAckLetterSent; currentRow.ModifiedBy = currentRow.AppAckLetterSentBy; dta.Update(currentRow); } } catch { this.txtValidationErrors.Text = "Error saving update"; this.DetailsView1.DataBind(); return; //error this app has to be approved first } } Response.Redirect("~/InvestorApplicantsNewAll.aspx"); return; }
/// <summary> /// Handler of button "Mark conditional Result as Sent" /// </summary> /// <param name="sender">originating control</param> /// <param name="e">event params</param> protected void ButtonCondResultSentModal_Click(object sender, EventArgs e) { int id = 0; id = GetIdFromReqParam(); if (id <= 0) { return; } else if (!Int32.TryParse(this.HiddenField1.Value, out id)) { return; } //InvestorApplicationDS investor = new InvestorApplicationDS(); DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter dta = new DataUtils.InvestorDSTableAdapters.InvestorApplicationsTableAdapter(); //DataUtils.InvestorApplicationTableAdapters.InvestorApplicationsTableAdapter dta = new DataUtils.InvestorApplicationTableAdapters.InvestorApplicationsTableAdapter(); DataUtils.InvestorDS.InvestorApplicationsDataTable dt = new InvestorDS.InvestorApplicationsDataTable(); dt = dta.GetDataById(id); if (dt.Rows.Count != 1) { throw new ArgumentException(String.Concat("InvestorApplication with Id ", id, " could not be found."), "InvestorApplication.Id"); } DataUtils.InvestorDS.InvestorApplicationsRow currentRow = dt.Rows[0] as InvestorDS.InvestorApplicationsRow; if (null != currentRow) { bool?condApproved = false; try { condApproved = (("A" == currentRow.CondCreditDecision) || ("L" == currentRow.CondCreditDecision)); if (condApproved.HasValue) { if (condApproved.Value) { //currentRow.AutoAcceptedInformed = DateTime.Now; //currentRow.AutoAcceptedInformedBy = "pdvorak"; } else { //currentRow.AutoRejectedInformed = DateTime.Now; //currentRow.AutoRejectedInformedBy = "pdvorak"; } } else { //error this app has to be approved first } } catch { //error this app has to be approved first } } Response.Redirect("~/InvestorApplicantsNewAll.aspx"); }