Ejemplo n.º 1
0
 private void PrepareViewBag(RecipeLineViewModel vm)
 {
     if (vm != null)
     {
         RecipeHeaderViewModel H = _RecipeHeaderService.GetRecipeHeader(vm.JobOrderHeaderId);
         ViewBag.DocNo = H.DocTypeName + "-" + H.DocNo;
     }
 }
Ejemplo n.º 2
0
        // GET: /JobOrderHeader/Edit/5
        private ActionResult Edit(int id, string IndexType)
        {
            ViewBag.IndexStatus = IndexType;
            RecipeHeaderViewModel s = _RecipeHeaderService.GetRecipeHeader(id);

            #region DocTypeTimeLineValidation
            try
            {
                TimePlanValidation = _documentValidation.ValidateDocument(Mapper.Map <DocumentUniqueId>(s), DocumentTimePlanTypeConstants.Modify, User.Identity.Name, out ExceptionMsg, out Continue);
            }
            catch (Exception ex)
            {
                string message = _exception.HandleException(ex);
                TempData["CSEXC"] += message;
                TimePlanValidation = false;
            }

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

            if ((!TimePlanValidation && !Continue))
            {
                return(RedirectToAction("DetailInformation", new { id = id, IndexType = IndexType }));
            }


            PrepareViewBag(s.DocTypeId);
            if (s == null)
            {
                return(HttpNotFound());
            }

            ViewBag.Mode            = "Edit";
            ViewBag.transactionType = "";

            ViewBag.Name = _documentTypeService.Find(s.DocTypeId).DocumentTypeName;
            ViewBag.id   = s.DocTypeId;

            if (!(System.Web.HttpContext.Current.Request.UrlReferrer.PathAndQuery).Contains("Create"))
            {
                _RecipeHeaderService.LogDetailInfo(s);
            }

            return(View("Create", s));
        }