protected void ImageBtnSave_Click(object sender, EventArgs e) { try { IList<QueryModel> qmList = new List<QueryModel>(); qmList.Add(MakeUtil.getQueryModel("Evenid", "'", SqlWhere.WhereOperator.Equal, this.PrimaryKey)); this.lModel = _ebi.getModel(qmList); if (this.lModel.Evenid <= 0) { Script.alertMsg("没找此资料", this.Page); Script.closeDivWin(this.Page, "SchoolActiveModify" + PrimaryKey); return; } DateTime tempHappenDate = lModel.HappenDate; this.LModel = MakeUtil.getRequestDataToModel<SchoolActiveModel>(Request, typeof(SchoolActiveModel), -1); if (lModel.Remarks.Trim() == "") { Script.alertMsg("查看全文内容不能为空,保存失败", Page); this.DataBind(); return; } LModel.HappenDate = tempHappenDate; _ebi.update(this.LModel); MakeUtil.addOperationNote(Request.UserHostAddress, UserId.Value.Trim(), "学校动态修改", lModel.Evenid.ToString()); Script.alertMsg("修改成功", Page); Script.scriptRedirect(Request.RawUrl, this.Page); } catch (Make.Exp.MakeException mEx) { Script.alertMsg(mEx.Message, this.Page); this.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { IList<QueryModel> qmList = new List<QueryModel>(); qmList.Add(MakeUtil.getQueryModel("Evenid", "'", SqlWhere.WhereOperator.Equal, this.PrimaryKey)); this.lModel = _schoolActiveEbi.getModel(qmList); if (this.lModel.Evenid <= 0) { Response.Redirect("WX_SchoolActive.aspx"); } this.DataBind(); } }
protected void ImageBtnSave_Click(object sender, EventArgs e) { this.lModel = MakeUtil.getRequestDataToModel<SchoolActiveModel>(Request, typeof(SchoolActiveModel), -1); if (lModel.Remarks.Trim() == "") { Script.alertMsg("查看全文内容不能为空,保存失败", Page); this.DataBind(); return; } try { lModel.HappenDate = DateTime.Now; _ebi.add(lModel); MakeUtil.addOperationNote(Request.UserHostAddress, userid.Trim(), "学校动态新增", lModel.Headlines); Script.alertMsg("新增成功", Page); Script.scriptRedirect(Request.RawUrl, this.Page); } catch (Make.Exp.MakeException mEx) { Script.alertMsg(mEx.Message, this.Page); this.DataBind(); } }
public void add(SchoolActiveModel schoolactive) { SqlConnection cn = null; SqlTransaction tc = null; try { cn = DbHelperSQL.getConnection(); tc = DbHelperSQL.startTransaction(cn); //执行新增写进数据库 schoolactiveDal.add(cn, tc, schoolactive); DbHelperSQL.commitTransaction(tc); } catch (Exception dalEx) { DbHelperSQL.rollBackTransaction(tc); throw new MakeException(ExpSort.数据库, dalEx.Message); } finally { DbHelperSQL.closeConnection(cn); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { IList<QueryModel> qmList = new List<QueryModel>(); qmList.Add(MakeUtil.getQueryModel("Evenid", "'", SqlWhere.WhereOperator.Equal, this.PrimaryKey)); this.lModel = _ebi.getModel(qmList); if (this.lModel.Evenid <= 0) { Script.alertMsg("没找此资料", this.Page); Script.closeDivWin(this.Page, "SchoolActiveModify" + PrimaryKey); return; } Remarks.Text = lModel.Remarks; this.DataBind(); } }
public bool update(SqlConnection cn, SqlTransaction tc, SchoolActiveModel model) { return DbHelperSQL.updateModel<SchoolActiveModel>(model, "SchoolActive", "Evenid", model.Evenid.ToString(), "'", cn, tc); }
public bool add(SqlConnection cn, SqlTransaction tc, SchoolActiveModel model) { return DbHelperSQL.insertModel<SchoolActiveModel>(model, "SchoolActive", cn, tc); }