protected void Page_Load(object sender, EventArgs e) { Master.Logout = true; //View Updated details #region View updated Details n = int.Parse(Request.QueryString["Id"]); list = sbll.SearchByCustomerId(n); foreach (var li in list) { lblCustId1.Text = li.customerId.ToString(); lblAddress1.Text = li.address; lblDOB1.Text = li.customerDob.ToString(); if (li.gender == "M") { lblGender1.Text = "Male"; } else { lblGender1.Text = "Female"; } lblIDProof1.Text = li.idDescription; lblInsuredName1.Text = li.customerName; lblNomineeName1.Text = li.nomineName; lblPolicyNumber1.Text = li.policyNumber.ToString(); lblPremiumPaymentMethod1.Text = li.paymentMode; lblProductName1.Text = li.productName; lblRelationWithNominee1.Text = li.relationShip; if (li.smoker == "Y") { lblSmokerORNonSmoker1.Text = "Smoker"; } else { lblSmokerORNonSmoker1.Text = "Non-Smoker"; } lblTelephoneNumber1.Text = li.mobile.ToString(); lblIDProofNumber1.Text = li.idNumber.ToString(); lblProductLine1.Text = li.productDescription; lblEndoStatus1.Text = li.endo_Status; } #endregion }
protected void btnView_Click(object sender, EventArgs e) { SearchBLL bll = new SearchBLL(); //Search By policy Number #region Search y Policy Number if (ddlSearchPolicy.SelectedIndex == 0) { int policyNum = int.Parse(txtEnterPolicyNumber.Text); list = bll.SearchByPolicyNumber(policyNum); gvSearchResult.DataSource = list; gvSearchResult.DataBind(); } #endregion //Search By Customer ID #region Search by Customer ID if (ddlSearchPolicy.SelectedIndex == 1) { int custId = int.Parse(txtEnterCustomerID.Text); list = bll.SearchByCustomerId(custId); gvSearchResult.DataSource = list; gvSearchResult.DataBind(); } #endregion //Search By Name and DOB #region Search by Name and DOB if (ddlSearchPolicy.SelectedIndex == 2) { string Cname = txtEnterCustomerName.Text; string d = txtDOB.Text.ToString(); DateTime dob = Convert.ToDateTime(d); list = bll.SearchByName(Cname, dob); gvSearchResult.DataSource = list; gvSearchResult.DataBind(); } #endregion }
protected void Page_Load(object sender, EventArgs e) { CompareValidator1.ValueToCompare = DateTime.Today.ToShortDateString(); if (Page.IsPostBack == false) { //Update Initial View #region Update Initial View n = int.Parse(Request.QueryString["Id"]); list = sbll.SearchByCustomerId(n); foreach (var li in list) { txtCustomerId.Text = li.customerId.ToString(); txtAddress.Text = li.address; DateTime d = DateTime.Parse(li.customerDob.ToString()); txtDOB.Text = d.ToString("yyyy-MM-dd"); if (li.gender == "F") { rdbFemale.Checked = true; } else { rdbMale.Checked = true; } if (li.smoker == "Y") { rdbSmokeYes.Checked = true; } else { rdbSmokeNo.Checked = true; } if (li.productDescription == "Life") { rdbLife.Checked = true; } else { rdbNonLife.Checked = true; } if (li.idDescription == "Passport") { ddlIDProof.SelectedValue = "Passport"; } else if (li.idDescription == "PAN") { ddlIDProof.SelectedValue = "PAN"; } else if (li.idDescription == "Voter Card") { ddlIDProof.SelectedValue = "Voter Card"; } else { ddlIDProof.SelectedValue = "Aadhar Card"; } if (li.relationShip == "Father") { ddlRelation.SelectedValue = "Father"; } else if (li.relationShip == "Mother") { ddlRelation.SelectedValue = "Mother"; } else if (li.relationShip == "wife") { ddlRelation.SelectedValue = "wife"; } else if (li.relationShip == "Husband") { ddlRelation.SelectedValue = "Husband"; } else { ddlRelation.SelectedValue = "Others"; } if (li.paymentMode == "Quarterly") { ddlPremiumPaymentMethod.SelectedValue = "Quarterly"; } else if (li.paymentMode == "Monthly") { ddlPremiumPaymentMethod.SelectedValue = "Monthly"; } else if (li.paymentMode == "HalfYearly") { ddlPremiumPaymentMethod.SelectedValue = "HalfYearly"; } else { ddlPremiumPaymentMethod.SelectedValue = "Annually"; } txtInsuredName.Text = li.customerName; txtNomineeName.Text = li.nomineName; txtPolicyNumber.Text = li.policyNumber.ToString(); txtProductName.Text = li.productName; txtTelephoneNumber.Text = li.mobile.ToString(); txtIDProofNumber.Text = li.idNumber.ToString(); txtendo.Text = li.endo_Status; #endregion } } }