public GoodWindow(Good good) { InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterOwner; _good = good; ucSaveAndClose.SaveAndCloseButtonClick = SaveAndCloseButtonClick; ucSaveAndClose.CloseButtonClick = CloseButtonClick; }
public void DeleteGood(Good good) { var existingGood = _context.Goods.FirstOrDefault(gd => gd.Id == good.Id); if (existingGood == null) { return; } _context.Goods.Remove(existingGood); }
public void UpdateGood(Good good) { var existingGood = _context.Goods.FirstOrDefault(gd => gd.Id == good.Id); if (existingGood == null) { return; } _context.Entry(existingGood).CurrentValues.SetValues(good); _context.Entry(existingGood).State = EntityState.Modified; }
public LVGoodItem(Good good) { Name = good.Name; if (good.Consignment != null) { Consignment = good.Consignment.Name; } AddingDate = good.AddingDate; Count = good.Count; Id = good.Id; }
private void GoodWindow_OnLoaded(object sender, RoutedEventArgs e) { if (_good != null) { SetGoodValues(); } else { _good = new Good(); SetConsignmentValues(); lblAddingDate.Content = DateTime.Now.Date.ToShortDateString(); } }
public void UpdateGoodInCell(Good good, Cell cell) { throw new System.NotImplementedException(); }
public void DeleteGoodInCells(Good good) { var goodInCells = _context.GoodsInCells.Where(gic => gic.GoodId == good.Id).ToList(); _context.GoodsInCells.RemoveRange(goodInCells); }
public void AddGood(Good good) { _context.Goods.Add(good); }