コード例 #1
0
        private ActionResult _Modify(int id)
        {
            JobOrderLineViewModel temp = _JobOrderLineService.GetJobOrderLine(id);

            JobOrderHeader H = _jobOrderHeaderService.Find(temp.JobOrderHeaderId);

            //Getting Settings
            var settings = _jobOrderSettingsService.GetJobOrderSettingsForDocument(H.DocTypeId, H.DivisionId, H.SiteId);

            temp.JobOrderSettings = Mapper.Map <JobOrderSettings, JobOrderSettingsViewModel>(settings);

            //ViewBag.DocNo = H.DocNo;
            temp.GodownId = H.GodownId;
            if (temp == null)
            {
                return(HttpNotFound());
            }
            PrepareViewBag(temp);

            #region DocTypeTimeLineValidation
            try
            {
                TimePlanValidation = _validator.ValidateDocumentLine(new DocumentUniqueId {
                    LockReason = temp.LockReason
                }, User.Identity.Name, out ExceptionMsg, out Continue);
            }
            catch (Exception ex)
            {
                string message = _exception.HandleException(ex);
                TempData["CSEXCL"] += message;
                TimePlanValidation  = false;
            }

            if (!TimePlanValidation)
            {
                TempData["CSEXCL"] += ExceptionMsg;
            }
            #endregion

            if ((TimePlanValidation || Continue))
            {
                ViewBag.LineMode = "Edit";
            }


            if (temp.ProdOrderLineId != null)
            {
                return(PartialView("_CreateForProdOrder", temp));
            }
            else
            {
                return(PartialView("_Create", temp));
            }
        }
コード例 #2
0
        private ActionResult _Modify(int id)
        {
            RecipeLineViewModel temp = _RecipeLineService.GetStockLine(id);

            RecipeHeaderViewModel H = _RecipeHeaderService.GetRecipeHeader(temp.JobOrderHeaderId);

            temp.HeaderTestingQty = H.TestingQty;
            temp.HeaderQty        = H.Qty;

            //Getting Settings

            if (temp == null)
            {
                return(HttpNotFound());
            }
            PrepareViewBag(temp);

            #region DocTypeTimeLineValidation
            try
            {
                TimePlanValidation = _validator.ValidateDocumentLine(new DocumentUniqueId {
                    LockReason = temp.LockReason
                }, User.Identity.Name, out ExceptionMsg, out Continue);
            }
            catch (Exception ex)
            {
                string message = _exception.HandleException(ex);
                TempData["CSEXCL"] += message;
                TimePlanValidation  = false;
            }

            if (!TimePlanValidation)
            {
                TempData["CSEXCL"] += ExceptionMsg;
            }
            #endregion

            if ((TimePlanValidation || Continue))
            {
                ViewBag.LineMode = "Edit";
            }


            return(PartialView("_Create", temp));
        }
コード例 #3
0
        private ActionResult _Modify(int id)
        {
            PropertyLineViewModel temp = _PropertyLineService.GetProductBuyer(id);

            PropertyHeaderViewModel H = _PropertyHeaderService.GetPropertyHeader(temp.PersonId);

            //Getting Settings

            if (temp == null)
            {
                return(HttpNotFound());
            }
            PrepareViewBag(temp);

            #region DocTypeTimeLineValidation
            try
            {
                TimePlanValidation = _validator.ValidateDocumentLine(new DocumentUniqueId {
                    LockReason = ""
                }, User.Identity.Name, out ExceptionMsg, out Continue);
            }
            catch (Exception ex)
            {
                string message = _exception.HandleException(ex);
                TempData["CSEXCL"] += message;
                TimePlanValidation  = false;
            }

            if (!TimePlanValidation)
            {
                TempData["CSEXCL"] += ExceptionMsg;
            }
            #endregion

            if ((TimePlanValidation || Continue))
            {
                ViewBag.LineMode = "Edit";
            }


            return(PartialView("_Create", temp));
        }