Пример #1
0
        internal static void updateFoodOrder(FoodModel mdl)
        {
            FoodOrderEntity e = mdl.foodOrder;

            if (e.Quantity > 0)
            {
                e.RequiredAt    = new DateTime(e.RequiredAt.Year, e.RequiredAt.Month, e.RequiredAt.Day, e.RequiredAtTime.Hour, e.RequiredAtTime.Minute, e.RequiredAtTime.Second);
                e.LastUpdatedBY = mdl.profileID;
                e.ProfileID     = mdl.profileID;
                repository.updateFoodOrder(e);
            }
        }
Пример #2
0
        public void updateFoodOrder(FoodOrderEntity e)
        {
            try
            {
                paramList.Clear();
                paramList["@OrderID"]       = e.OrderID;
                paramList["@Quantity"]      = e.Quantity;
                paramList["@RequiredAt"]    = e.RequiredAt;
                paramList["@LastUpdatedBY"] = e.LastUpdatedBY;
                paramList["@Status"]        = e.Status;


                spName = "spEM_UpdateFoodOrder";
                db.ExecuteNonQuery(spName, true, Common.Enums.SQLConnectionNames.EMDB, paramList);
            }
            catch
            {
                throw;
            }
        }
Пример #3
0
        public FoodOrderEntity getfoodOrderByID(int orderID)
        {
            DataTable       dt     = new DataTable();
            FoodOrderEntity entity = new FoodOrderEntity();

            try
            {
                paramList.Clear();
                paramList["@OrderID"] = orderID;
                spName = "spEM_GetFoodOrderByOrderID";
                dt.Load(db.ExecuteQuery(spName, true, Common.Enums.SQLConnectionNames.EMDB, paramList));
                if (dt.Rows.Count > 0)
                {
                    entity = Utility.ConvertFromDataTable <FoodOrderEntity>(dt).FirstOrDefault();
                }
            }
            catch
            {
                throw;
            }
            return(entity);
        }
Пример #4
0
        internal static FoodModel addFoodOrder(int locationID, int profileID)
        {
            FoodModel mdl = new FoodModel();

            mdl.foodItemList     = repository.getEntireFoodList(locationID);
            mdl.foodCategoryList = repository.getfoodCategoryList();
            mdl.foodOrderList    = new List <FoodOrderEntity>();
            mdl.profileID        = profileID;
            mdl.locationID       = locationID;
            foreach (FoodEntity e in mdl.foodItemList)
            {
                if (e.Active == true)
                {
                    FoodOrderEntity order = new FoodOrderEntity();
                    order.FoodID         = e.FoodID;
                    order.FoodName       = e.FoodName;
                    order.FoodCategoryID = e.FoodCategoryID;
                    order.Price          = e.Price;
                    mdl.foodOrderList.Add(order);
                }
            }
            return(mdl);
        }
Пример #5
0
        public void saveFoodOrder(FoodOrderEntity e)
        {
            try
            {
                paramList.Clear();
                paramList["@FoodID"]        = e.FoodID;
                paramList["@BatchID"]       = e.BatchID;
                paramList["@Quantity"]      = e.Quantity;
                paramList["@RequiredAt"]    = e.RequiredAt;
                paramList["@Price"]         = e.Price;
                paramList["@ProfileID"]     = e.ProfileID;
                paramList["@LastUpdatedBY"] = e.LastUpdatedBY;
                paramList["@TokenID"]       = e.BatchID;
                paramList["@Status"]        = e.Status;


                spName = "spEM_insertFoodOrder";
                db.ExecuteNonQuery(spName, true, Common.Enums.SQLConnectionNames.EMDB, paramList);
            }
            catch
            {
                throw;
            }
        }