Example #1
0
 /// <summary>
 /// Get Num Of Orders
 /// </summary>
 /// <returns>Num Of Orders</returns>
 public override int GetNumOfOrders()
 {
     try
     {
         return(DalOrder.NumOfOrders(Type == 1 ? $"WHERE([Orders].[ShopID] = {GetShopId()})" : ""));
     }
     catch
     {
         return(-1);
     }
 }
Example #2
0
 /// <summary>
 /// Get Num Of Active Customers
 /// </summary>
 /// <returns></returns>
 public override string GetNumOfCustomers()
 {
     try
     {
         return(DalOrder.NumOfCustomers($" INNER JOIN Orders ON(Users.ID = Orders.CustomerID) WHERE(((Users.UserType)= 4) AND([Orders].[ShopID]= {GetShopId()})) "));
     }
     catch (Exception e)
     {
         return(e.Message);
     }
 }
Example #3
0
 /// <summary>
 /// update the delivery of order by order id
 /// </summary>
 /// <param name="deliveryId"></param>
 /// <returns>true if update success</returns>
 public bool UpdateDelivery(string deliveryId)
 {
     try
     {
         return(DalOrder.UpdateDelivery(OrderId, deliveryId));
     }
     catch
     {
         return(false);
     }
 }
Example #4
0
 /// <summary>
 /// get a data row of order  by order id
 /// </summary>
 /// <param name="orderId"></param>
 /// <returns>data row of order</returns>
 public static DataRow GetOrderById(int orderId)
 {
     try
     {
         return(DalOrder.GetOrderById(orderId));
     }
     catch
     {
         return(null);
     }
 }
Example #5
0
        //public virtual string GetNumOfActiveCustomers()
        //{
        //    try
        //    {
        //        return DalOrder.NumOfActiveCustomers("");
        //    }
        //    catch
        //    {
        //        return "";
        //    }

        //}
        public virtual string GetNumOfCustomers()
        {
            try
            {
                return(DalOrder.NumOfCustomers("WHERE(((Users.UserType) = 4)) Group By Users.FirstName,Users.Email,Users.PhoneNumber"));
            }
            catch
            {
                return("");
            }
        }
Example #6
0
 /// <summary>
 /// get the status of order by order id
 /// </summary>
 /// <returns>order status</returns>
 public int GetOrderStatus()
 {
     try
     {
         return(DalOrder.GetOrderStatus(OrderId));
     }
     catch
     {
         return(-1);
     }
 }
Example #7
0
 public virtual int GetNumOfOrders()
 {
     try
     {
         return(DalOrder.NumOfOrders(""));
     }
     catch
     {
         return(-1);
     }
 }
Example #8
0
        //public BLOrder(DataRow row)
        //{ret
        //    this.OrderID = id;
        //    this.CustomerID = CustomerID;
        //    this.DeliveryID = DeliveryID;
        //    this.ShopID = ShopID;
        //    this.AriveTime = AriveTime;
        //    this.Time = Time;
        //    this.Status = Status;
        //}
        //public static string NumOfOrdersFromShop(int shopId)
        //{
        //    return  DalOrder.NumOfOrders($"WHERE([Orders].[ShopID] = {shopId})").ToString();
        //}
        /// <summary>
        /// update arrive time of order with order id
        /// </summary>
        /// <param name="arrivalTime"></param>
        /// <returns>true if update success</returns>
        public bool UpdateArrivalTime(DateTime arrivalTime)
        {
            var success = true;

            try
            {
                success = DalOrder.UpdateArrivalTime(arrivalTime, OrderId);
            }
            catch
            {
                return(false);
            }
            return(success);
        }
Example #9
0
        /// <summary>
        /// update the status of order by order id
        /// </summary>
        /// <param name="status"></param>
        /// <returns>true if update success</returns>
        public static bool UpdateStatus(int status, int OrderId)
        {
            bool success = true;

            try
            {
                success = DalOrder.UpdateStatus(status, OrderId);
            }
            catch
            {
                return(false);
            }
            return(success);
        }
Example #10
0
        /// <summary>
        /// update ready time of order by order id
        /// </summary>
        /// <param name="readyTime"></param>
        /// <returns>true if update success</returns>
        public bool UpdateReadyTime(DateTime readyTime)
        {
            bool success = true;

            try
            {
                success = DalOrder.UpdateReadyTime(readyTime, OrderId);
            }
            catch
            {
                return(false);
            }
            return(success);
        }
Example #11
0
        public bool SaveOrder(Order order)
        {
            DalOrder dalOrder = new DalOrder(this, this.storageAccount);

            return(dalOrder.SaveOrder(order));
        }
Example #12
0
        public IList <Order> GetOrderByTenantId(string tenantId)
        {
            DalOrder dalOrder = new DalOrder(this, this.storageAccount);

            return(dalOrder.GetOrderByTenantId(tenantId));
        }
Example #13
0
        /// <summary>
        /// get order list order by order time
        /// </summary>
        /// <returns>orders list</returns>
        public List <BlOrder> GetOrdersListByTime()
        {
            DataTable orderTable = DalOrder.GetOrdersListByTime(this.UserId);

            return((from object row in orderTable.Rows select new BlOrder((DataRow)row)).ToList());
        }
Example #14
0
        public IList <Order> GetAllOrders()
        {
            DalOrder dalOrder = new DalOrder(this, this.storageAccount);

            return(dalOrder.GetAllOrders());
        }
Example #15
0
 public int GetNumOfDeliveryOrders()
 {
     return(DalOrder.NumOfOrders($"WHERE Orders.DeliverID ='{UserId}' AND Orders.OrderStutus<5 "));
 }
Example #16
0
 /// <summary>
 /// delete order by id
 /// </summary>
 /// <param name="id"></param>
 /// <returns>true if delete success</returns>
 public bool DeleteOrder()
 {
     return(DalOrder.DeleteOrder(OrderId));
 }
Example #17
0
        public Order GetOrder(Guid orderId)
        {
            DalOrder dalOrder = new DalOrder(this, this.storageAccount);

            return(dalOrder.GetOrder(orderId));
        }