/// <summary> /// 登陆 /// </summary> /// <param name="operatorID"></param> /// <param name="workOrderID"></param> /// <param name="productID"></param> /// <param name="stationID"></param> /// <param name="specID"></param> /// <returns></returns> public bool Login(string operatorID, string workOrderID, Guid productID, Guid stationID, Guid specID) { WorkInfo = workInfoRepository.GetData(Guid.Empty); WorkInfo.WorkInfoOperator = operatorID; WorkInfo.WorkOrderID = workOrderID; WorkInfo.ProductID = productID; WorkInfo.StationID = stationID; WorkInfo.SpecID = specID; WorkInfo.ClientName = Environment.MachineName; ProductInfo = DbFactory.Repository <ProductInfoRepository>().GetData(WorkInfo.ProductID); StationInfo = DbFactory.Repository <StationInfoRepository>().GetData(WorkInfo.StationID); var specInfo = DbFactory.Repository <SpecInfoRepository>().GetData(WorkInfo.SpecID); if (ProductInfo == null || StationInfo == null || specInfo == null) { IsLogin = false; return(false); } ProductType = DbFactory.Repository <ProductTypeRepository>().GetData(ProductInfo.ProductTypeID); if (ProductType == null) { IsLogin = false; return(false); } SpecData = new MeasurementJobSpec(specInfo, ProductInfo.ProductClassID); ReferenceData = new ReferenceData(ProductInfo.ProductClassID); IsLogin = workInfoRepository.SaveData(WorkInfo); return(IsLogin); }
public ActionResult <WorkInfo> GetData(Guid pWorkInfoID) { try { return(ActionResult <WorkInfo> .SetSuccess("", repository.GetData(pWorkInfoID))); } catch (Exception ex) { return(ActionResult <WorkInfo> .SetError(ex.Message, null)); } }