Esempio n. 1
0
 protected void LocVisibleListBox_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string selValues;
         selValues = "";
         try
         {
             DataTable LocationsDataTable = LocationsUpdateListBox(selValues);
             if (LocationsDataTable.Rows.Count > 0)
             {
                 LocVisibleListBox.DataSource = LocationsDataTable;
                 LocVisibleListBox.DataBind();
             }
             else
             {
                 LocVisibleListBox.DataSource = null;
                 LocVisibleListBox.DataBind();
             }
         }
         catch (Exception ex)
         {
             Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
             throw ex;
         }
         finally { }
     }
 }
Esempio n. 2
0
 protected void ResetServerAccessButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (IsPostBack)
         {
             LocToggleEnabled(false);
             //Server Type panel fields and buttons
             //ServerTypesRoundPanel.Enabled = false;
             //ServerTypeToggleEnabled(false);
             LocRadioButtonList.SelectedIndex = 0;
             //ServerTypeRadioButtonList.SelectedIndex = 0;
             LocNotVisibleListBox.Items.Clear();
             // LocVisibleListBox.Items.Clear();
             //ServerTypeNotVisibleListBox.Items.Clear();
             SpecificServersNotVisibleGridView.DataSource = null;
             SpecificServersNotVisibleGridView.DataBind();
             //Specific Servers
             //SpecificServersRoundPanel.Enabled = false;
             DataTable ServerAccessGrid = VSWebBL.SecurityBL.AdminTabBL.Ins.ServerAllowUpdateGrid("");
             if (ServerAccessGrid.Rows.Count > 0)
             {
                 SpecificServersVisibleGridView.DataSource   = ServerAccessGrid;
                 SpecificServersVisibleGridView.KeyFieldName = "ID";
                 SpecificServersVisibleGridView.DataBind();
             }
             else
             {
                 SpecificServersVisibleGridView.DataSource   = null;
                 SpecificServersVisibleGridView.KeyFieldName = "ID";
                 SpecificServersVisibleGridView.DataBind();
             }
             DataTable LocationVisibleDataTable = VSWebBL.SecurityBL.AdminTabBL.Ins.LocVisibleUpdateListBox();
             if (LocationVisibleDataTable.Rows.Count > 0)
             {
                 //SpecificServersRoundPanel.Enabled = true;
                 LocRadioButtonList.SelectedIndex = 0;
                 LocToggleEnabled(false);
                 LocVisibleListBox.DataSource = LocationVisibleDataTable;
                 LocVisibleListBox.DataBind();
             }
         }
     }
     catch (Exception ex)
     {
         Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
         throw ex;
     }
     finally { }
 }
Esempio n. 3
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"] = "";
        }
Esempio n. 4
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 { }
        }