Exemplo n.º 1
0
 public GoodWindow(Good good)
 {
     InitializeComponent();
     WindowStartupLocation = WindowStartupLocation.CenterOwner;
     _good = good;
     ucSaveAndClose.SaveAndCloseButtonClick = SaveAndCloseButtonClick;
     ucSaveAndClose.CloseButtonClick = CloseButtonClick;
 }
Exemplo n.º 2
0
 public void DeleteGood(Good good)
 {
     var existingGood = _context.Goods.FirstOrDefault(gd => gd.Id == good.Id);
     if (existingGood == null)
     {
         return;
     }
     _context.Goods.Remove(existingGood);
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
        public LVGoodItem(Good good)
        {
            Name = good.Name;
            if (good.Consignment != null)
            {
                Consignment = good.Consignment.Name;
            }

            AddingDate = good.AddingDate;

            Count = good.Count;

            Id = good.Id;
        }
Exemplo n.º 5
0
        private void GoodWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            if (_good != null)
            {
                SetGoodValues();
            }
            else
            {
                _good = new Good();

                SetConsignmentValues();

                lblAddingDate.Content = DateTime.Now.Date.ToShortDateString();
            }
        }
Exemplo n.º 6
0
 public void UpdateGoodInCell(Good good, Cell cell)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 7
0
        public void DeleteGoodInCells(Good good)
        {
            var goodInCells = _context.GoodsInCells.Where(gic => gic.GoodId == good.Id).ToList();

            _context.GoodsInCells.RemoveRange(goodInCells);
        }
Exemplo n.º 8
0
 public void AddGood(Good good)
 {
     _context.Goods.Add(good);
 }