protected DataTable CustomerIdList(DataTable dt, int customerId) { int i = 0; List <CustomerFamilyVo> customerFamilyVoList = new List <CustomerFamilyVo>(); CustomerFamilyBo customerFamilyBo = new CustomerFamilyBo(); customerFamilyVoList = customerFamilyBo.GetCustomerFamily(customerId); if (customerFamilyVoList != null) { foreach (CustomerFamilyVo customerfamilyvo in customerFamilyVoList) { dt.Rows[i]["C_CustomerId"] = customerfamilyvo.AssociateCustomerId; dt.Rows[i]["CA_AssociationId"] = customerfamilyvo.AssociationId; i++; } } return(dt); }
protected void Page_Load(object sender, EventArgs e) { SessionBo.CheckSession(); userVo = (UserVo)Session[SessionContents.UserVo]; path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString()); try { // customerFamilyList = new List<CustomerFamilyVo>(); customerVo = (CustomerVo)Session["CustomerVo"]; rmVo = (RMVo)Session["RmVo"]; customerId = customerVo.CustomerId; StringBuilder sbAddress = new StringBuilder(); lblName.Text = customerVo.FirstName.ToString() + " " + customerVo.MiddleName.ToString() + " " + customerVo.LastName.ToString(); lblPhone.Text = customerVo.ResISDCode.ToString() + " - " + customerVo.ResSTDCode.ToString() + " - " + customerVo.ResPhoneNum.ToString(); lblEmail.Text = customerVo.Email.ToString(); sbAddress.Append(customerVo.Adr1Line1.ToString()); sbAddress.Append("<br />"); sbAddress.Append(customerVo.Adr1Line2.ToString()); sbAddress.Append("<br />"); sbAddress.Append(customerVo.Adr1Line3.ToString()); sbAddress.Append("<br />"); sbAddress.Append(customerVo.Adr1PinCode.ToString()); sbAddress.Append("<br />"); if (customerVo.Adr1State.ToString() != "") { sbAddress.Append(XMLBo.GetStateName(path, customerVo.Adr1State.ToString())); sbAddress.Append("<br />"); } sbAddress.Append(customerVo.Adr1City.ToString()); sbAddress.Append("<br />"); sbAddress.Append(customerVo.Adr1Country.ToString()); lblAddress.Text = sbAddress.ToString(); Session["RmVo"] = rmVo; // Session["CustomerVo"] = customerVo; Session["Check"] = "Dashboard"; //Binding the Customer Family Grid customerFamilyList = customerFamilyBo.GetCustomerFamily(customerVo.CustomerId); if (customerFamilyList == null) { tdFamilyDetailsHeader.Visible = false; tdFamilyDetailsGrid.Visible = false; } else { DataTable dtCustomerFamilyList = new DataTable(); dtCustomerFamilyList.Columns.Add("CustomerId"); dtCustomerFamilyList.Columns.Add("Name"); dtCustomerFamilyList.Columns.Add("Relationship"); DataRow drCustomerFamily; for (int i = 0; i < customerFamilyList.Count; i++) { drCustomerFamily = dtCustomerFamilyList.NewRow(); CustomerFamilyVo customerFamilyVo = new CustomerFamilyVo(); customerFamilyVo = customerFamilyList[i]; drCustomerFamily[0] = customerFamilyVo.AssociateCustomerId.ToString(); drCustomerFamily[1] = customerFamilyVo.AssociateCustomerName.ToString(); drCustomerFamily[2] = customerFamilyVo.Relationship; dtCustomerFamilyList.Rows.Add(drCustomerFamily); } if (dtCustomerFamilyList.Rows.Count > 0) { gvFamilyMembers.DataSource = dtCustomerFamilyList; gvFamilyMembers.DataBind(); gvFamilyMembers.Visible = true; } else { gvFamilyMembers.DataSource = null; gvFamilyMembers.DataBind(); } } //Call the function to bind the Bank Details lblBankDetailsMsg.Visible = false; BindBankDetails(); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "RMCustomerDashboard.ascx:Page_Load()"); object[] objects = new object[4]; objects[0] = customerFamilyList; objects[1] = rmVo; objects[2] = customerVo; objects[3] = userVo; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
protected void Page_Load(object sender, EventArgs e) { try { int customerId = 0; advisorVo = (AdvisorVo)Session["advisorVo"]; if (!IsPostBack) { dt = new DataTable(); dt.Columns.Add("C_CustomerId"); dt.Columns.Add("CA_AssociationId"); dt.Columns.Add("CustomerRelationship"); dt.Columns.Add("FirstName"); dt.Columns.Add("MiddleName"); dt.Columns.Add("LastName"); dt.Columns.Add("DOB"); dt.Columns.Add("EmailId"); Session[SessionContents.FPS_AddProspect_DataTable] = dt; } else { dt = (DataTable)Session[SessionContents.FPS_AddProspect_DataTable]; } //SqlDataSourceCustomerRelation.ConnectionString = ConfigurationManager.ConnectionStrings["wealtherp"].ConnectionString; rmVo = (RMVo)Session["rmVo"]; BindBranch(advisorVo, rmVo); if (Session[SessionContents.FPS_AddProspectListActionStatus] != null) { customerId = int.Parse(Session[SessionContents.FPS_ProspectList_CustomerId].ToString()); customerVo = customerBo.GetCustomer(customerId); customerFamilyVoList = customerFamilyBo.GetCustomerFamily(customerId); if (customerFamilyVoList != null) { totalRecordsCount = customerFamilyVoList.Count; dt.Rows.Clear(); foreach (CustomerFamilyVo customerFamilyVo in customerFamilyVoList) { DataRow dr = dt.NewRow(); dr["CA_AssociationId"] = customerFamilyVo.AssociationId; dr["C_CustomerId"] = customerFamilyVo.AssociateCustomerId; dr["CustomerRelationship"] = customerFamilyVo.RelationshipCode; dr["FirstName"] = customerFamilyVo.FirstName; dr["MiddleName"] = customerFamilyVo.MiddleName; dr["LastName"] = customerFamilyVo.LastName; dr["DOB"] = customerFamilyVo.DOB.ToShortDateString(); dr["EmailId"] = customerFamilyVo.EmailId; dt.Rows.Add(dr); } Session[SessionContents.FPS_AddProspect_DataTable] = dt; } else { tblChildCustomer.Visible = false; } txtFirstName.Text = customerVo.FirstName; txtMiddleName.Text = customerVo.MiddleName; txtLastName.Text = customerVo.LastName; if (customerVo.Dob != DateTime.Parse("01/01/0001 00:00:00") && customerVo.Dob != null) { dpDOB.SelectedDate = customerVo.Dob; } txtEmail.Text = customerVo.Email; for (int i = 0; i < ddlPickBranch.Items.Count; i++) { if (ddlPickBranch.Items[i].Value == customerVo.BranchId.ToString()) { ddlPickBranch.SelectedIndex = i; } } Rebind(); if (Session[SessionContents.FPS_AddProspectListActionStatus].ToString() == "View") { // View things have been handled here aplToolBar.Visible = true; btnSubmit.Visible = false; btnSubmitAddDetails.Visible = false; if (customerFamilyVoList != null) { RadGrid1.Columns[RadGrid1.Columns.Count - 1].Visible = false; RadGrid1.Columns[0].Visible = false; RadGrid1.AllowAutomaticInserts = false; RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None; ChildCustomerGridPanel.Enabled = false; } else { ChildCustomerGridPanel.Visible = false; } //Disabling all Fields txtEmail.Enabled = false; txtFirstName.Enabled = false; txtLastName.Enabled = false; txtMiddleName.Enabled = false; ddlPickBranch.Enabled = false; dpDOB.Enabled = false; headertitle.Text = "View Prospect"; } else if (Session[SessionContents.FPS_AddProspectListActionStatus].ToString() == "Edit") { // Edit thing have been handled here aplToolBar.Visible = true; RadToolBarButton rtb = (RadToolBarButton)aplToolBar.Items.FindItemByValue("Edit"); rtb.Visible = false; btnSubmit.Visible = true; btnSubmitAddDetails.Visible = true; btnSubmit.Text = "Update"; btnSubmitAddDetails.Text = "Edit Finance Details"; RadGrid1.Columns[RadGrid1.Columns.Count - 1].Visible = false; tblChildCustomer.Visible = true; headertitle.Text = "Edit Prospect"; } } RadGrid1.Columns[RadGrid1.Columns.Count - 1].Visible = false; } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { try { SessionBo.CheckSession(); userVo = (UserVo)Session["userVo"]; customerVo = customerBo.GetCustomerInfo(userVo.UserId); Session["CustomerVo"] = customerVo; lblName.Text = customerVo.FirstName.ToString() + " " + customerVo.MiddleName.ToString() + " " + customerVo.LastName.ToString(); lblPhone.Text = customerVo.ResISDCode.ToString() + " - " + customerVo.ResSTDCode.ToString() + " - " + customerVo.ResPhoneNum.ToString(); lblAddress.Text = customerVo.Adr1Line1.ToString() + "<br />" + customerVo.Adr1Line1.ToString() + "<br />" + customerVo.Adr1Line2.ToString() + "<br />" + customerVo.Adr1Line3.ToString() + "<br />" + customerVo.Adr1PinCode.ToString() + "<br />" + customerVo.Adr1State.ToString() + "<br />" + customerVo.Adr1City.ToString() + "<br />" + customerVo.Adr1Country.ToString(); customerFamilyList = customerFamilyBo.GetCustomerFamily(customerVo.CustomerId); if (customerFamilyList != null) { trFamilyMembers.Visible = true; DataTable dtCustomerFamilyList = new DataTable(); dtCustomerFamilyList.Columns.Add("AssociationId"); dtCustomerFamilyList.Columns.Add("Name"); dtCustomerFamilyList.Columns.Add("Relationship"); DataRow drCustomerFamily; for (int i = 0; i < customerFamilyList.Count; i++) { drCustomerFamily = dtCustomerFamilyList.NewRow(); CustomerFamilyVo customerFamilyVo = new CustomerFamilyVo(); customerFamilyVo = customerFamilyList[i]; drCustomerFamily[0] = customerFamilyVo.AssociationId.ToString(); drCustomerFamily[1] = customerFamilyVo.AssociateCustomerName.ToString(); drCustomerFamily[2] = customerFamilyVo.Relationship; dtCustomerFamilyList.Rows.Add(drCustomerFamily); } if (dtCustomerFamilyList.Rows.Count > 0) { gvFamilyMembers.DataSource = dtCustomerFamilyList; gvFamilyMembers.DataBind(); gvFamilyMembers.Visible = true; trFamilyMembers.Visible = true; } else { gvFamilyMembers.DataSource = null; gvFamilyMembers.DataBind(); trFamilyMembers.Visible = false; } } else { gvFamilyMembers.DataSource = null; gvFamilyMembers.DataBind(); trFamilyMembers.Visible = false; } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "CustomerIndividualDashboard.ascx:Page_Load()"); object[] objects = new object[2]; objects[1] = customerVo; objects[2] = userVo; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }