Exemplo n.º 1
0
 private void Init()
 {
     bs.DataSource = _db.TS_ROLE.ToList();
     grid.PrimaryGrid.DataSource = bs;
     bn.BindingSource            = bs;
     _selectedData = new TS_ROLE();
 }
Exemplo n.º 2
0
 private void grid_MasterGridCellActivated(object sender, GridCellActivatedEventArgs e)
 {
     _selectedData = (TS_ROLE)e.NewActiveCell.GridRow.DataItem;
     if (string.IsNullOrEmpty(_selectedData.RoleCode))
     {
         return;
     }
     SetDetailGridDataSource(_db, _selectedData.RoleCode);
 }
Exemplo n.º 3
0
 public static void AddOrUpdate(PowerEntities db, TS_ROLE selectedData, TS_OPERATOR oper)
 {
     try
     {
         db.TS_ROLE.AddOrUpdate(p => p.RoleCode, selectedData);
     }
     catch (DbEntityValidationException dbEx)
     {
         Console.WriteLine(dbEx.ToString());
         throw;
     }
 }
Exemplo n.º 4
0
 public static void Delete(PowerEntities db, TS_ROLE data, TS_OPERATOR oper)
 {
     db.Entry(data).State = EntityState.Deleted;
 }