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 void UpdateITCNDCheckSetting(ITCNDCheckSettingDef item, ITCNDCheckSettingDef cond) { try { productRepository.ChangeITCNDCheckSetting(item, cond); } catch (Exception ee) { logger.Error(ee.Message); throw ee; } }
public IList<IMES.DataModel.ITCNDCheckSettingDef> GetAllITCNDCheckSettingItems() { IList<ITCNDCheckSettingDef> dataLst = new List<ITCNDCheckSettingDef>(); try { ITCNDCheckSettingDef cond = new ITCNDCheckSettingDef(); dataLst = productRepository.GetExistITCNDCheckSetting(cond); } catch (Exception ee) { logger.Error(ee.Message); throw ee; } return dataLst; }
protected void btnDelete_ServerClick(object sender, EventArgs e) { try { ITCNDCheckSettingDef def = new ITCNDCheckSettingDef(); //调用删除方法. def.id = Convert.ToInt32(this.hidhidcol.Value.Trim()); itcndCheckSetting.RemoveITCNDCheckSetting(def); } catch (FisException fex) { showErrorMessage(fex.mErrmsg); return; } catch (System.Exception ex) { showErrorMessage(ex.Message); return; } showList(); this.updatePanel2.Update(); this.CmbCheckType.setSelected(0); ScriptManager.RegisterStartupScript(this.updatePanel, typeof(System.Object), "saveUpdate", "resetTableHeight();DeleteComplete();HideWait();", true); }
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 btnSave_ServerClick(object sender, EventArgs e) { ITCNDCheckSettingDef itcnd = new ITCNDCheckSettingDef(); ITCNDCheckSettingDef cond = new ITCNDCheckSettingDef(); cond.id = Convert.ToInt32(this.hidhidcol.Value.Trim()); itcnd.line = this.txtLine.Text.Trim(); itcnd.checkItem = this.txtCheckItem.Text.Trim(); itcnd.station = this.txtStation.Text.Trim(); itcnd.checkType = this.CmbCheckType.InnerDropDownList.SelectedValue.Trim(); itcnd.checkCondition = this.txtCheckCondition.Text.Trim(); itcnd.editor = this.HiddenUserName.Value.Trim(); itcnd.udt = DateTime.Now; try { //调用添加的方法 相同的key时需要抛出异常... itcndCheckSetting.UpdateITCNDCheckSetting(itcnd, cond); } catch (FisException fex) { showErrorMessage(fex.mErrmsg); return; } catch (System.Exception ex) { showErrorMessage(ex.Message); return; } showList(); this.updatePanel2.Update(); ScriptManager.RegisterStartupScript(this.updatePanel, typeof(System.Object), "saveUpdate", "resetTableHeight();SaveUpdateComplete('" + this.hidhidcol.Value + "');HideWait();", true); }
private bool checkItemResult(string productId, ITCNDCheckSettingDef checkItem, IList<IMES.FisObject.FA.Product.ProductInfo> infoList) { bool ret = true; bool needCheck = true; if (!string.IsNullOrEmpty(checkItem.checkCondition)) { IPartRepository partRep = RepositoryFactory.GetInstance().GetRepository<IPartRepository, IPart>(); if (partRep.CheckBySP(checkItem.checkCondition, productId, checkItem.checkItem) != 1) { needCheck = false; } } if (needCheck) { if (checkItem.checkType == "Exist") { var infoValue= checkProductInfoExists(infoList, checkItem.checkItem); if (infoValue != null) { checkItem.checkType = infoValue.InfoValue; checkItem.checkCondition = "1"; return true; } return false; } else if (checkItem.checkType == "Unique") { var infoValue = checkProductInfoExists(infoList, checkItem.checkItem); if (infoValue!=null) { if (checkProductInfoUnique(productId, infoList, checkItem.checkItem)) { checkItem.checkType = infoValue.InfoValue; checkItem.checkCondition = "1"; return true; } else { return false; } } else { checkItem.checkType = "Exist"; return false; } } } return ret; }