Esempio n. 1
0
 private void bndgcntrlchkDropDowntp1(CntrlchkDropDown ctrl, bool bIsT1)
 {
     try
     {
         DataTable dataTable = this.clstreDetails.fnTREtimeperiods(Common.strTableName);
         DataSet   dataSet   = new DataSet();
         string    str       = "Selected";
         dataTable.Columns.Add(new DataColumn("Selected", typeof(bool)));
         for (int i = 0; i < dataTable.Rows.Count; i++)
         {
             if ((!bIsT1 || i != 1 && i != 2 && i != 3) && (bIsT1 || i != 0))
             {
                 dataTable.Rows[i]["Selected"] = false;
             }
             else
             {
                 dataTable.Rows[i]["Selected"] = true;
             }
         }
         dataTable.Columns["Selected"].SetOrdinal(0);
         dataSet.Tables.Add(dataTable);
         ctrl.ConfigureDropDown(dataSet, str);
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Esempio n. 2
0
        void bndgcntrlchkDropDowntp1(CntrlchkDropDown ctrl, bool bIsT1)
        {
            try
            {
                DataTable dt       = clstreDetails.fnTREtimeperiods(Common.strTableName);
                DataSet   ds       = new DataSet();
                string    Selected = "Selected";
                dt.Columns.Add(new DataColumn("Selected", typeof(bool)));
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if ((bIsT1 && (i == 1 || i == 2 || i == 3)) || (!bIsT1 && (i == 0)))
                    {
                        dt.Rows[i]["Selected"] = true;
                    }
                    else
                    {
                        dt.Rows[i]["Selected"] = false;
                    }
                }
                dt.Columns["Selected"].SetOrdinal(0);
                //dt.Columns["timeperiod"].SetOrdinal(0);

                ds.Tables.Add(dt);
                ctrl.ConfigureDropDown(ds, Selected);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 3
0
 private void bndgcntrlchkDropDowntp1(CntrlchkDropDown ctrl, List <int> SelectedItems = null)
 {
     try
     {
         DataTable dataTable = new DataTable();
         DataSet   dataSet   = new DataSet();
         string    str       = "Selected";
         dataTable.Columns.Add(new DataColumn("Selected", typeof(bool)));
         dataTable.Columns.Add(new DataColumn("Status", typeof(string)));
         dataTable.Columns.Add(new DataColumn("Empty", typeof(string)));
         dataTable.Columns.Add(new DataColumn("Empty2", typeof(string)));
         for (int i = 0; i < Status.Count <string>(); i++)
         {
             DataRow status = dataTable.NewRow();
             status["Status"]   = Status[i];
             status["Selected"] = false;
             dataTable.Rows.Add(status);
         }
         dataTable.Columns["Selected"].SetOrdinal(0);
         if (SelectedItems != null)
         {
             foreach (int selectedItem in SelectedItems)
             {
                 dataTable.Rows[selectedItem]["Selected"] = true;
             }
         }
         dataSet.Tables.Add(dataTable);
         ctrl.ConfigureDropDown(dataSet, str);
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
        void bndgcntrlchkDropDowntp1(CntrlchkDropDown ctrl, List <int> SelectedItems = null)
        {
            try
            {
                DataTable dt       = new DataTable();
                DataSet   ds       = new DataSet();
                string    Selected = "Selected";
                dt.Columns.Add(new DataColumn("Selected", typeof(bool)));
                dt.Columns.Add(new DataColumn("Status", typeof(string)));
                dt.Columns.Add(new DataColumn("Empty", typeof(string)));
                dt.Columns.Add(new DataColumn("Empty2", typeof(string)));
                for (int i = 0; i < Status.Count(); i++)
                {
                    DataRow _newRow = dt.NewRow();
                    _newRow["Status"]   = Status[i];
                    _newRow["Selected"] = false;
                    dt.Rows.Add(_newRow);
                }
                dt.Columns["Selected"].SetOrdinal(0);
                if (SelectedItems != null)
                {
                    foreach (int i in SelectedItems)
                    {
                        dt.Rows[i]["Selected"] = true;
                    }
                }
                //dt.Columns["timeperiod"].SetOrdinal(0);

                ds.Tables.Add(dt);
                ctrl.ConfigureDropDown(ds, Selected);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }