Exemple #1
0
        private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (dataGridView.CurrentRow.Index != -1)
                {
                    ad_Store.Id = Convert.ToInt32(dataGridView.CurrentRow.Cells["Id"].Value);
                    using (security_modulesEntities db = new security_modulesEntities())
                    {
                        ad_Store              = db.AD_Store.Where(x => x.Id == ad_Store.Id).FirstOrDefault();
                        txtboxLocation.Text   = ad_Store.Location;
                        txtboxStorelName.Text = ad_Store.StoreName;

                        if (ad_Store.IsActive == true)
                        {
                            rdoIsActiveYes.Checked = true;
                        }
                        else
                        {
                            rdoIsActiveNo.Checked = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            btnSave.Enabled = false;
        }
Exemple #2
0
 public DataTable Get(int[] app, string filter, DateTime?date)
 {
     try
     {
         AD_Store  wod  = new AD_Store();
         DataTable dtbl = new DataTable();
         if (filter == "get")
         {
             dtbl = wod.Get(app, filter);
         }
         else if (filter == "search")
         {
             dtbl = wod.Search(date);
         }
         return(dtbl);
     }
     catch (Exception)
     {
         return(null);
     }
 }