protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["USERID"] == null || Session["USERID"].ToString() == string.Empty)
            {
                Response.Redirect("Login.aspx");
                return;
            }

            if (!Page.IsPostBack)
            {
                obj.FillSaleHierarchy();
                fillHOS();
                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    // DataView DtSaleHierarchy = (DataTable)HttpContext.Current.Session["SaleHierarchy"];
                    DataTable dt = App_Code.Global.HierarchyDataTable(ref chkListHOS, ref chkListVP, ref chkListGM, ref chkListDGM, ref chkListRM, ref chkListZM, ref chkListASM, ref chkListEXECUTIVE);
                    if (dt.Rows.Count > 0)
                    {
                        var dr_row = dt.AsEnumerable();
                        var test   = (from r in dr_row
                                      select r.Field <string>("SALEPOSITION")).First <string>();



                        //string dr1 = dt.Select("SALEPOSITION").ToString();
                        if (test == "VP")
                        {
                            chkListHOS.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            //  chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "GM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            //    chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "DGM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "RM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ZM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            // chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ASM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkListZM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            CheckBox5.Enabled  = false;
                            CheckBox5.Checked  = true;
                            // chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "EXECUTIVE")
                        {
                            chkListHOS.Enabled       = false;
                            chkListVP.Enabled        = false;
                            chkListGM.Enabled        = false;
                            chkListDGM.Enabled       = false;
                            chkListRM.Enabled        = false;
                            chkListZM.Enabled        = false;
                            chkListEXECUTIVE.Enabled = false;
                            chkAll.Enabled           = false;
                            chkAll.Checked           = true;
                            CheckBox1.Enabled        = false;
                            CheckBox1.Checked        = true;
                            CheckBox2.Enabled        = false;
                            CheckBox2.Checked        = true;
                            CheckBox3.Enabled        = false;
                            CheckBox3.Checked        = true;
                            CheckBox4.Enabled        = false;
                            CheckBox4.Checked        = true;
                            CheckBox5.Enabled        = false;
                            CheckBox5.Checked        = true;
                            CheckBox6.Enabled        = false;
                            CheckBox6.Checked        = true;

                            // chkAll_CheckedChanged(null, null);
                        }
                    }
                }
                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    tclink.Width  = "10%";
                    tclabel.Width = "90%";

                    Panel1.Visible      = true;
                    LinkButton1.Visible = true;
                }
                else
                {
                    tclink.Width  = "0%";
                    tclabel.Width = "100%";

                    Panel1.Visible      = false;
                    LinkButton1.Visible = false;
                    LinkButton1.Enabled = false;
                }
                txtFromDate.Text = DateTime.Now.Date.AddDays(-10).ToString("dd-MMM-yyyy");
                txtToDate.Text   = DateTime.Now.Date.ToString("dd-MMM-yyyy");
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["USERID"] == null)
            {
                Response.Redirect("Login.aspx");
                return;
            }

            if (!IsPostBack)
            {
                //btnShow.Attributes.Add("onclick", "javascript: if (Page_ClientValidate() ){" + btnShow.ClientID + ".disabled=true;}" + ClientScript.GetPostBackEventReference(btnShow, ""));
                string sqlstr1 = @"select WAREHOUSENAME,WAREHOUSEVALUE from AX.ACXWAREHOUSES";
                ddlWarehouse.Items.Clear();
                DataTable dt1 = new DataTable();
                dt1 = baseObj.GetData(sqlstr1);
                ddlWarehouse.DataSource     = dt1;
                ddlWarehouse.DataTextField  = "WAREHOUSENAME";
                ddlWarehouse.DataValueField = "WAREHOUSEVALUE";
                ddlWarehouse.DataBind();
                baseObj.FillSaleHierarchy();
                fillHOS();
                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    // DataView DtSaleHierarchy = (DataTable)HttpContext.Current.Session["SaleHierarchy"];
                    DataTable dt = App_Code.Global.HierarchyDataTable(ref chkListHOS, ref chkListVP, ref chkListGM, ref chkListDGM, ref chkListRM, ref chkListZM, ref chkListASM, ref chkListEXECUTIVE);
                    if (dt.Rows.Count > 0)
                    {
                        var dr_row = dt.AsEnumerable();
                        var test   = (from r in dr_row
                                      select r.Field <string>("SALEPOSITION")).First <string>();

                        //string dr1 = dt.Select("SALEPOSITION").ToString();
                        if (test == "VP")
                        {
                            chkListHOS.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            //  chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "GM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            //    chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "DGM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "RM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ZM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            // chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ASM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkListZM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            CheckBox5.Enabled  = false;
                            CheckBox5.Checked  = true;
                            // chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "EXECUTIVE")
                        {
                            chkListHOS.Enabled       = false;
                            chkListVP.Enabled        = false;
                            chkListGM.Enabled        = false;
                            chkListDGM.Enabled       = false;
                            chkListRM.Enabled        = false;
                            chkListZM.Enabled        = false;
                            chkListEXECUTIVE.Enabled = false;
                            chkAll.Enabled           = false;
                            chkAll.Checked           = true;
                            CheckBox1.Enabled        = false;
                            CheckBox1.Checked        = true;
                            CheckBox2.Enabled        = false;
                            CheckBox2.Checked        = true;
                            CheckBox3.Enabled        = false;
                            CheckBox3.Checked        = true;
                            CheckBox4.Enabled        = false;
                            CheckBox4.Checked        = true;
                            CheckBox5.Enabled        = false;
                            CheckBox5.Checked        = true;
                            CheckBox6.Enabled        = false;
                            CheckBox6.Checked        = true;

                            // chkAll_CheckedChanged(null, null);
                        }
                        ddlCountry_SelectedIndexChanged(null, null);
                    }
                }

                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    tclabel.Width  = "90%";
                    Panel1.Visible = true;
                }
                else
                {
                    tclabel.Width  = "100%";
                    Panel1.Visible = false;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["USERID"] == null || Session["USERID"].ToString() == string.Empty)
            {
                Response.Redirect("Login.aspx");
                return;
            }
            if (!IsPostBack)
            {
                baseObj.FillSaleHierarchy();
                BindProductGroup();
                fillHOS();
                //fillSiteAndState(null);


                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    // DataView DtSaleHierarchy = (DataTable)HttpContext.Current.Session["SaleHierarchy"];
                    DataTable dt = App_Code.Global.HierarchyDataTable(ref chkListHOS, ref chkListVP, ref chkListGM, ref chkListDGM, ref chkListRM, ref chkListZM, ref chkListASM, ref chkListEXECUTIVE);
                    if (dt.Rows.Count > 0)
                    {
                        var dr_row = dt.AsEnumerable();
                        var test   = (from r in dr_row
                                      select r.Field <string>("SALEPOSITION")).First <string>();



                        //string dr1 = dt.Select("SALEPOSITION").ToString();
                        if (test == "VP")
                        {
                            chkListHOS.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            //  chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "GM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            //    chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "DGM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "RM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ZM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            // chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ASM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkListZM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            CheckBox5.Enabled  = false;
                            CheckBox5.Checked  = true;
                            // chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "EXECUTIVE")
                        {
                            chkListHOS.Enabled       = false;
                            chkListVP.Enabled        = false;
                            chkListGM.Enabled        = false;
                            chkListDGM.Enabled       = false;
                            chkListRM.Enabled        = false;
                            chkListZM.Enabled        = false;
                            chkListEXECUTIVE.Enabled = false;
                            chkAll.Enabled           = false;
                            chkAll.Checked           = true;
                            CheckBox1.Enabled        = false;
                            CheckBox1.Checked        = true;
                            CheckBox2.Enabled        = false;
                            CheckBox2.Checked        = true;
                            CheckBox3.Enabled        = false;
                            CheckBox3.Checked        = true;
                            CheckBox4.Enabled        = false;
                            CheckBox4.Checked        = true;
                            CheckBox5.Enabled        = false;
                            CheckBox5.Checked        = true;
                            CheckBox6.Enabled        = false;
                            CheckBox6.Checked        = true;

                            // chkAll_CheckedChanged(null, null);
                        }
                    }
                }
                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    tclink.Width        = "10%";
                    tclabel.Width       = "90%";
                    Panel1.Visible      = true;
                    LinkButton1.Visible = true;
                }
                else
                {
                    tclink.Width        = "0%";
                    tclabel.Width       = "100%";
                    Panel1.Visible      = false;
                    LinkButton1.Visible = false;
                    LinkButton1.Enabled = false;
                }


                string sqlstr = "";
                if (Convert.ToString(Session["ISDISTRIBUTOR"]) == "Y")
                {
                    if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                    {
                        DataTable dt      = App_Code.Global.HierarchyDataTable(ref chkListHOS, ref chkListVP, ref chkListGM, ref chkListDGM, ref chkListRM, ref chkListZM, ref chkListASM, ref chkListEXECUTIVE);
                        DataTable dtState = dt.DefaultView.ToTable(true, "STATE", "STATENAME");
                        ddlState.Items.Clear();
                        DataRow dr = dtState.NewRow();
                        if (dtState.Rows.Count >= 2)
                        {
                            dr[0] = "Select...";
                            dtState.Rows.InsertAt(dr, 0);
                        }
                        ddlState.DataSource     = dtState;
                        ddlState.DataTextField  = "STATENAME";
                        ddlState.DataValueField = "STATE";
                        ddlState.DataBind();
                    }
                    else
                    {
                        ddlState.Items.Clear();
                        sqlstr = "Select Distinct I.StateCode Code,LS.Name from [ax].[INVENTSITE] I left join [ax].[LOGISTICSADDRESSSTATE] LS on LS.STATEID = I.STATECODE where I.STATECODE <>'' AND I.SITEID='" + Convert.ToString(Session["SiteCode"]) + "'";
                        baseObj.BindToDropDown(ddlState, sqlstr, "Name", "Code");
                    }
                }
                else
                {
                    ddlState.Items.Clear();
                    sqlstr = "Select Distinct I.StateCode Code,LS.Name from [ax].[INVENTSITE] I left join [ax].[LOGISTICSADDRESSSTATE] LS on LS.STATEID = I.STATECODE where I.STATECODE <>'' ";
                    ddlState.Items.Add("Select...");
                    baseObj.BindToDropDown(ddlState, sqlstr, "Name", "Code");
                }
                if (ddlState.Items.Count == 1)
                {
                    ddlState.SelectedIndex = 1;
                    ddlCountry_SelectedIndexChanged(null, null);
                }
                ddlCountry_SelectedIndexChanged(null, null);
                ddlSiteId_SelectedIndexChanged(null, null);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["USERID"] == null || Session["USERID"].ToString() == string.Empty)
            {
                Response.Redirect("Login.aspx");
                return;
            }


            if (!IsPostBack)
            {
                baseObj.FillSaleHierarchy();
                fillHOS();
                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    // DataView DtSaleHierarchy = (DataTable)HttpContext.Current.Session["SaleHierarchy"];
                    DataTable dt = App_Code.Global.HierarchyDataTable(ref chkListHOS, ref chkListVP, ref chkListGM, ref chkListDGM, ref chkListRM, ref chkListZM, ref chkListASM, ref chkListEXECUTIVE);
                    if (dt.Rows.Count > 0)
                    {
                        var dr_row = dt.AsEnumerable();
                        var test   = (from r in dr_row
                                      select r.Field <string>("SALEPOSITION")).First <string>();



                        //string dr1 = dt.Select("SALEPOSITION").ToString();
                        if (test == "VP")
                        {
                            chkListHOS.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            //  chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "GM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            //    chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "DGM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "RM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ZM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            // chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ASM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkListZM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            CheckBox5.Enabled  = false;
                            CheckBox5.Checked  = true;
                            // chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "EXECUTIVE")
                        {
                            chkListHOS.Enabled       = false;
                            chkListVP.Enabled        = false;
                            chkListGM.Enabled        = false;
                            chkListDGM.Enabled       = false;
                            chkListRM.Enabled        = false;
                            chkListZM.Enabled        = false;
                            chkListEXECUTIVE.Enabled = false;
                            chkAll.Enabled           = false;
                            chkAll.Checked           = true;
                            CheckBox1.Enabled        = false;
                            CheckBox1.Checked        = true;
                            CheckBox2.Enabled        = false;
                            CheckBox2.Checked        = true;
                            CheckBox3.Enabled        = false;
                            CheckBox3.Checked        = true;
                            CheckBox4.Enabled        = false;
                            CheckBox4.Checked        = true;
                            CheckBox5.Enabled        = false;
                            CheckBox5.Checked        = true;
                            CheckBox6.Enabled        = false;
                            CheckBox6.Checked        = true;

                            // chkAll_CheckedChanged(null, null);
                        }
                    }
                }

                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    tclink.Width  = "10%";
                    tclabel.Width = "90%";

                    Panel1.Visible      = true;
                    LinkButton1.Visible = true;
                }
                else
                {
                    tclink.Width  = "0%";
                    tclabel.Width = "100%";

                    Panel1.Visible      = false;
                    LinkButton1.Visible = false;
                    LinkButton1.Enabled = false;
                }
                fillCustomeGroup();
                //string sqlstr11 = "Select Distinct I.StateCode Code,LS.Name from [ax].[INVENTSITE] I left join [ax].[LOGISTICSADDRESSSTATE] LS on LS.STATEID = I.STATECODE where I.STATECODE <>''  ";
                //ddlState.Items.Add("Select...");
                //baseObj.BindToDropDown(ddlState, sqlstr11, "Name", "Code");
            }
            //ddlCountry_SelectedIndexChanged(null, null);
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["USERID"] == null || Session["USERID"].ToString() == string.Empty)
            {
                Response.Redirect("Login.aspx");
                return;
            }
            if (!IsPostBack)
            {
                baseObj.FillSaleHierarchy();
                fillHOS();
                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    //DataView DtSaleHierarchy = (DataTable)HttpContext.Current.Session["SaleHierarchy"];
                    DataTable dt = App_Code.Global.HierarchyDataTable(ref chkListHOS, ref chkListVP, ref chkListGM, ref chkListDGM, ref chkListRM, ref chkListZM, ref chkListASM, ref chkListEXECUTIVE);
                    if (dt.Rows.Count > 0)
                    {
                        var dr_row = dt.AsEnumerable();
                        var test   = (from r in dr_row
                                      select r.Field <string>("SALEPOSITION")).First <string>();
                        //string dr1 = dt.Select("SALEPOSITION").ToString();
                        if (test == "VP")
                        {
                            chkListHOS.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "GM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "DGM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "RM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ZM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ASM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkListZM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            CheckBox5.Enabled  = false;
                            CheckBox5.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "EXECUTIVE")
                        {
                            chkListHOS.Enabled       = false;
                            chkListVP.Enabled        = false;
                            chkListGM.Enabled        = false;
                            chkListDGM.Enabled       = false;
                            chkListRM.Enabled        = false;
                            chkListZM.Enabled        = false;
                            chkListEXECUTIVE.Enabled = false;
                            chkAll.Enabled           = false;
                            chkAll.Checked           = true;
                            CheckBox1.Enabled        = false;
                            CheckBox1.Checked        = true;
                            CheckBox2.Enabled        = false;
                            CheckBox2.Checked        = true;
                            CheckBox3.Enabled        = false;
                            CheckBox3.Checked        = true;
                            CheckBox4.Enabled        = false;
                            CheckBox4.Checked        = true;
                            CheckBox5.Enabled        = false;
                            CheckBox5.Checked        = true;
                            CheckBox6.Enabled        = false;
                            CheckBox6.Checked        = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        ddlCountry_SelectedIndexChanged(null, null);
                    }
                }

                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    //tclabel.Width = "90%";
                    Panel1.Visible = true;
                }
                else
                {
                    //tclabel.Width = "100%";
                    Panel1.Visible = false;
                }
                if (Convert.ToString(Session["LOGINTYPE"]) == "0" && Convert.ToString(Session["ISDISTRIBUTOR"]) == "Y")
                {
                    //  ShowReportSummary();
                    // bind();
                }

                // FillCustomerGroup();
            }
            //if (Convert.ToString(Session["LOGINTYPE"]) == "3")
            //{
            //    phState.Visible = false;
            //}
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                baseObj.FillSaleHierarchy();
                fillHOS();
                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    // DataView DtSaleHierarchy = (DataTable)HttpContext.Current.Session["SaleHierarchy"];
                    DataTable dt = App_Code.Global.HierarchyDataTable(ref chkListHOS, ref chkListVP, ref chkListGM, ref chkListDGM, ref chkListRM, ref chkListZM, ref chkListASM, ref chkListEXECUTIVE);
                    if (dt.Rows.Count > 0)
                    {
                        var dr_row = dt.AsEnumerable();
                        var test   = (from r in dr_row
                                      select r.Field <string>("SALEPOSITION")).First <string>();



                        //string dr1 = dt.Select("SALEPOSITION").ToString();
                        if (test == "VP")
                        {
                            chkListHOS.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            //  chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "GM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            //    chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "DGM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "RM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            //chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ZM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            // chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "ASM")
                        {
                            chkListHOS.Enabled = false;
                            chkListVP.Enabled  = false;
                            chkListGM.Enabled  = false;
                            chkListDGM.Enabled = false;
                            chkListRM.Enabled  = false;
                            chkListZM.Enabled  = false;
                            chkAll.Enabled     = false;
                            chkAll.Checked     = true;
                            CheckBox1.Enabled  = false;
                            CheckBox1.Checked  = true;
                            CheckBox2.Enabled  = false;
                            CheckBox2.Checked  = true;
                            CheckBox3.Enabled  = false;
                            CheckBox3.Checked  = true;
                            CheckBox4.Enabled  = false;
                            CheckBox4.Checked  = true;
                            CheckBox5.Enabled  = false;
                            CheckBox5.Checked  = true;
                            // chkAll_CheckedChanged(null, null);
                        }
                        else if (test == "EXECUTIVE")
                        {
                            chkListHOS.Enabled       = false;
                            chkListVP.Enabled        = false;
                            chkListGM.Enabled        = false;
                            chkListDGM.Enabled       = false;
                            chkListRM.Enabled        = false;
                            chkListZM.Enabled        = false;
                            chkListEXECUTIVE.Enabled = false;
                            chkAll.Enabled           = false;
                            chkAll.Checked           = true;
                            CheckBox1.Enabled        = false;
                            CheckBox1.Checked        = true;
                            CheckBox2.Enabled        = false;
                            CheckBox2.Checked        = true;
                            CheckBox3.Enabled        = false;
                            CheckBox3.Checked        = true;
                            CheckBox4.Enabled        = false;
                            CheckBox4.Checked        = true;
                            CheckBox5.Enabled        = false;
                            CheckBox5.Checked        = true;
                            CheckBox6.Enabled        = false;
                            CheckBox6.Checked        = true;

                            // chkAll_CheckedChanged(null, null);
                        }
                        lstState_SelectedIndexChanged(null, null);
                    }
                }

                if (Convert.ToString(Session["LOGINTYPE"]) == "3")
                {
                    tclink.Width        = "10%";
                    tclabel.Width       = "90%";
                    Panel1.Visible      = true;
                    Panel3.Visible      = true;
                    pnlupd.Visible      = true;
                    LinkButton1.Visible = true;
                }
                else
                {
                    tclink.Width        = "0%";
                    tclabel.Width       = "100%";
                    Panel1.Visible      = false;
                    Panel3.Visible      = false;
                    pnlupd.Visible      = false;
                    LinkButton1.Visible = false;
                }
            }
        }