Ejemplo n.º 1
0
        private void FillFeaturesGrid()
        {
            try
            {
                FeaturesDataTable = new DataTable();
                DataSet FeatureDataSet = new DataSet();
                FeaturesDataTable = VSWebBL.SecurityBL.FeaturesBL.Ins.GetAllData();
                if (FeaturesDataTable.Rows.Count > 0)
                {
                    DataTable dtcopy = FeaturesDataTable.Copy();
                    dtcopy.PrimaryKey = new DataColumn[] { dtcopy.Columns["ID"] };


                    Session["Features"]         = dtcopy;
                    FeaturesGridView.DataSource = FeaturesDataTable;
                    FeaturesGridView.DataBind();
                }
                else
                {
                    FeaturesGridView.DataSource = FeaturesDataTable;
                    FeaturesGridView.DataBind();
                    Session["Features"] = FeaturesDataTable;
                }
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            finally { }
        }
Ejemplo n.º 2
0
 private void FillFeaturesGridfromSession()
 {
     try
     {
         FeaturesDataTable = new DataTable();
         if (Session["Features"] != "" && Session["Features"] != null)
         {
             FeaturesDataTable = (DataTable)Session["Features"];
         }
         if (FeaturesDataTable.Rows.Count > 0)
         {
             FeaturesGridView.DataSource = FeaturesDataTable;
             FeaturesGridView.DataBind();
         }
     }
     catch (Exception ex)
     {
         Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
         throw ex;
     }
     finally { }
 }