public int AddLightStationItem(IMES.DataModel.LightStDef def) { int id=0; try { IList<FaPaLightstInfo> infLst=itemRepository.CheckFaPaLightStationExist(def.iecpn, def.family, def.sation); if (infLst.Count>0) { List<string> param = new List<string>(); FisException fe = new FisException("DMT133", param); throw fe; } else { FaPaLightstInfo info = new FaPaLightstInfo(); PO2VO(def, info); itemRepository.AddFaPaLightStationItem(info); id = info.id; } } catch(Exception) { throw; } return id; }
/// <summary> /// 输入Product Id和相关信息 /// </summary> /// <param name="pdLine">Pd Line</param> /// <param name="prodId">Product Id</param> /// <param name="editor">operator</param> public void InputProdId(string pdLine, string prodId, string editor, string stationId, string customer, out IMES.DataModel.ProductModel curProduct) { logger.Debug("(GenerateCustomerSNForDockingImpl)InputProdId start, [pdLine]:" + pdLine + " [prodId]: " + prodId + " [editor]:" + editor + " [station]:" + stationId + " [customer]:" + customer); try { DoWfGenerateCustomerSNForDocking(pdLine, prodId, editor, stationId, customer, out curProduct, ""); return; } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw e; } finally { logger.Debug("(GenerateCustomerSNForDockingImpl)InputProdId end, [pdLine]:" + pdLine + " [prodId]: " + prodId + " [editor]:" + editor + " [station]:" + stationId + " [customer]:" + customer); } }
public void AddITCNDDefectCheck(IMES.DataModel.ITCNDDefectCheckDef item) { try { Boolean existFamily=false; ITCNDDefectCheckDef dataLst =itemRepository.CheckExistByFamilyAndCode(item.family,item.code); //IList<ITCNDDefectCheckDef> dataLst=GetAllITCNDDefectCheckItems(); //foreach(ITCNDDefectCheckDef def in dataLst) { if (dataLst != null) { FisException fe=null; List<string> param = new List<string>(); fe = new FisException("DMT117",param); throw fe; } } // if(!existFamily) { itemRepository.AddITCNDDefectCheck(item); } } catch(Exception) { throw; } }
public void AddITCNDCheckSetting(IMES.DataModel.ITCNDCheckSettingDef item) { try { //ITC-1361-0159 ITCNDCheckSettingDef cond = new ITCNDCheckSettingDef(); cond.line = item.line; cond.station = item.station; cond.checkItem = item.checkItem; IList<ITCNDCheckSettingDef> dataLst = new List<ITCNDCheckSettingDef>(); dataLst = productRepository.GetExistITCNDCheckSetting(cond); if (dataLst != null && dataLst.Count > 0) { List<string> erpara = new List<string>(); FisException ex; ex = new FisException("DMT151", erpara); throw ex; } productRepository.AddITCNDCheckSetting(item); } catch (Exception) { throw; } }
public BatteryView(IMES mes)//初始化接口 { InitializeComponent(); batteryPres = new BatteryPresenter(this); this.mesInterface = mes; CreateMenu(); LoadCfg(); }
public PalletView(IMES mes) { InitializeComponent(); palletPres = new PalletPresenter(this); servPresenter = new AYWCFServPresenter(mes); this.mesInterface = mes; CreateMenu(); }
/// <summary> /// Check Vendor CT是否有结合厂内CT:Table:TSB..KPDet_LCM 灯管 /// 唯一性检查:只能与一个ProId绑定 /// </summary> /// <param name="part"></param> /// <param name="owner"></param> public override void Check(IMES.FisObject.Common.BOM.IBOMPart part, IPartOwner owner) { //Check Vendor CT是否有结合厂内CT:Table:TSB..KPDet_LCM 灯管 //todo: how to check int i; //唯一性检查:只能与一个ProId绑定 base.Check(part, owner); }
public string AddPAKitLoc(IMES.DataModel.PAKitLocDef item) { string id = ""; if(item!=null) { try { FisException ex; IList<PAKitLoc> pakRes=itemRepository.GetPAKitlocByPdLine(item.pdLine); if(pakRes!=null) { foreach(PAKitLoc loc in pakRes) { if(loc.partNo.Trim().ToLower()==item.partNo.Trim().ToLower()) { List<string> param = new List<string>(); ex = new FisException("DMT080", param); throw ex; } } } PAKitLoc addLoc = new PAKitLoc(); addLoc.location = item.location; addLoc.partNo = item.partNo; addLoc.pdLine = item.pdLine; addLoc.station = item.station; addLoc.descr = item.Descr; addLoc.editor = item.editor; addLoc.udt = DateTime.Now; addLoc.cdt = DateTime.Now; IUnitOfWork uo = new UnitOfWork(); itemRepository.AddPAKitLocDefered(uo, addLoc); IList<PAKitLoc> pakLst=itemRepository.GetPAKitlocByStation(item.station); foreach(PAKitLoc loc in pakLst){ if (loc.location != item.location) { loc.location = item.location; itemRepository.UpdatePAKitLocDefered(uo, loc); } } //itemRepository.AddPAKitLoc(addLoc); uo.Commit(); id = addLoc.id.ToString(); } catch(Exception ee) { logger.Error(ee.Message); throw; } } return id; }
private static void PO2VO(IMES.DataModel.LightStDef def, FaPaLightstInfo info) { info.id = def.id; info.pno = def.iecpn; info.stn = def.sation; info.family = def.family; info.editor = def.editor; info.cdt = Convert.ToDateTime(def.cdt); info.udt = Convert.ToDateTime(def.udt); }
public Form1(IMES mes) { InitializeComponent(); this.mesInterface = mes; string restr = ""; this.mesInterface.AddGroup("查询", ref restr); this.mesInterface.AddGroupItemArea("查询", "电芯查询", OnQueryBatteryEventhandler, ref restr); this.mesInterface.RegistStartAction(StartServ); }
public void AddLotSetting(IMES.DataModel.LotSettingInfo item) { try { MBRepository.InsertLotSettingInfo(item); } catch (Exception) { throw; } }
private static void PO2VO(IMES.DataModel.SATestCheckRuleDef def, PcaTestCheckInfo info) { info.id = def.id; info.code = def.code; info.mac = (def.mac == "Y" ? "Y" : "N"); info.mbct = (def.mbct == "Y" ? "Y" : "N"); info.hddv = def.hddv; info.bios = def.bios; info.editor = def.editor; info.cdt = Convert.ToDateTime(def.cdt); info.udt = Convert.ToDateTime(def.udt); }
public void RemoveITCNDCheckSetting(IMES.DataModel.ITCNDCheckSettingDef item) { try { productRepository.RemoveITCNDCheckSetting(item); } catch (Exception ee) { logger.Error(ee.Message); throw ee; } }
public void RemoveLotSetting(IMES.DataModel.LotSettingInfo item) { try { MBRepository.DeleteLotSettingInfo(item); } catch (Exception ee) { logger.Error(ee.Message); throw ee; } }
public int AddOrUpdateRepairInfoMaintain(IMES.DataModel.RepairInfoMaintainDef def) { int id = 0; try { if(!string.IsNullOrEmpty(def.type)&&!string.IsNullOrEmpty(def.code)) { IList<DefectInfoDef> result = itemRepository.GetDefectInfoByTypeAndCode(def.type, def.code); IPartRepository itemRepositoryNew = RepositoryFactory.GetInstance().GetRepository<IPartRepository>(); IList<string> getData = itemRepositoryNew.GetValueFromSysSettingByName("Customer"); if (getData.Count > 0) { def.customerID = getData[0]; } if (result == null || result.Count==0) { DefectInfoDef vo = PO2VO(def); itemRepository.AddRepairInfoItem(vo); id = vo.id; } else { if (result[0].id == def.id) { //存在 进行更新操作... DefectInfoDef vo = PO2VO(def); itemRepository.UpdateRepairInfoItem(vo, def.code, def.type); id = def.id; } else { List<string> param = new List<string>(); throw new FisException("DMT138",param); } } } } catch(Exception) { throw; } return id; }
private static DefectInfoDef PO2VO(IMES.DataModel.RepairInfoMaintainDef def) { DefectInfoDef vo = new DefectInfoDef(); vo.code = def.code; vo.description = def.description; vo.type = def.type; vo.Editor = def.editor; vo.EngDescr = def.engDescr; vo.customerID = def.customerID; vo.udt = Convert.ToDateTime(def.udt); vo.cdt = Convert.ToDateTime(def.cdt); return vo; }
private static COMSettingInfo PO2VO(IMES.DataModel.COMSettingDef def) { COMSettingInfo vo = new COMSettingInfo(); vo.id = def.id; vo.name = def.name; vo.commPort = def.commport; vo.baudRate = def.baudRate; vo.rthreshold = Convert.ToInt32(def.rthreshold); vo.sthreshold = Convert.ToInt32(def.sthreshold); vo.handshaking = Convert.ToInt32(def.handshaking); vo.editor = def.editor; //vo.cdt = Convert.ToDateTime(def.cdt); //vo.udt = Convert.ToDateTime(def.udt); return vo; }
public int AddOrUpdateWeightSettingItem(IMES.DataModel.COMSettingDef def) { int id=0; try { string name = def.name; IList<COMSettingInfo> tempList=itemRepository.FindCOMSettingByName(name); if (tempList != null && tempList.Count > 0) { //update //issue code //ITC-1361-0062 itc210012 2012-02-01 if (tempList[0].id == def.id) { COMSettingInfo vo = PO2VO(def); vo.id = tempList[0].id; vo.cdt = Convert.ToDateTime(def.cdt); vo.udt = DateTime.Now; itemRepository.UpdateCOMSettingItem(vo); id = vo.id; } else { List<string> param = new List<string>(); throw new FisException("DMT144", param); } } else { //add COMSettingInfo vo = PO2VO(def); vo.cdt = DateTime.Now; vo.udt = DateTime.Now; itemRepository.AddCOMSettingItem(vo); id = vo.id; } } catch(Exception) { throw; } return id; }
public string AddAssetRangeItem(IMES.DataModel.AssetRangeDef item) { //Exception e = null; string id=""; try { //IList<AssetRangeCodeInfo> lst = itemRepository.GetDuplicateAssetRange(item.code, item.begin, item.end); //string msg = ""; //foreach (AssetRangeCodeInfo check in lst) //{ // if (item.begin.Length == check.Begin.Length) // { // msg += check.Begin.ToString() + "~" + check.End.ToString() + Environment.NewLine; // } //} //if (msg != "") //{ // e = new Exception("重複範圍:" + msg); // throw e; //} AssetRangeInfo newInfo = new AssetRangeInfo(); newInfo.code = item.code; //item.code.ToUpper(); newInfo.begin = item.begin;// item.begin.ToUpper(); newInfo.end = item.end;// item.end.ToUpper(); newInfo.remark = item.remark; newInfo.editor = item.editor; newInfo.cdt = DateTime.Now; newInfo.udt = DateTime.Now; newInfo.status = "R"; itemRepository.AddAssetRangeItem(newInfo); id = newInfo.id.ToString(); } catch(Exception ee) { logger.Error(ee.Message); throw; } return id; }
private string CheckLabelType(IMES.FisObject.FA.Product.IProduct product) { string type = ""; string model = product.Model.Trim(); string delievery = product.DeliveryNo.Trim(); string number = "0123456789"; string modelbit = product.Model.Substring(6, 1); // if (!number.Contains(modelbit)) //如果IMES_PAK..PODLabelPart中有维护PartNo等于Model的前几位字符的记录 and (Model的第7位不是数字),则需要列印POD Label==== IList<PODLabelPartDef> podLabelPartLst = new List<PODLabelPartDef>(); podLabelPartLst = ipartRepository.GetPODLabelPartListByPartNo(model); IPartRepository partRep = RepositoryFactory.GetInstance().GetRepository<IPartRepository, IPart>(); IDeliveryRepository iDeliveryRepository = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>(); IList<string> valueList = partRep.GetConstValueTypeList("ExceptPODModel").Select(x => x.value).Where(y => y != "").Distinct().ToList(); if (!number.Contains(modelbit) && podLabelPartLst.Count > 0 && !valueList.Contains(model)) { type = "PODLabel"; } else { if (!product.IsBT) { string BTRegId = (string)iDeliveryRepository.GetDeliveryInfoValue(product.DeliveryNo, "RegId"); if (BTRegId != null && BTRegId.Length == 3) { BTRegId = BTRegId.Substring(1, 2); } else { BTRegId = ""; } string BTShipTp = iDeliveryRepository.GetDeliveryInfoValue(product.DeliveryNo, "ShipTp"); string BTCountry = iDeliveryRepository.GetDeliveryInfoValue(delievery, "Country"); if (!string.IsNullOrEmpty(BTRegId) && !string.IsNullOrEmpty(BTShipTp) && !string.IsNullOrEmpty(BTCountry)) { //ITC-1360-1527:RegId 为'SNE'时,未能打印CONFIG LABEL //if ((BTRegId == "CN" || BTRegId == "AF" || BTRegId == "NE" || BTRegId == "CE") && (BTShipTp == "CTO") && (BTCountry != "JAPAN")) if ((ActivityCommonImpl.Instance.CheckDomesticDN(BTRegId) || BTRegId == "AF" || BTRegId == "NE" || BTRegId == "CE") && (BTShipTp == "CTO") && (BTCountry != "JAPAN")) { type = "ConfigLabel"; } } } } return type; }
public void RemoveITCNDDefectCheck(IMES.DataModel.ITCNDDefectCheckDef item) { try { if(!String.IsNullOrEmpty(item.family)) { string family = item.family.Trim(); string code = item.code.Trim(); //itc-1361-0111 itc210012 2012-02-28 itemRepository.RemoveITCNDDefectCheckbyFamilyAndCode(family, code); } } catch(Exception ee) { logger.Error(ee.Message); throw ee; } }
public AYWCFServPresenter(IMES mes) { this.mesInteface = mes; wcfManager = new WCFManager(); wcfManager.AYServ.delegateGetStep += GetStep; wcfManager.AYServ.delegateUpdateStep += UpdateStep; wcfManager.AYServ.delegateGetTrayBindingCell += GetTrayBindingCell; wcfManager.AYServ.delegateGetTrayCellLotNO += GetTrayCellLotNO; wcfManager.AYServ.delegateUploadTrayCellInfo += UploadTrayCellInfo; //string cels = "{\"Cell1\":\"36AN\",\"Cell2\":\"36AN\",\"Cell3\":\"36AN\",\"Cell4\":\"36AN\"}"; //string restr = ""; //UploadTrayCellInfo("TP1234567", "CV", cels, ref restr); //string js=""; //string restr=""; //int step=0; ////GetTrayBindingCell("TP1234567", out js, ref restr); ////GetStep("TP1234567", out step, ref restr); //GetTrayCellLotNO("TP1234567", out js, ref restr); }
public void addMB_Test(IMES.DataModel.MB_TestDef mbTest) { IList<MBTestDef> lstMBtestDef = new List<MBTestDef>(); lstMBtestDef = itestMB.GetMBTestByCodeFamilyAndType(mbTest.Code, mbTest.Family, mbTest.Type); try { MBTestDef mbTestDef = new MBTestDef(); mbTestDef.family = mbTest.Family; mbTestDef.type = mbTest.Type; mbTestDef.code = mbTest.Code; mbTestDef.remark = mbTest.Remark; mbTestDef.editor = mbTest.editor; mbTestDef.cdt = mbTest.cdt; mbTestDef.udt = mbTest.udt; if (lstMBtestDef != null && lstMBtestDef.Count > 0) { //已经存在具有相同testMB的记录 List<string> erpara = new List<string>(); FisException ex; ex = new FisException("DMT113", erpara); throw ex; } else { itestMB.AddMBTest(mbTestDef); } } catch (Exception e) { throw e; } }
public int AddSATestCheckRuleItem(IMES.DataModel.SATestCheckRuleDef def) { int id=0; try { IList<PcaTestCheckInfo> count = itemRepository.CheckSATestCheckRuleExist(def.code.Trim()); if(count.Count>0) { List<string> param = new List<string>(); FisException fe = new FisException("DMT147",param); throw fe; } PcaTestCheckInfo info = new PcaTestCheckInfo(); PO2VO(def, info); itemRepository.AddSATestCheckRuleItem(info); id = info.id; } catch(Exception) { throw; } return id; }
public string AddCeldataItem(IMES.DataModel.CeldataDef item) { FisException fe = null; string id=""; try { IList<CeldataDef> defpos = GetAllCeldatas(); if(defpos!=null) { foreach(CeldataDef def in defpos) { if (def.zmod.ToUpper().Trim() == item.zmod.ToUpper().Trim()) { List<string> param = new List<string>(); fe = new FisException("DMT158",param); throw fe; } } //IList<CeldataInfo> list = new List<CeldataInfo>(); //list = itemRepository.GetCeldataInfoByRangeAndId(item.begin, item.begin, 0); //if (list != null && list.Count > 0) //{ // List<string> param = new List<string>(); // fe = new FisException("DMT156", param); // throw fe; //} //list = itemRepository.GetCeldataInfoByRangeAndId(item.end, item.end, 0); //if (list != null && list.Count > 0) //{ // List<string> param = new List<string>(); // fe = new FisException("DMT156", param); // throw fe; //} //list = itemRepository.GetCeldataInfoByRangeAndIdReversely(item.begin, item.end, 0); //if (list != null && list.Count > 0) //{ // List<string> param = new List<string>(); // fe = new FisException("DMT156", param); // throw fe; //} } CeldataInfo newInfo = new CeldataInfo(); newInfo.platform = item.platform; //item.code.ToUpper(); newInfo.productSeriesName = item.productSeriesName;// item.begin.ToUpper(); newInfo.category = item.category;// item.end.ToUpper(); newInfo.grade = item.grade; newInfo.tec = item.tec; newInfo.zmod = item.zmod; newInfo.editor = item.editor; newInfo.cdt = DateTime.Now; itemRepository.AddCeldataItem(newInfo); } catch(Exception ee) { logger.Error(ee.Message); throw; } return id; }
private void writeProductLog(Session session,IProduct product, IMES.FisObject.Common.Station.StationStatus status, string line) { var prodRep = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>(); var productLog = new ProductLog { Model = product.Model, Status = status, Editor = this.Editor, Line = line, Station = this.Station, Cdt = DateTime.Now }; product.AddLog(productLog); prodRep.Update(product, session.UnitOfWork); }
private QTimeinfo QTime_To_QTimeinfo(IMES.FisObject.Common.QTime.QTime list) { QTimeinfo e = new QTimeinfo(); if (list != null) { //QTimeStationStatusEnum enumitem = (QTimeStationStatusEnum)Enum.Parse(typeof(QTimeStationStatusEnum), e.Catagory, true);//enum to string e.Line = list.Line; e.Station = list.Station; e.Family = list.Family; e.Catagory = list.Category.ToString(); e.TimeOut = list.TimeOut; e.StopTime = list.StopTime; e.DefectCode = list.DefectCode; e.HoldStation = list.HoldStation; e.HoldStatus = list.HoldStatus.ToString(); e.ExceptStation = list.ExceptStation; e.Editor = list.Editor; e.Cdt = list.Cdt; e.Udt = list.Udt; } return e; }
private bool checkIsTablet(IMES.FisObject.FA.Product.IProduct product) { IFamilyRepository famliyRep = RepositoryFactory.GetInstance().GetRepository<IFamilyRepository, Family>(); FamilyInfoDef fcond = new FamilyInfoDef(); fcond.family = product.Family; fcond.name = "Category"; IList<FamilyInfoDef> famValList = famliyRep.GetExistFamilyInfo(fcond); return (famValList.Count > 0 && famValList[0].value == "Tablet"); }
private bool CheckPODLabel(IMES.FisObject.FA.Product.IProduct product) { // string qc=product.GetAttributeValue("PAQC_QCStatus"); //if (qc == null ) { return true; } bool IsOK = true; CommonImpl cmi = new CommonImpl(); IList<ConstValueInfo> lstConst = cmi.GetConstValueListByType("CTO Check", "Name").Where(x => x.value.Trim() != "").ToList(); if (lstConst.Count==0) { throw new FisException("PAK181", new string[]{"CTO Check"}); } if (lstConst[0].name == "CheckStation") { string[] stArr = lstConst[0].value.Split(','); return stArr.Contains(product.Status.StationId); } return IsOK; //if (lstConst.(product.Status.StationId) > -1) //{ IsOK = true; } }
public void UpdateLightStationItem(IMES.DataModel.LightStDef def, int id) { try { IList<FaPaLightstInfo> infLst = itemRepository.CheckFaPaLightStationExist(def.iecpn, def.family, def.sation); if (infLst!=null&&infLst.Count>0) { FaPaLightstInfo info = infLst[0]; if (info.id != id) { List<string> param = new List<string>(); FisException fe = new FisException("DMT133", param); throw fe; } } FaPaLightstInfo vo = new FaPaLightstInfo(); PO2VO(def,vo); itemRepository.UpdateFaPaLightStationItem(vo); } catch(Exception) { throw; } }
public void SaveMasterLabelItem(IMES.DataModel.MasterLabelDef ml) { try { IList<MasterLabelInfo> infoLst=new List<MasterLabelInfo>(); infoLst=(IList<MasterLabelInfo>)itemRepository.GetMasterLabelByVCAndCode(ml.vc.Trim(), ml.family.Trim()); FisException fe = null; if (infoLst.Count == 0) { ml.cdt = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); ml.udt = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); MasterLabelInfo insertInfo = PO2VO(ml); itemRepository.AddMasterLabelItem(insertInfo); } else { if (infoLst[0].id == ml.id) { ml.udt = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); MasterLabelInfo insertInfo = PO2VO(ml); itemRepository.UpdateMasterLabelItem(insertInfo, ml.vc, ml.family); } else { List<string> param = new List<string>(); fe = new FisException("DMT099", param); throw fe; } } } catch(Exception ee) { logger.Error(ee.Message); throw; } }
/// <summary> /// 修改不良信息 /// </summary> /// <param name="ProductID">Product Id</param> /// <param name="newRepairDefect">新增的Repair Logs</param> public void Add(string ProductID, IMES.DataModel.RepairInfo newRepairDefect) { logger.Debug("(PAQCRepairImpl)Add start, [ProductID]:" + ProductID + " [newRepairDefect]: " + newRepairDefect); FisException ex; List<string> erpara = new List<string>(); string sessionKey = ProductID; try { Session session = SessionManager.GetInstance.GetSession(sessionKey, SessionType); if (session == null) { erpara.Add(sessionKey); ex = new FisException("CHK021", erpara); //ex.logErr("", "", "", "", "83"); //logger.Error(ex); throw ex; } else { RepairDefect defect = getPAQCRepairDefect(newRepairDefect); session.AddValue(Session.SessionKeys.CurrentRepairdefect, defect); session.AddValue(Session.SessionKeys.MaintainAction, 0); session.Exception = null; session.SwitchToWorkFlow(); //check workflow exception if (session.Exception != null) { if (session.GetValue(Session.SessionKeys.WFTerminated) != null) { session.ResumeWorkFlow(); } throw session.Exception; } } } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw e; } finally { logger.Debug("(PAQCRepairImpl)Add end, [ProductID]:" + ProductID + " [newRepairDefect]: " + newRepairDefect); } }
/// <summary> /// 强制结束一个指定Session /// </summary> /// <param name="sessionKey">MBSN或ProdId等</param> /// <param name="type">type包括MB,Product,Common</param> public void TerminateSession(string sessionKey, IMES.DataModel.SessionType type) { try { Session.SessionType currentSessionType = Session.SessionType.Common; switch (type) { case IMES.DataModel.SessionType.Common: currentSessionType = Session.SessionType.Common; break; case IMES.DataModel.SessionType.MB: currentSessionType = Session.SessionType.MB; break; case IMES.DataModel.SessionType.Product: currentSessionType = Session.SessionType.Product; break; } Session tempSession = SessionManager.GetInstance.GetSession(sessionKey, currentSessionType); if (tempSession != null) { logger.WarnFormat("Manual TerminateSession SessionKey:{0} Station:{1} Line:{2} Editor:{3}", tempSession.Key, tempSession.Station ?? "", tempSession.Line ?? "", tempSession.Editor??""); SessionManager.GetInstance.RemoveSession(tempSession); } } catch (Exception ex) { throw ex; } }
private RepairDefect getPAQCRepairDefect(IMES.DataModel.RepairInfo repairLogInfo) { RepairDefect defect = new RepairDefect(); defect.ID = string.IsNullOrEmpty(repairLogInfo.id) ? 0 : int.Parse(repairLogInfo.id); defect._4M = repairLogInfo._4M; defect.Action = repairLogInfo.action; defect.Cause = repairLogInfo.cause; defect.Cdt = repairLogInfo.cdt; defect.Component = repairLogInfo.component; defect.Cover = repairLogInfo.cover; defect.DefectCodeID = repairLogInfo.defectCodeID; defect.Distribution = repairLogInfo.distribution; defect.Editor = repairLogInfo.editor; defect.IsManual = (!string.IsNullOrEmpty(repairLogInfo.isManual) && repairLogInfo.isManual.Equals("1")) ? true : false; defect.MajorPart = repairLogInfo.majorPart; defect.Manufacture = repairLogInfo.manufacture; defect.Mark = repairLogInfo.mark; defect.NewPart = repairLogInfo.newPart; defect.NewPartSno = repairLogInfo.newPartSno; defect.Obligation = repairLogInfo.obligation; defect.OldPart = repairLogInfo.oldPart; defect.OldPartSno = repairLogInfo.oldPartSno; defect.PartType = repairLogInfo.partType; defect.PIAStation = repairLogInfo.piaStation; defect.Remark = repairLogInfo.remark; defect.RepairID = string.IsNullOrEmpty(repairLogInfo.repairID) ? 0 : int.Parse(repairLogInfo.repairID); defect.Responsibility = repairLogInfo.responsibility; defect.ReturnSign = repairLogInfo.returnSign; defect.Site = repairLogInfo.site; defect.SubDefect = repairLogInfo.subDefect; defect.TrackingStatus = repairLogInfo.trackingStatus; defect.Type = repairLogInfo.type; defect.Udt = repairLogInfo.udt; defect.Uncover = repairLogInfo.uncover; defect.VendorCT = repairLogInfo.vendorCT; defect.VersionA = repairLogInfo.versionA; defect.VersionB = repairLogInfo.versionB; defect.NewPartDateCode = repairLogInfo.newPartDateCode; return defect; }