Beispiel #1
0
        public ActionResult InventoryTransfer(long?id, int?inventoryType, string type)
        {
            InventoryTransferModel inventoryTransferModel = new InventoryTransferModel();

            if (UserRolePermissionForPage.Add == true || UserRolePermissionForPage.Edit == true || UserRolePermissionForPage.View == true)
            {
                if (id > 0)
                {
                    ViewBag.ActionType = type;
                    long purchaseId = Convert.ToInt64(id);
                    inventoryTransferModel = _inventoryTransferService.GetInventoryTransferById(purchaseId);
                }
                else
                {
                    inventoryTransferModel.Date          = DateTime.UtcNow.AddMinutes(LoginInfo.Timeoffset);
                    inventoryTransferModel.ReferenceNo   = _inventoryTransferService.ReferenceNumber().ToString();
                    inventoryTransferModel.InventoryType = Convert.ToInt32(inventoryType);
                }
                inventoryTransferModel.FromStoreList  = _iDropDownService.GetStoreList();
                inventoryTransferModel.ToStoreList    = _iDropDownService.GetStoreList();
                inventoryTransferModel.EmployeeList   = _iDropDownService.GetEmployeeList();
                inventoryTransferModel.IngredientList = _iDropDownService.GetIngredientList();
                inventoryTransferModel.AssetItemList  = _iDropDownService.GetAssetItemList();
                inventoryTransferModel.FoodMenuList   = _iDropDownService.GetFoodMenuListByFoodmenuType(-1);
                return(View(inventoryTransferModel));
            }
            else
            {
                return(RedirectToAction("NotFound", "Error"));
            }
        }
        public ActionResult InventoryAdjustment(long?id, int?inventoryType, int?consumptionStatus, string type)
        {
            InventoryAdjustmentModel inventoryAdjustmentModel = new InventoryAdjustmentModel();

            if (UserRolePermissionForPage.Add == true || UserRolePermissionForPage.Edit == true || UserRolePermissionForPage.View == true)
            {
                if (id > 0)
                {
                    ViewBag.ActionType = type;
                    long purchaseId = Convert.ToInt64(id);
                    inventoryAdjustmentModel = _inventoryAdjustmentService.GetInventoryAdjustmentById(purchaseId);
                }
                else
                {
                    inventoryAdjustmentModel.Date              = DateTime.UtcNow.AddMinutes(LoginInfo.Timeoffset);
                    inventoryAdjustmentModel.ReferenceNo       = _inventoryAdjustmentService.ReferenceNumber().ToString();
                    inventoryAdjustmentModel.InventoryType     = Convert.ToInt32(inventoryType);
                    inventoryAdjustmentModel.ConsumptionStatus = Convert.ToInt32(consumptionStatus);
                }
                inventoryAdjustmentModel.StoreList = _iDropDownService.GetStoreList();
                ViewBag.SelectedStore = inventoryAdjustmentModel.StoreList.Where(x => x.Selected == true).Select(x => x.Value).SingleOrDefault();
                inventoryAdjustmentModel.EmployeeList   = _iDropDownService.GetEmployeeList();
                inventoryAdjustmentModel.IngredientList = _iDropDownService.GetIngredientList();
                inventoryAdjustmentModel.AssetItemList  = _iDropDownService.GetAssetItemList();
                inventoryAdjustmentModel.FoodMenuList   = _iDropDownService.GetFoodMenuListByFoodmenuType(-1);
                return(View(inventoryAdjustmentModel));
            }
            else
            {
                return(RedirectToAction("NotFound", "Error"));
            }
        }
        public ActionResult GetFoodMenuList()
        {
            PurchaseGRNModel purchaseModel = new PurchaseGRNModel();

            purchaseModel.FoodMenuList = _iDropDownService.GetFoodMenuListByFoodmenuType(1);
            return(Json(new { purchaseModel.FoodMenuList }));
        }
Beispiel #4
0
        // GET: Waste/Create
        public ActionResult Waste(long?id, string type)
        {
            WasteModel wasteModel = new WasteModel();

            if (UserRolePermissionForPage.Add == true || UserRolePermissionForPage.Edit == true || UserRolePermissionForPage.View == true)
            {
                if (id > 0)
                {
                    long wasteId = Convert.ToInt64(id);
                    wasteModel         = _iWasteService.GetWasteById(wasteId);
                    ViewBag.ActionType = type;
                }
                else
                {
                    wasteModel.WasteDateTime   = DateTime.UtcNow.AddMinutes(LoginInfo.Timeoffset);
                    wasteModel.ReferenceNumber = _iWasteService.ReferenceNumber().ToString();
                }

                wasteModel.StoreList                   = _iDropDownService.GetStoreList();
                wasteModel.FoodMenuList                = _iDropDownService.GetFoodMenuListByFoodmenuType(-1);
                wasteModel.IngredientList              = _iDropDownService.GetIngredientList();
                wasteModel.FoodMenuListForLostAmount   = _iWasteService.FoodMenuListForLostAmount();
                wasteModel.IngredientListForLostAmount = _iWasteService.IngredientListForLostAmount();


                return(View(wasteModel));
            }
            else
            {
                return(RedirectToAction("NotFound", "Error"));
            }
        }
        public ActionResult ProductionEntry(int?id, int?foodMenuType, int?productionFormulaId, string type)
        {
            if (UserRolePermissionForPage.Add == true || UserRolePermissionForPage.Edit == true || UserRolePermissionForPage.View == true)
            {
                ProductionEntryModel productionEntryModel = new ProductionEntryModel();
                TempData["foodMenuType"] = foodMenuType;

                if (id > 0)
                {
                    ViewBag.ActionType   = type;
                    productionEntryModel = _iProductionEntryService.GetProductionEntryById(Convert.ToInt32(id));
                }
                else
                {
                    if (Convert.ToInt32(productionFormulaId) > 0)
                    {
                        productionEntryModel = _iProductionEntryService.GetProductionFormulaById(Convert.ToInt32(productionFormulaId));
                    }
                    productionEntryModel.ProductionDate = DateTime.UtcNow.AddMinutes(LoginInfo.Timeoffset);
                    productionEntryModel.FoodmenuType   = Convert.ToInt32(foodMenuType);
                }
                productionEntryModel.ProductionFormulaList = _iDropDownService.GetProductionFormulaList(Convert.ToInt32(foodMenuType));
                productionEntryModel.FoodMenuList          = _iDropDownService.GetFoodMenuListByFoodmenuType(3);
                productionEntryModel.IngredientList        = _iDropDownService.GetIngredientList();
                productionEntryModel.StoreList             = _iDropDownService.GetStoreList();
                ViewBag.SelectedStore = productionEntryModel.StoreList.Where(x => x.Selected == true).Select(x => x.Value).SingleOrDefault();

                return(View(productionEntryModel));
            }
            else
            {
                return(RedirectToAction("NotFound", "Error"));
            }
        }
        public ActionResult ProductionFormula(int?id, int?foodMenuType, string type)
        {
            ProductionFormulaModel productionFormulaModel = new ProductionFormulaModel();

            TempData["foodMenuType"] = foodMenuType;
            if (UserRolePermissionForPage.Add == true || UserRolePermissionForPage.Edit == true || UserRolePermissionForPage.View == true)
            {
                if (id > 0)
                {
                    ViewBag.ActionType     = type;
                    productionFormulaModel = _iProductionFormulaService.GetProductionFormulaById(Convert.ToInt32(id));
                }
                else
                {
                    productionFormulaModel.FoodmenuType = (int)foodMenuType;
                    productionFormulaModel.IsActive     = true;
                }
                productionFormulaModel.FoodMenuList       = _iDropDownService.GetFoodMenuListByFoodmenuType((int)foodMenuType);
                productionFormulaModel.IngredientList     = _iDropDownService.GetIngredientList();
                productionFormulaModel.BatchSizeUnitsList = _iDropDownService.GetUnitList();

                return(View(productionFormulaModel));
            }
            else
            {
                return(RedirectToAction("NotFound", "Error"));
            }
        }