コード例 #1
0
 public void Delete(Waybill waybill)
 {
     using (var connection = new SqlConnection(connectionString))
     {
         connection.Delete(waybill);
     }
 }
コード例 #2
0
 public void UpdateWayBill(Waybill doki)
 {
     using (var connection = new SqlConnection(connectionString))
     {
         connection.Update(doki);
     }
 }
コード例 #3
0
        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;
            
        }
コード例 #4
0
        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);
            }
        }