public void addMBMaintain(RctombmaintainInfo info) { IList<RctombmaintainInfo> list = new List<RctombmaintainInfo>(); RctombmaintainInfo cond = new RctombmaintainInfo(); cond.family = info.family; list = mbmoRepository.GetRctombmaintainInfoList(cond); bool bFind = false; foreach (RctombmaintainInfo temp in list) { if (temp.code == info.code && temp.type == info.type) { //IMBMORepository:: //void UpdateRctombmaintainInfo(RctombmaintainInfo setValue, RctombmaintainInfo condition); bFind = true; RctombmaintainInfo setValue = new RctombmaintainInfo(); RctombmaintainInfo cond1 = new RctombmaintainInfo(); cond1.family = temp.family; cond1.code = temp.code; cond1.type = temp.type; setValue.remark = info.remark; setValue.editor = info.editor; mbmoRepository.UpdateRctombmaintainInfo(setValue, cond1); //List<string> erpara = new List<string>(); //FisException ex; //ex = new FisException("DMT154", erpara); //throw ex; } } if(bFind == false) mbmoRepository.AddRctombmaintainInfo(info); }
public IList<RctombmaintainInfo> getMBMaintaininfo(string family) { IList<RctombmaintainInfo> list = new List<RctombmaintainInfo>(); RctombmaintainInfo cond = new RctombmaintainInfo(); cond.family = family; list = mbmoRepository.GetRctombmaintainInfoList(cond); return list; }
protected void btnAdd_ServerClick(object sender, EventArgs e) { ITCNDCheckSettingDef itcnd = new ITCNDCheckSettingDef(); RctombmaintainInfo item = new RctombmaintainInfo(); item.family = this.Family2.InnerDropDownList.SelectedValue.Trim(); item.code = this.CmbMBCode.InnerDropDownList.SelectedValue.Trim(); item.type = this.CmbMBType.InnerDropDownList.SelectedValue.Trim(); item.remark = this.txtRemark.Text.Trim(); item.editor = this.HiddenUserName.Value.Trim(); item.cdt = DateTime.Now; item.udt = DateTime.Now; try { //调用添加的方法 相同的key时需要抛出异常... mbmaintain.addMBMaintain(item); } catch (FisException fex) { showErrorMessage(fex.mErrmsg); return; } catch (System.Exception ex) { showErrorMessage(ex.Message); return; } showList(item.family); this.updatePanel2.Update(); ScriptManager.RegisterStartupScript(this.updatePanel, typeof(System.Object), "saveUpdate", "resetTableHeight();AddUpdateComplete();HideWait();", true); }
protected void btnDelete_ServerClick(object sender, EventArgs e) { try { RctombmaintainInfo cond = new RctombmaintainInfo(); //调用删除方法. cond.family = this.hidFamily.Value; cond.code = this.hidCode.Value; cond.type = this.hidType.Value; if (cond.family == "" || cond.code == "" || cond.type == "") { showErrorMessage(pmtMessage5); } else { mbmaintain.deleteMBMaintain(cond); } } catch (FisException fex) { showErrorMessage(fex.mErrmsg); return; } catch (System.Exception ex) { showErrorMessage(ex.Message); return; } string family = this.Family1.InnerDropDownList.SelectedValue.Trim(); showList(family); this.updatePanel2.Update(); //this.CmbCheckType.setSelected(0); ScriptManager.RegisterStartupScript(this.updatePanel, typeof(System.Object), "saveUpdate", "resetTableHeight();DeleteComplete();HideWait();", true); }
private bool CheckMBType(string sn, string IsRCTO,IMB mb, out string pilotMo) { IMBMORepository iMBMORepository = RepositoryFactory.GetInstance().GetRepository<IMBMORepository>(); IMBRepository iMBRepository = RepositoryFactory.GetInstance().GetRepository<IMBRepository>(); IPartRepository iPartRepository = RepositoryFactory.GetInstance().GetRepository<IPartRepository>(); RctombmaintainInfo condition = new RctombmaintainInfo(); IList<RctombmaintainInfo> list = new List<RctombmaintainInfo>(); string MBCode = sn.Substring(0,2); string MBFamily = ""; string MBType = sn.Substring(5,1); //IMB MB = (IMB)iMBRepository.Find(sn); //Vincent add Check PilotMB pilotMo = (string)mb.GetExtendedProperty("PilotMo"); IPart Part = (IPart)iPartRepository.GetPartByPartNo(mb.PCBModelID); MBFamily = Part.Descr; if (IsRCTO == "Y") { if (MBType != "R") { condition.code = MBCode; condition.family = MBFamily; //Vincent fixed bug 多連板 case condition.type = "C"; //MBType; list = iMBMORepository.GetRctombmaintainInfoList(condition); if (list.Count == 0) { return false; } } } else { if (MBType == "R") { condition.code = MBCode; condition.family = MBFamily; condition.type = MBType; list = iMBMORepository.GetRctombmaintainInfoList(condition); if (list.Count == 0) { return false; } } } return true; }
//ITC-1103-0050 /// <summary> /// Check PCMB RCTOMB /// </summary> /// <param name="executionContext"></param> /// <returns></returns> protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext) { string check = (string)CurrentSession.GetValue(Session.SessionKeys.CN); string mbSNo = this.Key; string[] lists = {"1","2","3","4","5","6","7","8","9","C","G"}; //DEBUG ITC-1413-0053 //MBCode 升位,CheckCode需要相应进行修改 // CheckCode:若MBSN的第5码为’M’,则取MBSN的第6码,否则取第7码 // CheckCode为数字,则为子板,为’R’,则为RCTO // ============================================================ string strCheckCode = ""; if (mbSNo.Substring(4, 1) == "M" || mbSNo.Substring(4, 1) == "B") { strCheckCode = mbSNo.Substring(5, 1); } else { strCheckCode = mbSNo.Substring(6, 1); } //============================================================= if (check == "RCTO") { if (!(mbSNo.Substring(4, 1) == "M" || mbSNo.Substring(4, 1) == "B" ) || (mbSNo.Substring(5, 1) == "M"||mbSNo.Substring(5, 1) == "B")) { List<string> errpara = new List<string>(); throw new FisException("CHK158", errpara); } //if (mbSNo.Substring(5, 1) != "R") if (strCheckCode != "R" ) { IMBMORepository currentMBMORepository = RepositoryFactory.GetInstance().GetRepository<IMBMORepository, IMBMO>(); RctombmaintainInfo condition = new RctombmaintainInfo(); condition.type = "R"; condition.code = mbSNo; IList<RctombmaintainInfo> getRctoInfo = currentMBMORepository.GetRctombmaintainInfoList(condition); if (null == getRctoInfo || getRctoInfo.Count == 0) { List<string> errpara = new List<string>(); throw new FisException("CHK158", errpara); } } } else if (check == "PC") { if (!(mbSNo.Substring(4, 1) == "M" || mbSNo.Substring(4, 1) == "B") || (mbSNo.Substring(5, 1) == "M" || mbSNo.Substring(5, 1) == "B")) { List<string> errpara = new List<string>(); throw new FisException("CHK157", errpara); } //var subStr = mbSNo.Substring(5, 1); var subStr = strCheckCode; var flag = false; foreach (var lst in lists) { if (subStr == lst) { flag = true; break; } } if (!flag) { List<string> errpara = new List<string>(); throw new FisException("CHK157", errpara); } } return base.DoExecute(executionContext); }
public void deleteMBMaintain(RctombmaintainInfo info) { mbmoRepository.DeleteRctombmaintainInfo(info); }