public void DeleteSmallBoardDefineInfo(SmallBoardDefineInfo info) { logger.Debug("(SmallBoardDefine)DeleteSmallBoardDefineInfo start, [info]:" + info); IMiscRepository iMiscRepository = RepositoryFactory.GetInstance().GetRepository<IMiscRepository>(); try { iMiscRepository.DeleteData<IMES.Infrastructure.Repository._Metas.SmallBoardDefine, SmallBoardDefineInfo>(info); } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(SmallBoardDefine)DeleteSmallBoardDefineInfo end, [info]:" + info); } }
public void AddSmallBoardDefineInfo(SmallBoardDefineInfo info) { logger.Debug("(SmallBoardDefine)SaveSmallBoardDefineInfo start, [info]:" + info); IList<SmallBoardDefineInfo> check = new List<SmallBoardDefineInfo>(); IMiscRepository iMiscRepository = RepositoryFactory.GetInstance().GetRepository<IMiscRepository>(); try { SmallBoardDefineInfo qtyCondition = new SmallBoardDefineInfo(); qtyCondition.Family = info.Family; IList<SmallBoardDefineInfo> checkQty = iMiscRepository.GetData<IMES.Infrastructure.Repository._Metas.SmallBoardDefine, SmallBoardDefineInfo>(qtyCondition); if (checkQty.Count != 0) { if (checkQty[0].MaxQty != info.MaxQty) { throw new FisException("CQCHK50121", new string[] { }); } } if (info.ID == int.MinValue) { throw new FisException("ID is null"); } SmallBoardDefineInfo condition1 = new SmallBoardDefineInfo(); condition1.Family = info.Family; condition1.MBType = info.MBType; condition1.PartNo = info.PartNo; check = iMiscRepository.GetData<IMES.Infrastructure.Repository._Metas.SmallBoardDefine, SmallBoardDefineInfo>(condition1); if (check.Count != 0) { throw new FisException("Data Exist"); } SmallBoardDefineInfo condition2 = new SmallBoardDefineInfo(); condition2.Family = info.Family; condition2.MBType = info.MBType; condition2.Priority = info.Priority; check = iMiscRepository.GetData<IMES.Infrastructure.Repository._Metas.SmallBoardDefine, SmallBoardDefineInfo>(condition2); if (check.Count != 0) { throw new FisException("Data Exist"); } info.Cdt = DateTime.Now; info.Udt = DateTime.Now; iMiscRepository.InsertDataWithID<IMES.Infrastructure.Repository._Metas.SmallBoardDefine, SmallBoardDefineInfo>(info); } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(SmallBoardDefine)SaveSmallBoardDefineInfo end, [info]:" + info); } }
public void SaveSmallBoardDefineInfo(SmallBoardDefineInfo info) { logger.Debug("(SmallBoardDefine)SaveSmallBoardDefineInfo start, [info]:" + info); IList<SmallBoardDefineInfo> check = new List<SmallBoardDefineInfo>(); IMiscRepository iMiscRepository = RepositoryFactory.GetInstance().GetRepository<IMiscRepository>(); try { SmallBoardDefineInfo qtyCondition = new SmallBoardDefineInfo(); qtyCondition.Family = info.Family; IList<SmallBoardDefineInfo> checkQty = iMiscRepository.GetData<IMES.Infrastructure.Repository._Metas.SmallBoardDefine, SmallBoardDefineInfo>(qtyCondition); if (checkQty.Count != 0) { if (checkQty[0].MaxQty != info.MaxQty) { throw new FisException("CQCHK50121", new string[] { }); } } if (info.ID == int.MinValue) { throw new FisException("ID is null"); } SmallBoardDefineInfo condition1 = new SmallBoardDefineInfo(); condition1.Family = info.Family; condition1.MBType = info.MBType; condition1.PartNo = info.PartNo; check = iMiscRepository.GetData<IMES.Infrastructure.Repository._Metas.SmallBoardDefine, SmallBoardDefineInfo>(condition1); if (check.Count != 0) { if (check[0].ID != info.ID) { throw new FisException(string.Format("此PartNo:{0}已存在Family:{1}、MBType:{2}的配置中。", info.PartNo, info.Family, info.MBType)); } } SmallBoardDefineInfo condition2 = new SmallBoardDefineInfo(); condition2.Family = info.Family; condition2.MBType = info.MBType; condition2.Priority = info.Priority; check = iMiscRepository.GetData<IMES.Infrastructure.Repository._Metas.SmallBoardDefine, SmallBoardDefineInfo>(condition2); if (check.Count != 0) { if (check[0].ID != info.ID) { throw new FisException(string.Format("此Priority:{0}已存在Family:{1}、MBType:{2}的配置中。", info.Priority, info.Family, info.MBType)); } } SmallBoardDefineInfo condition3 = new SmallBoardDefineInfo(); condition3.ID = info.ID; check = iMiscRepository.GetData<IMES.Infrastructure.Repository._Metas.SmallBoardDefine, SmallBoardDefineInfo>(condition3); SmallBoardDefineInfo id = new SmallBoardDefineInfo(); id.ID = info.ID; info.Cdt = check[0].Cdt; info.Udt = DateTime.Now; iMiscRepository.UpdateDataByID<IMES.Infrastructure.Repository._Metas.SmallBoardDefine, SmallBoardDefineInfo>(id, info); } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(SmallBoardDefine)SaveSmallBoardDefineInfo end, [info]:" + info); } }
public IList<SmallBoardDefineInfo> GetSmallBoardDefineInfo(string family) { logger.Debug("(SmallBoardDefine)GetSmallBoardDefineInfo start, [family]:" + family); IList<SmallBoardDefineInfo> ret = new List<SmallBoardDefineInfo>(); IMiscRepository iMiscRepository = RepositoryFactory.GetInstance().GetRepository<IMiscRepository>(); try { SmallBoardDefineInfo condition = new SmallBoardDefineInfo(); if (family != "ALL") { condition.Family = family; } ret = iMiscRepository.GetData<IMES.Infrastructure.Repository._Metas.SmallBoardDefine, SmallBoardDefineInfo>(condition); ret = ret.OrderBy(x => x.Family).ThenBy(x => x.Priority).ToList(); } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(SmallBoardDefine)GetSmallBoardDefineInfo end, [family]:" + family); } return ret; }
protected void Delete_ServerClick(Object sender, EventArgs e) { try { IList<SmallBoardDefineInfo> lstSmallInfo = null; string oldFamily = this.cmbFamilyTop.SelectedValue; SmallBoardDefineInfo deleteItem = new SmallBoardDefineInfo(); deleteItem.ID = int.Parse(this.hidDeleteID.Value); iSmallBoardDefine.DeleteSmallBoardDefineInfo(deleteItem); lstSmallInfo = iSmallBoardDefine.GetSmallBoardDefineInfo(oldFamily); bindTable(lstSmallInfo, DEFAULT_ROWS); } catch (FisException ex) { showErrorMessage(ex.mErrmsg); bindTable(null, DEFAULT_ROWS); } catch (Exception ex) { showErrorMessage(ex.Message); bindTable(null, DEFAULT_ROWS); } finally { hideWait(); } }
protected void Add_ServerClick(Object sender, EventArgs e) { string msgHasExistRecord = GetLocalResourceObject(Pre + "_msgHasExistRecord").ToString(); try { IList<SmallBoardDefineInfo> lstSmallInfo = null; string family = this.hidFamily2.Value; string mbType = this.cmbMBType.SelectedItem.Value; string partNo = this.cmbPartNo.SelectedItem.Value; string qty = this.txtQty.Value.Trim(); string maxQty = this.txtMaxQty.Value.Trim(); string priority = this.txtPriority.Value.Trim(); string ecr = this.txtECR.Value.Trim(); string iec = this.txtIECVersion.Value.Trim(); string oldFamily = this.cmbFamilyTop.SelectedValue; SmallBoardDefineInfo smallDefine = new SmallBoardDefineInfo(); smallDefine.Family = family; smallDefine.MBType = mbType; smallDefine.PartNo = partNo; smallDefine.Qty = int.Parse(qty); smallDefine.MaxQty = int.Parse(maxQty); smallDefine.Priority = int.Parse(priority); smallDefine.ECR = ecr; smallDefine.IECVer = iec; smallDefine.Editor = UserId; iSmallBoardDefine.AddSmallBoardDefineInfo(smallDefine); lstSmallInfo = iSmallBoardDefine.GetSmallBoardDefineInfo(oldFamily); bindTable(lstSmallInfo, DEFAULT_ROWS); } catch (FisException ex) { showErrorMessage(ex.mErrmsg); return; } catch (Exception ex) { showErrorMessage(ex.Message); return; } finally { ScriptManager.RegisterStartupScript(this.Page, typeof(System.Object), "resetTableHeight", "resetTableHeight();", true); hideWait(); } }