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, "StudentStarModify" + PrimaryKey);
                return;
            }

            DateTime tempHappenDate = lModel.HappenDate;
            this.LModel = MakeUtil.getRequestDataToModel<StudentStarModel>(Request, typeof(StudentStarModel), -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 = _studentStarEbi.getModel(qmList);
         if (this.lModel.Evenid <= 0)
         {
             Response.Redirect("WX_SchoolStudentStar.aspx");
         }
         this.DataBind();
     }
 }
 protected void ImageBtnSave_Click(object sender, EventArgs e)
 {
     this.lModel = MakeUtil.getRequestDataToModel<StudentStarModel>(Request, typeof(StudentStarModel), -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();
     }
 }
Exemplo n.º 4
0
        public void add(StudentStarModel studentstar)
        {
            SqlConnection cn = null;
            SqlTransaction tc = null;
            try
            {
                cn = DbHelperSQL.getConnection();
                tc = DbHelperSQL.startTransaction(cn);

                //执行新增写进数据库
            studentstarDal.add(cn, tc, studentstar);

                DbHelperSQL.commitTransaction(tc);
            }
            catch (Exception dalEx)
            {
                DbHelperSQL.rollBackTransaction(tc);
                throw new MakeException(ExpSort.数据库, dalEx.Message);
            }
            finally
            {
                DbHelperSQL.closeConnection(cn);
            }
        }
Exemplo n.º 5
0
 public bool update(SqlConnection cn, SqlTransaction tc, StudentStarModel model)
 {
     return DbHelperSQL.updateModel<StudentStarModel>(model, "StudentStar", "Evenid", model.Evenid.ToString(), "'", cn, tc);
 }
Exemplo n.º 6
0
 public bool add(SqlConnection cn, SqlTransaction tc, StudentStarModel model)
 {
     return DbHelperSQL.insertModel<StudentStarModel>(model, "StudentStar", cn, tc);
 }
 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, "StudentStarModify" + PrimaryKey);
             return;
         }
         Remarks.Text = lModel.Remarks;
         this.DataBind();
     }
 }