protected void Delete_ServerClick(Object sender, EventArgs e) { try { IList<SmallBoardECRInfo> lstSmallInfo = null; string oldFamily = this.cmbFamilyTop.SelectedValue; SmallBoardECRInfo deleteItem = new SmallBoardECRInfo(); deleteItem.ID = int.Parse(this.hidDeleteID.Value); iSmallBoardECR.DeleteSmallBoardECRInfo(deleteItem); lstSmallInfo = iSmallBoardECR.GetSmallBoardECRInfo(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 Save_ServerClick(Object sender, EventArgs e) { string msgHasExistRecord = GetLocalResourceObject(Pre + "_msgHasExistRecord").ToString(); try { IList<SmallBoardECRInfo> lstSmallInfo = null; string family = this.hidFamily2.Value; string mbCode = this.txtMBCode.Value.Trim(); string mbType = this.cmbMBType.SelectedItem.Value; string ecr = this.txtECR.Value.Trim(); string iecVersion = this.txtIECVersion.Value.Trim(); string EffectiveDate = this.hidStartDate.Value.ToString(); string remark = this.ttRemark.Value.Trim(); string oldFamily = this.cmbFamilyTop.SelectedValue; string id = this.hidDeleteID.Value; SmallBoardECRInfo smallECR = new SmallBoardECRInfo(); smallECR.Family = family; smallECR.MBCode = mbCode; smallECR.MBType = mbType; smallECR.ECR = ecr; smallECR.IECVer = iecVersion; smallECR.EffectiveDate = DateTime.Parse(EffectiveDate); smallECR.Remark = remark; smallECR.Editor = UserId; if (!string.IsNullOrEmpty(id)) { smallECR.ID = int.Parse(id); } iSmallBoardECR.SaveSmallBoardECRInfo(smallECR); lstSmallInfo = iSmallBoardECR.GetSmallBoardECRInfo(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(); } }
public void DeleteSmallBoardECRInfo(SmallBoardECRInfo info) { logger.Debug("(ISmallBoardECR)DeleteECRVersion start, [info]:" + info); IMiscRepository iMiscRepository = RepositoryFactory.GetInstance().GetRepository<IMiscRepository>(); try { iMiscRepository.DeleteData<IMES.Infrastructure.Repository._Metas.SmallBoardECR, SmallBoardECRInfo>(info); } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(ISmallBoardECR)DeleteECRVersion end, [info]:" + info); } }
public IList<SmallBoardECRInfo> GetSmallBoardECRInfo(string family) { logger.Debug("(ISmallBoardECR)GetSmallBoardECRInfo start, [family]:" + family); IList<SmallBoardECRInfo> ret = new List<SmallBoardECRInfo>(); IMiscRepository iMiscRepository = RepositoryFactory.GetInstance().GetRepository<IMiscRepository>(); try { SmallBoardECRInfo condition = new SmallBoardECRInfo(); condition.Family = family; ret = iMiscRepository.GetData<IMES.Infrastructure.Repository._Metas.SmallBoardECR, SmallBoardECRInfo>(condition); ret = ret.OrderBy(x => x.MBCode).ThenBy(x => x.MBType).ThenBy(x => x.ECR).ToList(); } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(ISmallBoardECR)GetSmallBoardECRInfo end, [family]:" + family); } return ret; }
public void SaveSmallBoardECRInfo(SmallBoardECRInfo info) { logger.Debug("(ISmallBoardECR)SaveECRVersion start, [info]:" + info); IList<SmallBoardECRInfo> check = new List<SmallBoardECRInfo>(); IMiscRepository iMiscRepository = RepositoryFactory.GetInstance().GetRepository<IMiscRepository>(); try { SmallBoardECRInfo condition = new SmallBoardECRInfo(); condition.Family = info.Family; condition.MBCode = info.MBCode; condition.MBType = info.MBType; condition.ECR = info.ECR; check = iMiscRepository.GetData<IMES.Infrastructure.Repository._Metas.SmallBoardECR, SmallBoardECRInfo>(condition); if (check.Count != 0) { if (info.ID != int.MinValue) { check = check.Where(x => x.ID != info.ID).ToList(); if (check.Count != 0) { throw new FisException("Data Exist"); } } else { throw new FisException("Data Exist"); } } if (info.ID == int.MinValue) { info.Cdt = DateTime.Now; info.Udt = DateTime.Now; iMiscRepository.InsertDataWithID<IMES.Infrastructure.Repository._Metas.SmallBoardECR, SmallBoardECRInfo>(info); } else { SmallBoardECRInfo condition2 = new SmallBoardECRInfo(); condition2.ID = info.ID; check = iMiscRepository.GetData<IMES.Infrastructure.Repository._Metas.SmallBoardECR, SmallBoardECRInfo>(condition2); SmallBoardECRInfo id = new SmallBoardECRInfo(); id.ID = info.ID; info.Cdt = check[0].Cdt; info.Udt = DateTime.Now; iMiscRepository.UpdateDataByID<IMES.Infrastructure.Repository._Metas.SmallBoardECR, SmallBoardECRInfo>(id, info); } } catch (FisException e) { logger.Error(e.mErrmsg); throw e; } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(ISmallBoardECR)SaveECRVersion end, [info]:" + info); } }