public ActionResult Edit(string commandNo, string lotNo, string containerCode, string containerNo,
                                 string shelfNo, string groupName)
        {
            var deviceCode = _configurationService.PreProductDeviceCode;


            var terminalNo        = _identityService.FindTerminalNo(HttpContext.User.Identity);
            var checkConveyorCode = _commonDomain.CheckStatusAndNumberRecordOfConveyor(terminalNo);

            if (!checkConveyorCode)
            {
                return(Json(new
                {
                    Success = false,
                    Message = PreProductManagementResources.MSG13
                }, JsonRequestBehavior.AllowGet));
            }

            var checkedDeviceStatus = _commonDomain.CheckStatusOfDeviceRecordForProductManagement(deviceCode);

            if (!checkedDeviceStatus)
            {
                return(Json(new
                {
                    Success = false,
                    Message = PreProductManagementResources.MSG14
                }, JsonRequestBehavior.AllowGet));
            }

            //var result = _retrievalOfPreProductDomain.CheckConveyor(terminalNo);
            //BR 6 Checking Status of Conveyor and Pre-product Warehouse
            //if (!result.IsSuccess)
            //{
            //    httpResponseMessage.HttpStatusCode = HttpStatusCode.InternalServerError;
            //    httpResponseMessage.Message = result.ErrorMessages.Equals("MSG13")
            //        ? Resources.PreProductManagementResources.MSG13
            //        : Resources.PreProductManagementResources.MSG1;
            //    return Json(httpResponseMessage);
            //}
            //get all item same lotno to process

            //var allitem = _forcedRetrievalOfPreProductDomain.Getallitem(lotNo, groupName);
            //if (allitem.Any())
            //{
            //    foreach (var item in allitem)
            //    {
            var updateitem = _forcedRetrievalOfPreProductDomain.Edit(commandNo, lotNo, terminalNo, containerCode,
                                                                     containerNo, shelfNo);

            if (!updateitem.Success)
            {
                return(Json(new { Success = false, Message = updateitem.MessageError },
                            JsonRequestBehavior.AllowGet));
            }
            //    }
            //}

            return(Json(new { Success = true, Message = HttpStatusCode.OK },
                        JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult RetrieveTheEmptyPallet()
        {
            var deviceCode = _configurationService.ProductDeviceCode;
            var terminalNo = _identityService.FindTerminalNo(HttpContext.User.Identity);

            try
            {
                var checkedConveyorStatus = _commonDomain.CheckStatusAndNumberRecordOfConveyor(terminalNo);
                if (!checkedConveyorStatus)
                {
                    return(Json(new { Success = false, Message = ProductManagementResources.MSG8 }));
                }

                var checkedDeviceStatus = _commonDomain.CheckStatusOfDeviceRecordForProductManagement(deviceCode);
                if (!checkedDeviceStatus)
                {
                    return(Json(new { Success = false, Message = ProductManagementResources.MSG9 }));
                }

                _retrievalOfProductPalletDomain.Retrieval(terminalNo);
                return(Json(new { Success = true, Message = ProductManagementResources.MSG57 }));
            }
            catch (Exception)
            {
                return(Json(new { Success = false }));
            }
        }
        public ActionResult CheckStatus(string palletNo)
        {
            var deviceCode          = _configurationService.ProductDeviceCode;
            var terminalNo          = _identityService.FindTerminalNo(HttpContext.User.Identity);
            var checkConveyorStatus = _commonDomain.CheckStatusAndNumberRecordOfConveyor(terminalNo);

            if (!checkConveyorStatus)
            {
                return(Json(new { Success = false, Message = ProductManagementResources.MSG8, Message2 = ProductManagementResources.MSG10 }));
            }

            var checkedDeviceStatus = _commonDomain.CheckStatusOfDeviceRecordForProductManagement(deviceCode);

            if (!checkedDeviceStatus)
            {
                return(Json(new { Success = false, Message = ProductManagementResources.MSG9, Message2 = ProductManagementResources.MSG10 }));
            }

            var checkPalletNo = _storageOfProductDomain.CheckedPalletNo(palletNo);

            if (checkPalletNo)
            {
                return(Json(new { Success = false, Message = ProductManagementResources.MSG11 }));
            }
            var checkedOutSidePreProductStock = _storageOfProductDomain.CheckOutSidePrePdtStk(palletNo);

            if (checkedOutSidePreProductStock)
            {
                return(Json(new { Success = false, Message = ProductManagementResources.MSG11 }));
            }
            //var totalAmount = _storageOfProductDomain.CheckTotalAmountOfTX40(palletNo);
            return(Json(new{ Success = true }));
        }
        public ActionResult StoreTheEmptyPallet(StorageOfEmptyProductViewModel model)
        {
            var deviceCode            = _configurationService.ProductDeviceCode;
            var terminalNo            = _identityServices.FindTerminalNo(HttpContext.User.Identity);
            var checkedConveyorStatus = _commonDomain.CheckStatusAndNumberRecordOfConveyor(terminalNo);

            if (!checkedConveyorStatus)
            {
                return(Json(new{ Success = false, Message = ProductManagementResources.MSG8 }));
            }

            var checkedDeviceStatus = _commonDomain.CheckStatusOfDeviceRecordForProductManagement(deviceCode);

            if (!checkedDeviceStatus)
            {
                return(Json(new{ Success = false, Message = ProductManagementResources.MSG9 }));
            }

            var checkedProductShelfStatus = _storageOfEmptyProductPalletDomain.CheckProductShelfStatus();

            if (!checkedProductShelfStatus)
            {
                return(Json(new { Success = false, Message = ProductManagementResources.MSG19 }));
            }

            _storageOfEmptyProductPalletDomain.StoreTheEmptyPallet(model.PalletNumber, terminalNo);
            return(Json(new { Success = true }));
        }
Ejemplo n.º 5
0
        public ActionResult Retrieval(string containerType, Constants.KndLine kneadingLine, string colorClass)
        {
            var terminalNo        = _identityDomain.FindTerminalNo(HttpContext.User.Identity);
            var deviceCode        = _configurationService.PreProductDeviceCode;
            var isCheckedConveyor = _commonDomain.CheckStatusAndNumberRecordOfConveyor(terminalNo);

            if (!isCheckedConveyor)
            {
                return(Json(new
                {
                    Success = false,
                    Message = PreProductManagementResources.MSG13
                }));
            }


            var checkedDeviceStatus = _commonDomain.CheckStatusOfDeviceRecordForProductManagement(deviceCode);

            if (!checkedDeviceStatus)
            {
                return(Json(new { Success = false, Message = PreProductManagementResources.MSG14 }));
            }


            var result = _preProductManagementDomain.Retrieval(containerType, terminalNo, kneadingLine, colorClass);

            if (result == null)
            {
                return(Json(new
                {
                    Success = false,
                    Message = PreProductManagementResources.MSG21
                }));
            }

            return(Json(new
            {
                Success = true,
                result
            }));
        }
Ejemplo n.º 6
0
        public ActionResult InsertAndUpdate(StorageOfEmptyContainerViewModel model)
        {
            var terminalNo = _identityService.FindTerminalNo(HttpContext.User.Identity);
            var deviceCode = _configurationService.PreProductDeviceCode;

            try
            {
                var checkContainerNo = _preProductManagementDomain.CheckedValidation(model.ContainerNo.ToString("D3"));
                if (!checkContainerNo)
                {
                    return(Json(new
                    {
                        Success = false,
                        Message = PreProductManagementResources.MSG12
                    }));
                }
                var checkConveyorCode = _commonDomain.CheckStatusAndNumberRecordOfConveyor(terminalNo);
                if (!checkConveyorCode)
                {
                    return(Json(new
                    {
                        Success = false,
                        Message = PreProductManagementResources.MSG13
                    }));
                }

                var checkedDeviceStatus = _commonDomain.CheckStatusOfDeviceRecordForProductManagement(deviceCode);
                if (!checkedDeviceStatus)
                {
                    return(Json(new { Success = false, Message = PreProductManagementResources.MSG14 }));
                }

                _preProductManagementDomain.InsertAndUpdate(model.ContainerNo, model.StorageShelfNo, model.ContainerType,
                                                            terminalNo);
                return(Json(new { Success = true }));
            }
            catch (Exception exception)
            {
                return(Json(new
                {
                    Success = false,
                    exception.Message
                }));
            }
        }
        public ActionResult CheckConveyorAndDeviceStatus()
        {
            var deviceCode = _configurationService.ProductDeviceCode;
            var terminalNo = _identityService.FindTerminalNo(HttpContext.User.Identity);
            var isChecked  = _commonDomain.CheckStatusAndNumberRecordOfConveyor(terminalNo);

            if (!isChecked)
            {
                return(Json(new{ Success = false, Message = ProductManagementResources.MSG8 }));
            }

            var checkDeviceStatus = _commonDomain.CheckStatusOfDeviceRecordForProductManagement(deviceCode);

            if (!checkDeviceStatus)
            {
                return(Json(new { Success = false, Message = ProductManagementResources.MSG9 }));
            }
            return(Json(new { Success = true }));
        }
Ejemplo n.º 8
0
        public ActionResult Retrieve(string preProductCode, string lsRow, string lsBay, string lsLevel,
                                     string containerCode, string containerNo, string updateDate)
        {
            var      deviceCode = _configurationService.PreProductDeviceCode;
            DateTime udate      = DateTime.Parse(updateDate);

            if (!ModelState.IsValid)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            // Find terminal no from identity.
            var terminalNo        = _identityDomain.FindTerminalNo(HttpContext.User.Identity);
            var checkConveyorCode = _commonDomain.CheckStatusAndNumberRecordOfConveyor(terminalNo);

            if (!checkConveyorCode)
            {
                return(Json(new
                {
                    Success = false,
                    Message = PreProductManagementResources.MSG13
                }));
            }

            var checkedDeviceStatus = _commonDomain.CheckStatusOfDeviceRecordForProductManagement(deviceCode);

            if (!checkedDeviceStatus)
            {
                return(Json(new { Success = false, Message = PreProductManagementResources.MSG14 }));
            }
            //var result = _retrievalOfPreProductDomain.CheckConveyor(terminalNo);
            ////BR 6 Checking Status of Conveyor and Pre-product Warehouse
            //if (!result.IsSuccess)
            //{
            //    return Json(new { Success = false, Message = result.ErrorMessages[0].Equals("MSG13") ? Resources.PreProductManagementResources.MSG13 : Resources.PreProductManagementResources.MSG14 }, JsonRequestBehavior.AllowGet);
            //}


            //    _stockTakingPreProductDomain.RetrieveStockTakingOfPreProduct(terminalNo, preProductCode,
            //        lsRow, lsBay, lsLevel, containerCode, containerNo,udate);

            //return Json(new
            //{
            //            Success = false,
            //            Message =
            //                result.ErrorMessages[0].Equals("MSG13")
            //                    ? Resources.PreProductManagementResources.MSG13
            //                    : Resources.PreProductManagementResources.MSG14
            //        }, JsonRequestBehavior.AllowGet);

            var resulttRetrive = _stockTakingPreProductDomain.RetrieveStockTakingOfPreProduct(terminalNo, preProductCode,
                                                                                              lsRow, lsBay, lsLevel, containerCode, containerNo, udate);

            if (resulttRetrive.IsSuccess)
            {
                return(Json(new { Success = resulttRetrive.IsSuccess, convcode = resulttRetrive.Data }));
            }
            return(Json(new
            {
                Success = resulttRetrive.IsSuccess,
                Message =
                    resulttRetrive.ErrorMessages[0] == "MSG13"
                        ? Resources.PreProductManagementResources.MSG13
                        : resulttRetrive.ErrorMessages[0] == "MSG14"
                            ? Resources.PreProductManagementResources.MSG14
                            : Resources.PreProductManagementResources.MSG28
            }));
        }