Exemplo n.º 1
0
 private void FillO365ServerGridfromSession()
 {
     try
     {
         DataTable O365ServerDataTable = new DataTable();
         if (Session["O365Server"] != "" && Session["O365Server"] != null)
         {
             O365ServerDataTable = (DataTable)Session["O365Server"];//VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetAllData();
         }
         if (O365ServerDataTable.Rows.Count >= 0)
         {
             O365ServerGridView.DataSource = O365ServerDataTable;
             O365ServerGridView.DataBind();
         }
     }
     catch (Exception ex)
     {
         //6/27/2014 NS added for VSPLUS-634
         Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
         throw ex;
     }
     finally { }
 }
Exemplo n.º 2
0
        private void FillO365ServerGrid()

        {
            try
            {
                DataTable DSTaskSettingsDataTable = new DataTable();

                DSTaskSettingsDataTable = VSWebBL.ConfiguratorBL.O365ServerBL.Ins.GetAllData();
                if (DSTaskSettingsDataTable.Rows.Count >= 0)
                {
                    if (Session["RestrictedServers"] != "" && Session["RestrictedServers"] != null)
                    {
                        List <int> ServerID   = new List <int>();
                        List <int> LocationID = new List <int>();
                        DataTable  resServers = (DataTable)Session["RestrictedServers"];
                        foreach (DataRow resser in resServers.Rows)
                        {
                            foreach (DataRow Windowsrow in DSTaskSettingsDataTable.Rows)
                            {
                                if (resser["serverid"].ToString() == Windowsrow["ID"].ToString())
                                {
                                    ServerID.Add(DSTaskSettingsDataTable.Rows.IndexOf(Windowsrow));
                                }
                                if (resser["locationID"].ToString() == Windowsrow["locationid"].ToString())
                                {
                                    LocationID.Add(Convert.ToInt32(Windowsrow["locationid"].ToString()));
                                    //LocationID.Add(DSTaskSettingsDataTable.Rows.IndexOf(Windowsrow));
                                }
                            }
                        }
                        foreach (int Id in ServerID)
                        {
                            DSTaskSettingsDataTable.Rows[Id].Delete();
                        }
                        DSTaskSettingsDataTable.AcceptChanges();

                        //foreach (int Lid in LocationID)
                        //{
                        //    DSTaskSettingsDataTable.Rows[Lid].Delete();
                        //}
                        foreach (int lid in LocationID)
                        {
                            DataRow[] row = DSTaskSettingsDataTable.Select("locationid=" + lid + "");
                            for (int i = 0; i < row.Count(); i++)
                            {
                                DSTaskSettingsDataTable.Rows.Remove(row[i]);
                                DSTaskSettingsDataTable.AcceptChanges();
                            }
                        }
                        DSTaskSettingsDataTable.AcceptChanges();
                    }
                    Session["O365Server"]         = DSTaskSettingsDataTable;
                    O365ServerGridView.DataSource = DSTaskSettingsDataTable;
                    O365ServerGridView.DataBind();
                }
            }
            catch (Exception ex)
            {
                //6/27/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            finally { }
        }