public void CreatePrice(int codPrice, string priceName, int priceCost, string priceType) { Услуги price = new Услуги { Код_услуги = codPrice, Наименование = priceName, Цена = priceCost, Тип = priceType }; SavePrice(price); }
public void SavePrice(Услуги price) { if (price.Код_услуги == 0) { context.Услуги.Add(price); } else { context.Entry(price).State = EntityState.Modified; } context.SaveChanges(); }
public void DeletePrice(Услуги price) { context.Услуги.Remove(price); context.SaveChanges(); }