/// <summary> /// 增加一条数据 /// </summary> public int Add(Hi.Model.SYS_Industry model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Hi.Model.SYS_Industry model) { return(dal.Update(model)); }
protected void btnAdd_Click(object sender, EventArgs e) { Hi.Model.SYS_Industry industry = null; if (string.IsNullOrEmpty(txtInduName.Value.Trim())) { JScript.AlertMsg(this, "行业分类名称不能为空!"); return; } if (KeyID != 0) { industry = new Hi.BLL.SYS_Industry().GetModel(KeyID); industry.InduName = Common.NoHTML(txtInduName.Value.Trim()); industry.SortIndex = Common.NoHTML(txtSort.Value.Trim()); if (this.rdoStatus1.Checked) { industry.IsEnabled = 0; } else { industry.IsEnabled = 1; } industry.InduCode = "0"; industry.ts = DateTime.Now; industry.modifyuser = UserID; if (new Hi.BLL.SYS_Industry().Update(industry)) { //JScript.AlertMsgMo(this, "操作成功", "function(){ window.location.href='IndustryInfo.aspx?KeyID=" + KeyID + "'; }"); Response.Redirect("IndustryInfo.aspx?KeyID=" + KeyID); } } else { industry = new Hi.Model.SYS_Industry(); industry.InduName = Common.NoHTML(txtInduName.Value.Trim()); industry.SortIndex = Common.NoHTML(txtSort.Value.Trim()); if (this.rdoStatus1.Checked) { industry.IsEnabled = 0; } else { industry.IsEnabled = 1; } //标准参数 industry.CreateDate = DateTime.Now; industry.CreateUserID = UserID; industry.ts = DateTime.Now; industry.modifyuser = UserID; int newuserid = 0; newuserid = new Hi.BLL.SYS_Industry().Add(industry); if (newuserid > 0) { Response.Redirect("IndustryInfo.aspx?KeyID=" + newuserid); } } }