private async void SaveImplementation(object obj) { GoodsGroup goodGroup = new GoodsGroup(); goodGroup.GoodsGroupId = 0; goodGroup.Description = Characteristics; goodGroup.Name = Name; db.GoodsGroup.Add(goodGroup); await db.SaveChangesAsync(); Thiswindow.Close(); }
private void SaveImplementation(object obj) { GoodsGroup goodGroup = db.GoodsGroup.SingleOrDefault(g => g.GoodsGroupId == GoodsGroupId); if (goodGroup != null) { goodGroup.Description = Characteristics; goodGroup.Name = Name; db.SaveChanges(); } Thiswindow.Close(); }
private async void SaveImplementation(object obj) { Producer producer = new Producer(); producer.ProducerId = 0; producer.Name = Name; producer.UserExpierence = UserExpierence; db.Producers.Add(producer); await db.SaveChangesAsync(); Thiswindow.Close(); }
private async void SaveImplementation(object obj) { Good good = new Good(); good.GoodsId = 0; good.GoodsGroupId = SelectedGroupId; good.ProducerId = SelectedProducerId; good.Name = Name; good.Characteristics = Characteristics; good.SellingPrice = SellingPrice; db.Goods.Add(good); await db.SaveChangesAsync(); Thiswindow.Close(); }
private void SaveImplementation(object obj) { Producer producer = db.Producers.SingleOrDefault(g => g.ProducerId == ProducerId); if (producer != null) { producer.ProducerId = ProducerId; producer.Name = Name; producer.UserExpierence = UserExpierence; db.SaveChanges(); } Thiswindow.Close(); }
private void SaveImplementation(object obj) { Good good = db.Goods.SingleOrDefault(g => g.GoodsId == GoodId); if (good != null) { good.GoodsGroupId = SelectedGroupId; good.ProducerId = SelectedProducerId; good.Name = Name; good.Characteristics = Characteristics; good.SellingPrice = SellingPrice; db.SaveChanges(); } Thiswindow.Close(); }