Example #1
0
        //#region "Procedures/Functions"



        //private string GetRestrictedServersFromGrid()
        //{
        //    string selValues = "";
        //    for (int i = 0; i < SpecificServersNotVisibleGridView.VisibleRowCount; i++)
        //    {
        //        if (selValues == "")
        //        {
        //            selValues = "'" + SpecificServersNotVisibleGridView.GetRowValues(i, SpecificServersNotVisibleGridView.KeyFieldName).ToString() + "'";
        //        }
        //        else
        //        {
        //            selValues += "," + "'" + SpecificServersNotVisibleGridView.GetRowValues(i, SpecificServersNotVisibleGridView.KeyFieldName).ToString() + "'";
        //        }
        //    }
        //    return selValues;
        //}



        //#endregion

        private void FillLocationsGrid()
        {
            try
            {
                LocationsDataTable = new DataTable();
                DataSet LocationDataSet = new DataSet();
                LocationsDataTable = VSWebBL.SecurityBL.LocationsBL.Ins.GetAllData();
                if (LocationsDataTable.Rows.Count > 0)
                {
                    DataTable dtcopy = LocationsDataTable.Copy();
                    dtcopy.PrimaryKey = new DataColumn[] { dtcopy.Columns["ID"] };
                    // LocationDataSet.Tables.Add(dtcopy);

                    //Session["LocationDataSet"] = LocationDataSet;

                    Session["Locations"]         = dtcopy;
                    LocationsGridView.DataSource = LocationsDataTable;
                    LocationsGridView.DataBind();
                }
                else
                {
                    LocationsGridView.DataSource = LocationsDataTable;
                    LocationsGridView.DataBind();
                    Session["Locations"] = LocationsDataTable;
                }
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            finally { }
        }
Example #2
0
 private void FillLocationsGridfromSession()
 {
     try
     {
         LocationsDataTable = new DataTable();
         if (Session["Locations"] != "" && Session["Locations"] != null)
         {
             LocationsDataTable = (DataTable)Session["Locations"];//VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetAllData();
         }
         if (LocationsDataTable.Rows.Count > 0)
         {
             LocationsGridView.DataSource = LocationsDataTable;
             LocationsGridView.DataBind();
         }
     }
     catch (Exception ex)
     {
         Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
         throw ex;
     }
     finally { }
 }