Ejemplo n.º 1
0
        private void FillELSGrid()
        {
            try
            {
                ELSDataTable = new DataTable();
                DataSet CredentialsDataSet = new DataSet();
                ELSDataTable = VSWebBL.ConfiguratorBL.ELSBL.Ins.GetAllData();
                //if (ELSDataTable.Rows.Count > 0)
                //{
                DataTable dtcopy = ELSDataTable.Copy();
                dtcopy.PrimaryKey = new DataColumn[] { dtcopy.Columns["ID"] };

                Session["ELS"] = dtcopy;
                ELSGridView.Selection.IsRowSelected(1);

                ELSGridView.DataSource = ELSDataTable;
                ELSGridView.DataBind();

                if (EventKey != 0)
                {
                    DataTable ELSDataTable1 = new DataTable();
                    ELSDataTable1 = VSWebBL.ConfiguratorBL.ELSBL.Ins.GetSelectedEventsForKey(EventKey);
                    foreach (DataRow r in ELSDataTable1.Rows)
                    {
                        int startIndex = ELSGridView.PageIndex * ELSGridView.SettingsPager.PageSize;
                        int endIndex   = Math.Min(ELSGridView.VisibleRowCount, startIndex + ELSGridView.SettingsPager.PageSize);
                        for (int i = startIndex; i < endIndex; i++)
                        {
                            DataRow row = ELSGridView.GetDataRow(i);
                            if (Convert.ToInt32(row[1]) == Convert.ToInt32(r[0]))
                            {
                                ELSGridView.Selection.SelectRow(i);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            finally { }
        }
Ejemplo n.º 2
0
 private void FillELSGridfromSession()
 {
     try
     {
         ELSDataTable = new DataTable();
         if (Session["ELS"] != "" && Session["ELS"] != null)
         {
             ELSDataTable = (DataTable)Session["ELS"];
         }
         if (ELSDataTable.Rows.Count > 0)
         {
             ELSGridView.DataSource = ELSDataTable;
             ELSGridView.DataBind();
         }
     }
     catch (Exception ex)
     {
         Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
         throw ex;
     }
     finally { }
 }