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();
                }
            }
            //if (Convert.ToString(Session["LOGINTYPE"]) == "3") {
            //    phState.Visible = false;
            //    ucRoleFilters.ListSiteIdChanged += UcRoleFilters_ListSiteChange;
            //}
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["USERID"] == null)
            {
                //Amol
                Response.Redirect("Login.aspx");
                return;
            }
            if (!IsPostBack)
            {
                // txtFromDate.Text = string.Format("{ 0:dd/MMM/yyyy}",DateTime.Today);
                //  txtToDate.Text = string.Format("{ 0:dd/MMM/yyyy}", DateTime.Today);
                baseObj.FillSaleHierarchy();
                fillHOS();
                //FillBusiness();
                fillCustomeGroup();
                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);
                        }
                        lstSiteId_SelectedIndexChanged(null, null);
                        // fillCustomeGroup();
                    }
                }

                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")
                {
                    //  ShowCustomerMaster();
                }
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["USERID"] == null)
            {
                Response.Redirect("Login.aspx");
                return;
            }
            if (!IsPostBack)
            {
                //FillState();
                FillTemplate();
                baseObj.FillSaleHierarchy();
                fillHOS();

                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);
                    if (dt.Rows.Count > 0)
                    {
                        var dr_row = dt.AsEnumerable();
                        var test   = (from r in dr_row
                                      select r.Field <string>("SALEPOSITION")).First <string>();



                        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;
                        }
                        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;
                        }
                    }
                }
                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;
                }
                //chkListState_SelectedIndexChanged(null, null);
            }
        }