public void updatePriorityDetails(priorityDetail priorityDetails) { try { dbDataContext ct = new dbDataContext(); priorityDetail detail = null; //retrieve existing saving goal var queryPriorityDetails = from al in ct.priorityDetails where al.caseid == priorityDetails.caseid select al; foreach (priorityDetail priorityDetailObject in queryPriorityDetails) { detail = priorityDetailObject; } detail.protection1 = priorityDetails.protection1; detail.protection2 = priorityDetails.protection2; detail.protection3 = priorityDetails.protection3; detail.protection4 = priorityDetails.protection4; detail.protection5 = priorityDetails.protection5; detail.savings1 = priorityDetails.savings1; detail.savings2 = priorityDetails.savings2; detail.savings3 = priorityDetails.savings3; ct.SubmitChanges(); } catch (Exception e) { string str = e.Message; } }
public void savePriorityDetails(priorityDetail priorityDetails) { try { dbDataContext ct = new dbDataContext(); ct.priorityDetails.InsertOnSubmit(priorityDetails); ct.SubmitChanges(); } catch (Exception e) { string str = e.Message; } }
public List<string> printErrorMessages(priorityDetail detail) { List<string> list = new List<string>(); if (detail != null) { if ((detail.protection1 == null || detail.protection1 == "") && (detail.protection2 == null || detail.protection2 == "") && (detail.protection3 == null || detail.protection3 == "") && (detail.protection4 == null || detail.protection4 == "") && (detail.savings1 == null || detail.savings1 == "") && (detail.savings2 == null || detail.savings2 == "") && (detail.savings3 == null || detail.savings3 == "")) { //list.Add("Please enter at least one priority value"); list.Add(""); } } return list; }
public string getPriorityDetailStatus(priorityDetail priorityDetail) { string status = "complete"; /*if ((priorityDetail.protection1 == null || priorityDetail.protection1 == "") && (priorityDetail.protection2 == null || priorityDetail.protection2 == "") && (priorityDetail.protection3 == null || priorityDetail.protection3 == "") && (priorityDetail.protection4 == null || priorityDetail.protection4 == "") && (priorityDetail.savings1 == null || priorityDetail.savings1 == "") && (priorityDetail.savings2 == null || priorityDetail.savings2 == "") && (priorityDetail.savings3 == null || priorityDetail.savings3 == "")) { status = "incomplete"; }*/ return status; }
protected void savePriorityDetails(object sender, EventArgs e) { string caseId = ""; priorityDetail detail = new priorityDetail(); priorityDetail existingDetail; if (ViewState["caseId"] != null) { caseId = ViewState["caseId"].ToString(); //detail.caseId =caseId ; } string actv = ""; if (ViewState["activity"] != null) { actv = ViewState["activity"].ToString(); } if (priorityNeed1.Text != null || priorityNeed1.Text != "") detail.protection1 = priorityNeed1.Text.Trim(); if (priorityNeed2.Text != null || priorityNeed2.Text != "") detail.protection2 = priorityNeed2.Text.Trim(); if (priorityNeed3.Text != null || priorityNeed3.Text != "") detail.protection3 = priorityNeed3.Text.Trim(); if (priorityNeed4.Text != null || priorityNeed4.Text != "") detail.savings1 = priorityNeed4.Text.Trim(); if (priorityNeed5.Text != null || priorityNeed5.Text != "") detail.savings2 = priorityNeed5.Text.Trim(); if (priorityNeed6.Text != null || priorityNeed6.Text != "") detail.savings3 = priorityNeed6.Text.Trim(); if (priorityNeed7.Text != null || priorityNeed7.Text != "") detail.protection4 = priorityNeed7.Text.Trim(); if (priorityNeed8.Text != null || priorityNeed8.Text != "") detail.protection5 = priorityNeed8.Text.Trim(); detail.caseid = caseId; PriorityDetailsDAO dao = new PriorityDetailsDAO(); existingDetail = dao.getPriorityDetails(caseId); if (existingDetail == null) { dao.savePriorityDetails(detail); } else { dao.updatePriorityDetails(detail); } string status = activityStatusCheck.getPriorityDetailStatus(detail); activityStatusDao.saveOrUpdateActivityStatus(caseId, actv, status); markStatusOnTab(caseId); string caseStatus = activityStatusCheck.getZPlanStatus(caseId); string url = Server.MapPath("~/_layouts/Zurich/Printpages/"); pdfData = activityStatusCheck.sendDataToSalesPortal(caseId, caseStatus, url, sendPdf); /*if (st == 1) { lblStatusSubmitted.Visible = false; } else { lblStatusSubmissionFailed.Visible = true; }*/ populatePriorityDetails(detail, caseId); lblPdSummarySaveSuccess.Visible = true; }
protected void populatePriorityDetails(priorityDetail detail,string caseId) { if(detail!=null) { if (detail.protection1!=null) priorityNeed1.Text = detail.protection1.Trim(); if (detail.protection2 != null) priorityNeed2.Text = detail.protection2.Trim(); if (detail.protection3 != null) priorityNeed3.Text = detail.protection3.Trim(); if (detail.protection4 != null) priorityNeed7.Text = detail.protection4.Trim(); if (detail.savings1 != null) priorityNeed4.Text = detail.savings1.Trim(); if (detail.savings2 != null) priorityNeed5.Text = detail.savings2.Trim(); if (detail.savings3 != null) priorityNeed6.Text = detail.savings3.Trim(); if (detail.protection5 != null) priorityNeed8.Text = detail.protection5.Trim(); /* List<string> errors = printErrorMessages(detail); this.ErrorRepeater.DataSource = errors; this.ErrorRepeater.DataBind(); */ } activityId.Value = caseId; }
protected void Page_Load(object sender, EventArgs e) { activity = activityStatusDao.getActivity(2); ViewState["activity"] = activity; lblPdSummarySaveSuccess.Visible = false; lblPdSummarySaveFailed.Visible = false; if (!IsPostBack) { string nextCaseId = Request.Form["caseid"]; string menuCaseId = Request.QueryString["caseid"]; string helperUsed = Request.Form["helperUsed"]; if (nextCaseId != null && nextCaseId != "") { caseId = nextCaseId; } if (menuCaseId != null && menuCaseId != "") { caseId = menuCaseId; } if (Session["fnacaseid"] != null) { caseId = Session["fnacaseid"].ToString(); } ViewState["caseId"] = caseId; if (caseId != null || caseId != "") { PriorityDetailsDAO dao = new PriorityDetailsDAO(); priorityDetail detail=new priorityDetail(); detail = dao.getPriorityDetails(caseId); populatePriorityDetails(detail, caseId); } } markStatusOnTab(caseId); }
partial void DeletepriorityDetail(priorityDetail instance);
partial void UpdatepriorityDetail(priorityDetail instance);
partial void InsertpriorityDetail(priorityDetail instance);