protected void LoadEditJobViewModel(EditPrdnJobViewModel model, int id, string urlReturn) { var job = (from j in PrdnDBContext.ProductionJobs .Include("Run").Include("Product").Include("Request").Include("Priority").Include("PrdnInvItem") .Include("CreatedUser").Include("ScheduledUser").Include("ProcessedUser").Include("CompletedUser").Include("CanceledUser") where j.ID == id select j).FirstOrDefault(); if (job != null) { Mapper.Map<ProductionJob, EditPrdnJobViewModel>(job, model); if (job.IsNotNull(j => j.PrdnInvItem)) { } model.UrlReturn = urlReturn; model.loadFromRun(job.Run); LoadViewJobProdLists(model, job); WorksheetEditViewModel.LoadViewJobEditWorksheet(model, job); overrideViewJobProdOpts(model); } else { model = null; } }
protected void PrintJobViewItemLabel(IPrinterInfo printerInfo, EditPrdnJobViewModel viewJob, ProductionJob job = null) { if ((viewJob.PrdnTypeCode == null) && (job.IfNotNull(j => j.Run) != null)) { viewJob.loadFromRun(job.Run); } if ((viewJob.WorksheetID != null) && (viewJob.EditWorksheet == null)) { WorksheetEditViewModel.LoadViewJobEditWorksheet(viewJob, job); } PrdnZplMultiParam parm = new PrdnZplMultiParam(viewJob); ZplPrinterHelper.NetworkMultiZpl(printerInfo.PrinterHostName, (int)printerInfo.PrinterPort, parm); }