protected void Add() { FaiInfo itcnd = new FaiInfo(); try { itcnd.fin_time = DateTime.Parse(this.TextBox4.Text); itcnd.rec_time = DateTime.Parse(this.TextBox13.Text); } catch (System.Exception ex) { showErrorMessage("Finish Time or Receipt Time ,"+ ex.Message); showList(); this.updatePanel2.Update(); ScriptManager.RegisterStartupScript(this.updatePanel, typeof(System.Object), "saveUpdate", "resetTableHeight();SaveUpdateComplete('" + this.TextBox1.Text + "');HideWait();", true); return; } itcnd.iecpn = this.TextBox1.Text; itcnd.sno = this.TextBox2.Text; itcnd.hpqpn = this.TextBox3.Text; itcnd.fin_time = DateTime.Parse(this.TextBox4.Text); itcnd.bios_typ = this.TextBox5.Text; itcnd.kbc_ver = this.TextBox6.Text; itcnd.vdo_bios = this.TextBox7.Text; itcnd.fdd_sup = this.TextBox8.Text; itcnd.hdd_sup = this.TextBox9.Text; itcnd.opt_sup = this.TextBox10.Text; itcnd.ng_record = this.TextBox11.Text; itcnd.imp_record = this.TextBox12.Text; itcnd.rec_time = DateTime.Parse(this.TextBox13.Text); itcnd.chk_stat = this.CmbCHKState.Value; itcnd.upc_code = this.TextBox15.Text; itcnd.ram_typ = this.TextBox16.Text; itcnd.bat_typ = this.TextBox17.Text; itcnd.editor = userName.Trim(); itcnd.cdt = DateTime.Now; itcnd.udt = DateTime.Now; try { //调用添加的方法 相同的key时需要抛出异常... iFAIInfoMaintain.AddFAIInfoMaintain(itcnd); } 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), "addUpdate", "resetTableHeight();AddUpdateComplete(\"" + this.TextBox1.Text + "\");HideWait();", true); }
public void UpdateFAIInfoMaintain(FaiInfo item, FaiInfo cond) { try { miscRepository.ModifyFaiInfo(item, cond); } catch (Exception ee) { logger.Error(ee.Message); throw ee; } }
public void AddFAIInfoMaintain(FaiInfo item) { try { miscRepository.AddFaiInfo(item); } catch (Exception ee) { logger.Error(ee.Message); throw ee; } }
public IList<FaiInfo> GetAllFAIInfoMaintainItems() { IList<FaiInfo> dataLst = new List<FaiInfo>(); try { FaiInfo cond = new FaiInfo (); dataLst = miscRepository.GetFaiInfoList(cond); } catch (Exception ee) { logger.Error(ee.Message); throw ee; } return dataLst; }
protected void btnSave_ServerClick(object sender, EventArgs e) { IList<FaiInfo> dataLst = new List<FaiInfo>(); dataLst = iFAIInfoMaintain.GetAllFAIInfoMaintainItems(); HOperation.Value = "add"; if (dataLst != null && dataLst.Count != 0) { foreach (FaiInfo temp in dataLst) { if (temp.iecpn == this.TextBox1.Text) { HOperation.Value = "save"; break; } } } if (HOperation.Value == "save") { FaiInfo itcnd = new FaiInfo(); itcnd.sno = this.TextBox2.Text; itcnd.hpqpn = this.TextBox3.Text; try { itcnd.fin_time = DateTime.Parse(this.TextBox4.Text); itcnd.rec_time = DateTime.Parse(this.TextBox13.Text); } catch (System.Exception ex) { showErrorMessage("Finish Time or Receipt Time ," + ex.Message); showList(); this.updatePanel2.Update(); ScriptManager.RegisterStartupScript(this.updatePanel, typeof(System.Object), "saveUpdate", "resetTableHeight();SaveUpdateComplete('" + this.TextBox1.Text + "');HideWait();", true); return; } itcnd.bios_typ = this.TextBox5.Text; itcnd.kbc_ver = this.TextBox6.Text; itcnd.vdo_bios = this.TextBox7.Text; itcnd.fdd_sup = this.TextBox8.Text; itcnd.hdd_sup = this.TextBox9.Text; itcnd.opt_sup = this.TextBox10.Text; itcnd.ng_record = this.TextBox11.Text; itcnd.imp_record = this.TextBox12.Text; itcnd.rec_time = DateTime.Parse(this.TextBox13.Text); itcnd.chk_stat = this.CmbCHKState.Value; itcnd.upc_code = this.TextBox15.Text; itcnd.ram_typ = this.TextBox16.Text; itcnd.bat_typ = this.TextBox17.Text; itcnd.udt = DateTime.Now; FaiInfo cond = new FaiInfo(); cond.iecpn = this.TextBox1.Text; try { //调用添加的方法 相同的key时需要抛出异常... iFAIInfoMaintain.UpdateFAIInfoMaintain(itcnd, cond); } catch (FisException fex) { showErrorMessage(fex.mErrmsg); } catch (System.Exception ex) { showErrorMessage(ex.Message); } showList(); this.updatePanel2.Update(); ScriptManager.RegisterStartupScript(this.updatePanel, typeof(System.Object), "saveUpdate", "resetTableHeight();SaveUpdateComplete('" + this.TextBox1.Text + "');HideWait();", true); } else { Add(); } }