Example #1
0
        protected void FillServerLocation()
        {
            if (LocRadioButtonList.SelectedIndex == 0)
            {
                LocNotVisibleListBox.DataSource = "";
                LocNotVisibleListBox.DataBind();
            }
            DataTable dt = VSWebBL.SecurityBL.AdminTabBL.Ins.LocVisibleUpdateListBox();

            LocVisibleListBox.DataSource = dt;
            LocVisibleListBox.DataBind();
            SpecificServersNotVisibleGridView.DataSource = "";
            SpecificServersNotVisibleGridView.DataBind();
            dt = VSWebBL.SecurityBL.AdminTabBL.Ins.ServerAllowUpdateGrid("");
            SpecificServersVisibleGridView.DataSource = dt;
            SpecificServersVisibleGridView.DataBind();
            Session["visible"]    = dt;
            Session["NotVisible"] = "";
        }
Example #2
0
        private void LoadUserRestrictions(string UserName)
        {
            try
            {
                //Load locations users are allowed to access
                DataTable LocationVisibleDataTable = new DataTable();
                LocationVisibleDataTable = VSWebBL.SecurityBL.AdminTabBL.Ins.UserLocationVisibleUpdateListBox(UserName);
                if (LocationVisibleDataTable.Rows.Count >= 0)
                {
                    LocVisibleListBox.DataSource = LocationVisibleDataTable;
                    LocVisibleListBox.DataBind();
                }
                //Load locations users are NOT allowed to access
                DataTable LocationNotVisibleDataTable = new DataTable();
                LocationNotVisibleDataTable = VSWebBL.SecurityBL.AdminTabBL.Ins.UserLocationNotVisibleUpdateListBox(UserName);
                if (LocationNotVisibleDataTable.Rows.Count > 0)
                {
                    //SpecificServersRoundPanel.Enabled = true;
                    //LocRadioButtonList.SelectedIndex = 1;
                    LocToggleEnabled(true);
                    LocNotVisibleListBox.DataSource = LocationNotVisibleDataTable;
                    LocNotVisibleListBox.DataBind();
                }
                else
                {
                    //Load all allowed locations
                    LocationVisibleDataTable = VSWebBL.SecurityBL.AdminTabBL.Ins.LocVisibleUpdateListBox();
                    if (LocationVisibleDataTable.Rows.Count >= 0)
                    {
                        //SpecificServersRoundPanel.Enabled = true;
                        //LocRadioButtonList.SelectedIndex = 0;
                        LocToggleEnabled(false);
                        LocVisibleListBox.DataSource = LocationVisibleDataTable;
                        LocVisibleListBox.DataBind();
                    }
                }


                DataTable ServerVisibleDataTable = new DataTable();
                ServerVisibleDataTable = VSWebBL.SecurityBL.AdminTabBL.Ins.ServersVisibleUpdateGrid(UserName);
                if (ServerVisibleDataTable.Rows.Count >= 0)
                {
                    SpecificServersVisibleGridView.DataSource = ServerVisibleDataTable;
                    SpecificServersVisibleGridView.DataBind();
                }
                DataTable ServerNotVisibleDataTable = new DataTable();
                ServerNotVisibleDataTable = VSWebBL.SecurityBL.AdminTabBL.Ins.ServersNotVisibleUpdateGrid(UserName);
                if (ServerNotVisibleDataTable.Rows.Count > 0 || LocationNotVisibleDataTable.Rows.Count > 0)
                {
                    LocRadioButtonList.SelectedIndex = 1;
                }
                else
                {
                    LocRadioButtonList.SelectedIndex = 0;
                }
                SpecificServersNotVisibleGridView.DataSource = ServerNotVisibleDataTable;
                SpecificServersNotVisibleGridView.DataBind();
                //9/21/2015 NS added
                Session["NotVisible"] = ServerNotVisibleDataTable;
                FillServersVisibleGrid();
            }
            catch (Exception ex)
            { throw ex; }
            finally { }
        }