public ActionResult _ResultsPost(JobOrderMasterDetailModel vm) { //List<string> uids = new List<string>(); //if (!string.IsNullOrEmpty(Settings.SqlProcGenProductUID)) //{ // uids = _JobOrderLineService.GetProcGenProductUids(Header.DocTypeId, Qty, Header.DivisionId, Header.SiteId); //} if (ModelState.IsValid) { try { _JobOrderLineService.SaveMultiple(vm, User.Identity.Name); } catch (Exception ex) { string message = _exception.HandleException(ex); TempData["CSEXCL"] += message; return(PartialView("_Results", vm)); } return(Json(new { success = true })); } return(PartialView("_Results", vm)); }
public ActionResult _FilterPost(JobOrderLineFilterViewModel vm) { if (vm.JobOrderSettings.isVisibleRate && vm.JobOrderSettings.isMandatoryRate && (vm.Rate == null || vm.Rate == 0)) { ModelState.AddModelError("", "Rate is mandatory"); PrepareViewBag(null); return(PartialView("_Filters", vm)); } List <JobOrderLineViewModel> temp = _JobOrderLineService.GetProdOrdersForFilters(vm).ToList(); bool UnitConvetsionException = (from p in temp where p.UnitConversionException == true select p).Any(); if (UnitConvetsionException) { ModelState.AddModelError("", "Unit Conversion are missing for few Products"); } JobOrderMasterDetailModel svm = new JobOrderMasterDetailModel(); svm.JobOrderLineViewModel = temp; JobOrderHeader Header = _jobOrderHeaderService.Find(vm.JobOrderHeaderId); JobOrderSettings Settings = _jobOrderSettingsService.GetJobOrderSettingsForDocument(Header.DocTypeId, Header.DivisionId, Header.SiteId); svm.JobOrderSettings = Mapper.Map <JobOrderSettings, JobOrderSettingsViewModel>(Settings); return(PartialView("_Results", svm)); }