Exemplo n.º 1
0
 public bool InsertDelivery(Delivery delivery)
 {
     SqlParameter[] Params = new SqlParameter[]
     {
         new SqlParameter("@DeliveryName", delivery.ServiceName ),
         new SqlParameter("@DeliveryType", delivery.ServiceType),
         new SqlParameter("@Price", delivery.Price)
     };
     return DataProvider.ExecuteNonQuery("sp_InsertDelivery", CommandType.StoredProcedure,
         Params);
 }
Exemplo n.º 2
0
        public Delivery GetDeliveryDetails(int deliveryId)
        {
            Delivery delivery = null;

            SqlParameter[] Params = { new SqlParameter("@DeliveryID", deliveryId) };
            using (DataTable table = DataProvider.ExecuteParamatizedSelectCommand("sp_ViewSpecificDelivery",
                CommandType.StoredProcedure, Params))
            {
                if (table.Rows.Count == 1)
                {
                    DataRow row = table.Rows[0];
                    delivery = new Delivery();
                    delivery.DeliveryServiceID = Convert.ToInt32(row["DeliveryServiceID"]);
                    delivery.ServiceName = row["ServiceName"].ToString();
                    delivery.ServiceType = row["ServiceType"].ToString();
                    delivery.Price = Convert.ToDecimal(row["Price"]);
                }
            }
            return delivery;
        }
Exemplo n.º 3
0
        public List<Delivery> GetDeliveryList()
        {
            List<Delivery> DeliveryList = null;

            using (DataTable table = DataProvider.ExecuteSelectCommand("sp_ViewDeliveries",
                CommandType.StoredProcedure))
            {
                if (table.Rows.Count > 0)
                {
                    DeliveryList = new List<Delivery>();
                    foreach (DataRow row in table.Rows)
                    {
                        Delivery delivery = new Delivery();
                        delivery.DeliveryServiceID = Convert.ToInt32(row["DeliveryServiceID"]);
                        delivery.ServiceName = row["ServiceName"].ToString();
                        delivery.Price =Convert.ToDecimal(row["Price"]);
                        DeliveryList.Add(delivery);
                    }
                }
                return DeliveryList;
            }
        }
Exemplo n.º 4
0
 public bool UpdateDeliveryServiceID(Delivery delivery)
 {
     DeliveryHandler myHandler = new DeliveryHandler(); return myHandler.UpdateDelivery(delivery);
 }
Exemplo n.º 5
0
 public bool AddDeliveryService(Delivery deliveryService)
 {
     DeliveryHandler myHandler = new DeliveryHandler(); return myHandler.InsertDelivery(deliveryService);
 }