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)
         {
             Response.Redirect("WX_SchoolClassActice.aspx");
         }
         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 = _ebi.getModel(qmList);
         if (this.lModel.Evenid <= 0)
         {
             Script.alertMsg("没找此资料", this.Page);
             return;
         }
         this.DataBind();
     }
 }
    protected void ImageBtnSave_Click(object sender, EventArgs e)
    {
        IList<QueryModel> qmList = new List<QueryModel>();
        qmList.Add(MakeUtil.getQueryModel("UserID", "'", SqlWhere.WhereOperator.Equal, userid));
        var usermodel = _usersEbi.getModel(qmList);
        if (usermodel.Evenid <= 0)
        {
            Script.alertMsg("登录超时,请重新登录!", Page);
            return ;
        }
        this.lModel = MakeUtil.getRequestDataToModel<ClassActiceModel>(Request, typeof(ClassActiceModel), -1);
        if (lModel.Headlines.Trim() == "")
        {
            Script.alertMsg("内容不能为空,保存失败", Page);
            this.DataBind();
            return;
        }
        if (lModel.Banji.Trim() == "")
        {
            Script.alertMsg("班级不能为空,保存失败", Page);
            this.DataBind();
            return;
        }
        try
        {
            lModel.HappenDate = DateTime.Now;
            lModel.MakeMan = usermodel.UserName;
            lModel.MakeManNo = usermodel.UserID;
            lModel.MakeManType = 0;

            _ebi.add(lModel);
            MakeUtil.addOperationNote(Request.UserHostAddress, userid.Trim(), "班级动态新增", lModel.Headlines);
            Helper.WxSendNoticeTextToClass(Helper.ModelType.BanJiDongTai, lModel.SchoolNo, lModel.Banji);
            Script.alertMsg("新增成功", Page);
            Script.scriptRedirect(Request.RawUrl, this.Page);
        }
        catch (Make.Exp.MakeException mEx)
        {
            Script.alertMsg(mEx.Message, this.Page);
            this.DataBind();
        }
    }
예제 #4
0
        public void add(ClassActiceModel classactice)
        {
            SqlConnection cn = null;
            SqlTransaction tc = null;
            try
            {
                cn = DbHelperSQL.getConnection();
                tc = DbHelperSQL.startTransaction(cn);

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

                DbHelperSQL.commitTransaction(tc);
            }
            catch (Exception dalEx)
            {
                DbHelperSQL.rollBackTransaction(tc);
                throw new MakeException(ExpSort.数据库, dalEx.Message);
            }
            finally
            {
                DbHelperSQL.closeConnection(cn);
            }
        }
예제 #5
0
 public bool update(SqlConnection cn, SqlTransaction tc, ClassActiceModel model)
 {
     return DbHelperSQL.updateModel<ClassActiceModel>(model, "ClassActice", "Evenid", model.Evenid.ToString(), "'", cn, tc);
 }
예제 #6
0
 public bool add(SqlConnection cn, SqlTransaction tc, ClassActiceModel model)
 {
     return DbHelperSQL.insertModel<ClassActiceModel>(model, "ClassActice", cn, tc);
 }