public void Delete(Waybill waybill) { using (var connection = new SqlConnection(connectionString)) { connection.Delete(waybill); } }
public void UpdateWayBill(Waybill doki) { using (var connection = new SqlConnection(connectionString)) { connection.Update(doki); } }
private static void WayBillDepart(StoreKeeperRepository storeKeeperRepository) { Waybill Depart = new Waybill(); while (true) { Console.WriteLine("Выберете кладовщика"); var keeperId = storeKeeperRepository.GetStoreKeeper() as List<StoreKeeper>; int chooseKeeper; if (int.TryParse(Console.ReadLine(), out chooseKeeper)) { --chooseKeeper; if (chooseKeeper >= 0 && chooseKeeper < keeperId.Count) { Depart.StoreKeeperId = keeperId[chooseKeeper].Id; break; } } } Depart.IsExport = false; Console.WriteLine("Id Provider"); Depart.Provider = Console.ReadLine(); Depart.DepartDate = DateTime.Now; }
public void AddWayBill(Waybill doki) { string sql = "Insert into WayBills (@id,@Quantity,@Price,@StoreKeeperId,@ProductId,@DeliveryDate,@DepartDate);"; using (var connection = new SqlConnection(connectionString)) { connection.Insert(doki); } }