public string[] GetParentCustomerName(string prefixText, int count, string contextKey) { CustomerBo customerBo = new CustomerBo(); DataTable dtCustomerName = new DataTable(); int i = 0; List <string> names = new List <string>(); dtCustomerName = customerBo.GetParentCustomerName(prefixText, int.Parse(contextKey)); //string[] customerNameList = new string[dtCustomerName.Rows.Count]; foreach (DataRow dr in dtCustomerName.Rows) { string item = AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dr["C_FirstName"].ToString(), dr["C_CustomerId"].ToString()); names.Add(item); //customerNameList[i] = dr["C_FirstName"].ToString() + "|" + dr["C_PANNum"].ToString(); //i++; } return(names.ToArray()); }
protected void rbnGroup_CheckedChanged(object sender, EventArgs e) { LBSelectCustomer.Items.Clear(); LBCustomer.Items.Clear(); CustomerBo customerBo = new CustomerBo(); DataTable dtGroupCustomerList = new DataTable(); if (Session[SessionContents.CurrentUserRole].ToString() == "RM") { dtGroupCustomerList = customerBo.GetParentCustomerName("BULKMAIL", int.Parse(rmVo.RMId.ToString())); } else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin") { dtGroupCustomerList = customerBo.GetAdviserGroupCustomerName("BULKMAIL", int.Parse(advisorVo.advisorId.ToString())); } LBCustomer.DataSource = dtGroupCustomerList; LBCustomer.DataTextField = "C_FirstName"; LBCustomer.DataValueField = "C_CustomerId"; LBCustomer.DataBind(); tabViewAndEmailReports.ActiveTabIndex = activeTabIndex; }
protected void Page_Load(object sender, EventArgs e) { SessionBo.CheckSession(); userVo = (UserVo)Session["UserVo"]; //ddlReportSubType.Attributes.Add("onchange", "ChangeDates()"); rdoGroup.Attributes.Add("onClick", "javascript:ChangeCustomerSelectionTextBox(value);"); rdoIndividual.Attributes.Add("onClick", "javascript:ChangeCustomerSelectionTextBox(value);"); rdoCustomerGroup.Attributes.Add("onClick", "javascript:ChangeGroupOrSelf(value);"); rdoCustomerIndivisual.Attributes.Add("onClick", "javascript:ChangeGroupOrSelf(value);"); if (!string.IsNullOrEmpty(Session["advisorVo"].ToString())) { advisorVo = (AdvisorVo)Session["advisorVo"]; } // cvAsOnDate.ValueToCompare = DateTime.Now.ToShortDateString(); if (Request.Form["ctrl_MFReports$tabViewAndEmailReports$tabpnlViewReports$btnViewReport"] != "View Report" && Request.Form["ctrl_MFReports$tabViewAndEmailReports$tabpnlEmailReports$btnEmailReport"] != "Email Report") { path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString()); if (!string.IsNullOrEmpty(Session[SessionContents.RmVo].ToString())) { rmVo = (RMVo)Session[SessionContents.RmVo]; } if (Session["UserType"] != null) { if (Session["UserType"].ToString() == "Customer") { strFromCustomerDashBoard = true; } } if (userVo.UserType == "Customer" || strFromCustomerDashBoard == true) { if (!string.IsNullOrEmpty(Session["CustomerVo"].ToString())) { customerVo = (CustomerVo)Session["CustomerVo"]; } CustomerLogin = true; hndCustomerLogin.Value = "true"; Session["hndCustomerLogin"] = hndCustomerLogin.Value; tabpnlEmailReports.Visible = false; } else { hndCustomerLogin.Value = "false"; Session["hndCustomerLogin"] = hndCustomerLogin.Value; } BindPeriodDropDown(); //if (CustomerLogin == false) //{ // txtCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString(); // txtParentCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString(); //} if (!IsPostBack) { ddlMFTransactionTypeBind(); if (CustomerLogin == true) { trCustomerName.Visible = true; trIndCustomer.Visible = false; trGroupCustomer.Visible = false; IndivisulCustomerLogin(); trAdvisorRadioList.Visible = false; trCustomerRadioList.Visible = true; trAdminRM.Visible = false; trCustomer.Visible = true; isGrpHead = customerBo.CheckCustomerGroupHead(customerVo.CustomerId); if (isGrpHead == false) { trCustomerRadioList.Visible = false; rdoCustomerIndivisual.Checked = true; divGroupCustomers.Visible = false; hndSelfOrGroup.Value = "self"; ShowFolios(); } else { rdoCustomerGroup.Checked = true; hndSelfOrGroup.Value = ""; } } else { trCustomerName.Visible = false; trIndCustomer.Visible = true; trGroupCustomer.Visible = true; trAdvisorRadioList.Visible = true; trCustomerRadioList.Visible = false; trAdminRM.Visible = true; trCustomer.Visible = false; } //tabpnlEmailReports.Visible = false; if (CustomerLogin == false) { //This for Customer Search AutoCompelete TextBox Dynamic Assign Service Method. //if (Session[SessionContents.CurrentUserRole].ToString() == "RM") //{ // txtCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString(); // txtParentCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString(); // txtCustomer_autoCompleteExtender.ServiceMethod = "GetMemberCustomerName"; // txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetParentCustomerName"; //} //else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin") //{ // txtCustomer_autoCompleteExtender.ContextKey = advisorVo.advisorId.ToString(); // txtParentCustomer_autoCompleteExtender.ContextKey = advisorVo.advisorId.ToString(); // txtCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserCustomerName"; // txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserGroupCustomerName"; //} //ListBox horizontal Scorling enabled false LBCustomer.HorizontalScrollEnabled = false; LBSelectCustomer.HorizontalScrollEnabled = false; CustomerBo customerBo = new CustomerBo(); DataTable dtGroupCustomerList = new DataTable(); //dtGroupCustomerList = customerBo.GetParentCustomerName("BULKMAIL", int.Parse(rmVo.RMId.ToString())); if (Session[SessionContents.CurrentUserRole].ToString() == "RM") { tabpnlEmailReports.Visible = true; dtGroupCustomerList = customerBo.GetParentCustomerName("BULKMAIL", int.Parse(rmVo.RMId.ToString())); } else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin") { tabpnlEmailReports.Visible = true; dtGroupCustomerList = customerBo.GetAdviserGroupCustomerName("BULKMAIL", int.Parse(advisorVo.advisorId.ToString())); } else if (Session[SessionContents.CurrentUserRole].ToString() == "BM") { tabpnlEmailReports.Visible = false; } LBCustomer.DataSource = dtGroupCustomerList; LBCustomer.DataTextField = "C_FirstName"; LBCustomer.DataValueField = "C_CustomerId"; LBCustomer.DataBind(); } CustomerTransactionBo customerTransactionBo = new CustomerTransactionBo(); DataSet ds = customerTransactionBo.GetLastTradeDate(); if (ds.Tables != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["WTD_Date"] != null) { txtAsOnDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString(); txtFromDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString(); txtToDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString(); txtEmailAsOnDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString(); txtEmailFromDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString(); txtEmailToDate.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["WTD_Date"]).ToShortDateString(); } //Transaction Subreport search invissible intitialy.. //trTranFilter1.Visible = false; //trTranFilter2.Visible = false; tabViewAndEmailReports.ActiveTabIndex = 0; //ShowFolios(); } if (CustomerLogin == false) { if (Session[SessionContents.CurrentUserRole].ToString() == "RM") { hidBMLogin.Value = "False"; txtCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString(); txtParentCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString(); txtCustomer_autoCompleteExtender.ServiceMethod = "GetMemberCustomerName"; txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetParentCustomerName"; } else if (Session[SessionContents.CurrentUserRole].ToString() == "Admin") { hidBMLogin.Value = "False"; txtCustomer_autoCompleteExtender.ContextKey = advisorVo.advisorId.ToString(); txtParentCustomer_autoCompleteExtender.ContextKey = advisorVo.advisorId.ToString(); txtCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserCustomerName"; txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetAdviserGroupCustomerName"; } else if (Session[SessionContents.CurrentUserRole].ToString() == "BM") { hidBMLogin.Value = "true"; txtCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString(); txtParentCustomer_autoCompleteExtender.ContextKey = rmVo.RMId.ToString(); txtCustomer_autoCompleteExtender.ServiceMethod = "GetBMIndividualCustomerNames"; txtParentCustomer_autoCompleteExtender.ServiceMethod = "GetBMParentCustomerNames"; } } if (IsPostBack && !string.IsNullOrEmpty(Request.Form["ctrl_MFReports$hidTabIndex"])) { activeTabIndex = Convert.ToInt32(Request.Form["ctrl_MFReports$hidTabIndex"]); tabViewAndEmailReports.ActiveTabIndex = activeTabIndex; } } }