protected void Delete_ServerClick(Object sender, EventArgs e) { try { OSWINInfo OSWINInfo = new OSWINInfo(); OSWINInfo.ID = Convert.ToInt32(this.hidID.Value); OSWINInfo.Family = this.hidFamily2.Value; if (OSWINInfo.ID != 0) { iOSWIN.Remove(OSWINInfo); } IList<OSWINInfo> lstOSWINList = iOSWIN.GetOSWINList(this.cmbFamily.SelectedValue.ToString().Trim()); initFamilySelect(); this.updatePanel3.Update(); bindTable(lstOSWINList, DEFAULT_ROWS); } catch (FisException ex) { showErrorMessage(ex.mErrmsg); bindTable(null, DEFAULT_ROWS); } catch (Exception ex) { showErrorMessage(ex.Message); bindTable(null, DEFAULT_ROWS); } finally { hideWait(); } }
private IMES.FisObject.Common.Model.OSWIN OSWINInfo_To_OSWIN(OSWINInfo item) { IMES.FisObject.Common.Model.OSWIN e = new IMES.FisObject.Common.Model.OSWIN(); e.ID = item.ID; e.Family = item.Family; e.Zmode = item.Zmode; e.OS = item.OS; e.AV = item.AV; e.Image = item.Image; e.Editor = item.Editor; e.Cdt = item.Cdt; e.Udt = item.Udt; return e; }
protected void Save_ServerClick(Object sender, EventArgs e) { try { OSWINInfo OSWINInfo = new OSWINInfo(); OSWINInfo.Family = this.hidFamily2.Value; OSWINInfo.Zmode = this.txtZmod.Value; OSWINInfo.OS = this.txtOS.Value; OSWINInfo.AV = this.txtAV.Value; OSWINInfo.Image = this.txtImage.Value; OSWINInfo.Editor = UserId; OSWINInfo CheckOSWIN = iOSWIN.CheckExistOSWIN(OSWINInfo.Family, OSWINInfo.Zmode); if (CheckOSWIN.Family == "" || CheckOSWIN.Family == null) { iOSWIN.Add(OSWINInfo); } else { OSWINInfo.ID = CheckOSWIN.ID; iOSWIN.Update(OSWINInfo); } IList<OSWINInfo> lstOSWINList = iOSWIN.GetOSWINList(this.cmbFamily.SelectedValue.ToString().Trim()); initFamilySelect(); this.updatePanel3.Update(); bindTable(lstOSWINList, DEFAULT_ROWS); } catch (FisException ex) { showErrorMessage(ex.mErrmsg); bindTable(null, DEFAULT_ROWS); } catch (Exception ex) { showErrorMessage(ex.Message); bindTable(null, DEFAULT_ROWS); } finally { ScriptManager.RegisterStartupScript(this.Page, typeof(System.Object), "resetTableHeight", "resetTableHeight(); clearDetailInfo();", true); hideWait(); } }
private OSWINInfo OSWIN_To_OSWINInfo(IMES.FisObject.Common.Model.OSWIN item) { OSWINInfo e = new OSWINInfo(); e.ID = item.ID; e.Family = item.Family; e.Zmode = item.Zmode; e.OS = item.OS; e.AV = item.AV; e.Image = item.Image; e.Editor = item.Editor; e.Cdt = item.Cdt; e.Udt = item.Udt; return e; }
public void Add(OSWINInfo item) { logger.Debug("(OSWIN)Add start, [item]:" + item); IMES.FisObject.Common.Model.OSWIN OSWIN = null; IUnitOfWork work = new UnitOfWork(); try { OSWIN = OSWINInfo_To_OSWIN(item); iOSWINRepository.Add(OSWIN, work); work.Commit(); } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(OSWIN)Add end, [item]:" + item); } }
public void Update(OSWINInfo item) { logger.Debug("(OSWIN)Update start, [item]:" + item); IMES.FisObject.Common.Model.OSWIN OSWINOld = null; IMES.FisObject.Common.Model.OSWIN OSWINNew = null; IUnitOfWork work = new UnitOfWork(); try { OSWINOld = iOSWINRepository.Find(item.ID); OSWINNew = OSWINInfo_To_OSWIN(item); OSWINOld.ID = OSWINNew.ID; OSWINOld.Family = OSWINNew.Family; OSWINOld.Zmode = OSWINNew.Zmode; OSWINOld.OS = OSWINNew.OS; OSWINOld.AV = OSWINNew.AV; OSWINOld.Image = OSWINNew.Image; OSWINOld.Editor = OSWINNew.Editor; OSWINOld.Cdt = OSWINNew.Cdt; OSWINOld.Udt = OSWINNew.Udt; iOSWINRepository.Update(OSWINOld, work); work.Commit(); } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(OSWIN)Update end, [item]:" + item); } }
public void Remove(OSWINInfo item) { logger.Debug("(OSWINOSWIN)Remove start, [item]:" + item); IMES.FisObject.Common.Model.OSWIN lstOSWIN = null; IUnitOfWork work = new UnitOfWork(); try { lstOSWIN = iOSWINRepository.Find(item.ID); if (lstOSWIN != null) { iOSWINRepository.Remove(lstOSWIN, work); } work.Commit(); } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(OSWIN)Remove end, [item]:" + item); } }
public OSWINInfo CheckExistOSWIN(string Family, string Zmod) { logger.Debug("(OSWIN)GetOSWINByZmode start"); OSWINInfo ret = new OSWINInfo(); try { IMES.FisObject.Common.Model.OSWIN OSWINInfo = new IMES.FisObject.Common.Model.OSWIN(); OSWINInfo = iOSWINRepository.GetOSWINByZmode(Family,Zmod); if (OSWINInfo != null) { ret = OSWIN_To_OSWINInfo(OSWINInfo); } } catch (Exception e) { logger.Error(e.Message); throw; } finally { logger.Debug("(OSWIN)GetOSWINByZmode end"); } return ret; }