示例#1
0
 /*
  * private void FillNodesSettingsGrid()
  * {
  *      try
  *      {
  *
  *              DataTable NodesSettings = new DataTable();
  *              NodesSettings = VSWebBL.SecurityBL.NodesBL.Ins.GetAllDatafromNodes();
  *              if (NodesSettings.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 NodesSettings.Rows)
  *                                      {
  *
  *                                              if (resser["serverid"].ToString() == Windowsrow["ID"].ToString())
  *                                              {
  *                                                      ServerID.Add(NodesSettings.Rows.IndexOf(Windowsrow));
  *                                              }
  *                                              if (resser["locationID"].ToString() == Windowsrow["locationid"].ToString())
  *                                              {
  *                                                      LocationID.Add(Convert.ToInt32(Windowsrow["locationid"].ToString()));
  *                                              }
  *                                      }
  *
  *                              }
  *                              foreach (int Id in ServerID)
  *                              {
  *                                      NodesSettings.Rows[Id].Delete();
  *                              }
  *                              NodesSettings.AcceptChanges();
  *                              foreach (int lid in LocationID)
  *                              {
  *                                      DataRow[] row = NodesSettings.Select("locationid=" + lid + "");
  *                                      for (int i = 0; i < row.Count(); i++)
  *                                      {
  *                                              NodesSettings.Rows.Remove(row[i]);
  *                                              NodesSettings.AcceptChanges();
  *                                      }
  *                              }
  *                              NodesSettings.AcceptChanges();
  *                      }
  *                      Session["NodeServer"] = NodesSettings;
  *                      NodesGridView.DataSource = NodesSettings;
  *                      NodesGridView.DataBind();
  *              }
  *      }
  *      catch (Exception ex)
  *      {
  *              Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
  *              throw ex;
  *      }
  *      finally { }
  * }
  * private void FillNodeSettingsGridfromSession()
  * {
  *      try
  *      {
  *
  *              DataTable NodesSettings = new DataTable();
  *              if (Session["NodeServer"] != null && Session["NodeServer"] != "")
  *                      NodesSettings = (DataTable)Session["NodeServer"];//VSWebBL.ConfiguratorBL.WindowsPropertiesBL.Ins.GetAllData();
  *              if (NodesSettings.Rows.Count > 0)
  *              {
  *                      NodesGridView.DataSource = NodesSettings;
  *                      NodesGridView.DataBind();
  *              }
  *      }
  *      catch (Exception ex)
  *      {
  *              //6/27/2014 NS added for VSPLUS-634
  *              Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
  *              throw ex;
  *      }
  *      finally { }
  * }
  */
 private void FillAssignNodesgrid()
 {
     try
     {
         DataTable ASSignNodesSettings = new DataTable();
         ASSignNodesSettings = VSWebBL.SecurityBL.NodesBL.Ins.GetforAssignNodes();
         if (ASSignNodesSettings.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 ASSignNodesSettings.Rows)
                     {
                         if (resser["serverid"].ToString() == Windowsrow["ID"].ToString())
                         {
                             ServerID.Add(ASSignNodesSettings.Rows.IndexOf(Windowsrow));
                         }
                         if (resser["locationID"].ToString() == Windowsrow["locationid"].ToString())
                         {
                             LocationID.Add(Convert.ToInt32(Windowsrow["locationid"].ToString()));
                         }
                     }
                 }
                 foreach (int Id in ServerID)
                 {
                     ASSignNodesSettings.Rows[Id].Delete();
                 }
                 ASSignNodesSettings.AcceptChanges();
                 foreach (int lid in LocationID)
                 {
                     DataRow[] row = ASSignNodesSettings.Select("locationid=" + lid + "");
                     for (int i = 0; i < row.Count(); i++)
                     {
                         ASSignNodesSettings.Rows.Remove(row[i]);
                         ASSignNodesSettings.AcceptChanges();
                     }
                 }
                 ASSignNodesSettings.AcceptChanges();
             }
             Session["AssignNodeServer"]    = ASSignNodesSettings;
             AssignNodesGridView.DataSource = ASSignNodesSettings;
             AssignNodesGridView.DataBind();
         }
     }
     catch (Exception ex)
     {
         Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
         throw ex;
     }
     finally { }
 }
示例#2
0
 private void FillAssignNodesgridfromSession()
 {
     try
     {
         DataTable ASSignNodesSettings = new DataTable();
         if (Session["AssignNodeServer"] != null && Session["AssignNodeServer"] != "")
         {
             ASSignNodesSettings = (DataTable)Session["AssignNodeServer"];                    //VSWebBL.ConfiguratorBL.WindowsPropertiesBL.Ins.GetAllData();
         }
         if (ASSignNodesSettings.Rows.Count > 0)
         {
             AssignNodesGridView.DataSource = ASSignNodesSettings;
             AssignNodesGridView.DataBind();
         }
     }
     catch (Exception ex)
     {
         //6/27/2014 NS added for VSPLUS-634
         Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
         throw ex;
     }
     finally { }
 }