/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["PrintMode"] == null) { SystemCheck systemCheck = new SystemCheck(); systemCheck.SessionCheck(); } if (!IsPostBack) { string strWhere = "CustNo='" + Request.QueryString["CustNo"].ToString() + "'"; DataTable dtCustName = customerActivitySheet.GetCustomerActivityDetail(strWhere, "CustName", "CAS_CustomerData"); if (dtCustName != null && dtCustName.Rows.Count > 0) { lblCustName.Text = dtCustName.Rows[0]["CustName"].ToString(); } } #region Getting QueryString curYear = Request.QueryString["Year"].ToString(); curMonth = Request.QueryString["Month"].ToString(); branch = Request.QueryString["Branch"].ToString().Trim() == "0" ? "" : Request.QueryString["Branch"].ToString(); branchName = Request.QueryString["BranchName"].ToString(); strMonthName = Request.QueryString["MonthName"].ToString(); if (Request.QueryString["CASMode"] == null) { customerNumber = Request.QueryString["CustNo"].ToString().Replace("||", "&"); } else { customerNumber = Request.QueryString["Chain"].ToString().Replace("||", "&"); } #endregion #region Grid Binding Event //Method used to bind valus in datagrid BindDataGrid(); #endregion #region Customer Type if (!IsPostBack) { if (Session["CustomerType"] != null) { rbtnlCustType.Items[0].Selected = (Session["CustomerType"].ToString() == "PFC Employee") ? false : true; rbtnlCustType.Items[1].Selected = (Session["CustomerType"].ToString() == "PFC Employee") ? true : false; rbtnlCustType_SelectedIndexChanged(rbtnlCustType, new EventArgs()); } else { rbtnlCustType.Items[0].Selected = (Request.QueryString["CustomerType"].ToString() == "PFC Employee") ? false : true; rbtnlCustType.Items[1].Selected = (Request.QueryString["CustomerType"].ToString() == "PFC Employee") ? true : false; rbtnlCustType_SelectedIndexChanged(rbtnlCustType, new EventArgs()); } } #endregion }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["PrintMode"] == null) { SystemCheck systemCheck = new SystemCheck(); systemCheck.SessionCheck(); } if (!IsPostBack) { string strWhere = "CustNo='" + Request.QueryString["CustNo"].ToString() + "'"; DataTable dtCustName = customerData.GetCustomerActivityDetail(strWhere, "CustName", "CAS_CustomerData"); if (dtCustName != null && dtCustName.Rows.Count > 0) { lblCustName.Text = dtCustName.Rows[0]["CustName"].ToString(); } } // Call the function to display the customer data FillSalesDetails(); }
/// <summary> /// GetCustomerName :Private method used to get customer name /// </summary> private void GetCustomerName() { try { string strWhere = string.Empty; string strTable = string.Empty; if (Request.QueryString["CASMode"] == null) { strWhere = "CustNo='" + Request.QueryString["CustNo"].Trim().Replace("||", "&") + "'"; strTable = "CAS_CustomerData"; } else { strWhere = "Chain='" + Request.QueryString["Chain"].Trim().Replace("||", "&") + "'"; strTable = "CAS_ChainData"; } PFC.Intranet.BusinessLogicLayer.CustomerActivitySheet customerData = new PFC.Intranet.BusinessLogicLayer.CustomerActivitySheet(); DataTable dtSalesDetails = customerData.GetCustomerActivityDetail(strWhere, "CustName,BranchNo,BranchDesc", strTable); if (dtSalesDetails.Rows.Count > 0) { Session["CustomerName"] = dtSalesDetails.Rows[0]["CustName"].ToString(); if (Request.QueryString["Branch"].Trim() == "0") { StrBranch = dtSalesDetails.Rows[0]["BranchNo"].ToString() + "-" + dtSalesDetails.Rows[0]["BranchDesc"].ToString(); } else { StrBranch = Request.QueryString["BranchName"].Trim(); } } else { Session["CustomerName"] = ""; if (Request.QueryString["Branch"].Trim() == "0") { StrBranch = Request.QueryString["BranchName"].Trim(); } } } catch (Exception ex) { Response.Write(ex.ToString()); } }
/// <summary> /// Function to fill the customer contact notes /// </summary> public void FilllNotes() { try { string strWhere = "CustNo='" + Request.QueryString["CustNo"].Trim().Replace("||", "&") + "'"; // Initailize the class customer activity sheet PFC.Intranet.BusinessLogicLayer.CustomerActivitySheet customerData = new PFC.Intranet.BusinessLogicLayer.CustomerActivitySheet(); // Get the data's in the datatable by calling the class function dtContactNotes = customerData.GetCustomerActivityDetail(strWhere, strNotesColumns, strNotesTable); // Get the datas in the datatable to bind the data in a single row DataTable dt = new DataTable(); dt.Columns.Add("PreviousNote", typeof(string)); dt.Columns.Add("LastOutRepNote", typeof(string)); dt.Columns.Add("LastInRepNote", typeof(string)); DataRow drow = dt.NewRow(); if (dtContactNotes != null && dtContactNotes.Rows.Count != 0) { dtContactNotes.DefaultView.RowFilter = "NoteType='Previous Visit Note'"; drow[0] = (dtContactNotes.DefaultView.ToTable().Rows.Count != 0) ? dtContactNotes.DefaultView.ToTable().Rows[0][0].ToString() : ""; dtContactNotes.DefaultView.RowFilter = "NoteType='Last Outside Sales Rep Notes'"; drow[1] = (dtContactNotes.DefaultView.ToTable().Rows.Count != 0) ? dtContactNotes.DefaultView.ToTable().Rows[0][0].ToString() : ""; dtContactNotes.DefaultView.RowFilter = "NoteType='Last Inside Sales Rep Notes'"; drow[2] = (dtContactNotes.DefaultView.ToTable().Rows.Count != 0) ? dtContactNotes.DefaultView.ToTable().Rows[0][0].ToString() : ""; } else { drow[0] = ""; drow[1] = ""; drow[2] = ""; } dt.Rows.Add(drow); // Code to bind the datatable in the datagrid dgContactNotes.DataSource = dt; dgContactNotes.DataBind(); } catch (Exception ex) { } }
/// <summary> /// Function to fill the customer details /// </summary> public void FillCustomerDetails() { try { string strWhere = "curmonth=" + Request.QueryString["Month"].Trim() + " and " + "curYear=" + Request.QueryString["Year"].Trim() + " and CustNo='" + Request.QueryString["CustNo"].Trim().Replace("||", "&") + "'"; strTable = Request.QueryString["CASMode"] == null ? strTable : "CAS_ChainData"; // Initailize the class customer activity sheet PFC.Intranet.BusinessLogicLayer.CustomerActivitySheet customerData = new PFC.Intranet.BusinessLogicLayer.CustomerActivitySheet(); // Get the data's in the datatable by calling the class function dtCustomerData = customerData.GetCustomerActivityDetail(strWhere, strDisplayColumns, strTable); // Bind the datagrid with datatables dgCas.DataSource = dtCustomerData; dgCas.DataBind(); } catch (Exception ex) { Response.Write(ex.Message.ToString()); } }