public JsonResult InspectLabelTest(string fileName) { LabelInspectionManager lim = new LabelInspectionManager(db, true); LabelinspViewModel packingLabelViewModel = lim.InspectLabelTest(fileName); return(Json(packingLabelViewModel)); }
public JsonResult WorkorderLabelGetData(string serialNumber) { //uow.DisableProxyCreation(); LabelinspViewModel packingLabelViewModel = new LabelinspViewModel(); packingLabelViewModel.WorkorderLabel = uow.WorkorderLabelRepo.GetBySerialNumber(serialNumber); packingLabelViewModel.WorkorderLabelInspections = uow.WorkorderLabelInspectionRepo.GetByPackingLabelId(packingLabelViewModel.WorkorderLabel?.Id ?? 0); return(Json(packingLabelViewModel)); }
public LabelinspViewModel InspectLabelTest(string fileName) { LabelinspViewModel packingLabelViewModel = new LabelinspViewModel(); packingLabelViewModel.WorkorderLabel = new WorkorderLabel(); packingLabelViewModel.WorkorderLabelInspections = new List <WorkorderLabelInspection>(); try { Logger2FileSingleton.Instance.SaveLog("LabelInspectionManager.InspectLabelTest(" + fileName + ") START"); InspectLabel_AnalizeImage(fileName, out ItemData itemData, out string serialNumber, out EnumLabelType labelType, true); if (itemData != null) { Workorder wo = uow.WorkorderRepo.Get(serialNumber, itemData.ItemCode); packingLabelViewModel.WorkorderLabel = new WorkorderLabel() { Id = 0, SerialNumber = serialNumber, TimeStamp = DateTime.Now, Workorder = new Workorder() { ItemCode = wo?.ItemCode ?? "", ItemName = wo?.ItemName ?? "", WorkorderNumber = wo?.WorkorderNumber ?? "" } }; packingLabelViewModel.WorkorderLabelInspections = WorkorderLabelInspectionRepo.PrepareInspectionResults(0, itemData, labelType); Logger2FileSingleton.Instance.SaveLog("LabelInspectionManager.InspectLabelTest(" + fileName + ") END"); } else { //ArchiveOrDeleteRawLabel(fileName, true); Logger2FileSingleton.Instance.SaveLog("LabelInspectionManager.InspectLabelTest(" + fileName + ") END - ItemData is NULL"); } } catch (Exception ex) { Logger2FileSingleton.Instance.SaveLog("LabelInspectionManager.InspectLabelTest(" + fileName + ") Exception: " + ex.Message + Environment.NewLine + " d:" + ex.InnerException?.Message + Environment.NewLine + " s:" + ex.ToString()); } return(packingLabelViewModel); }