//更新
 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
 {
     Entity.ParentMessageEntity model = new Entity.ParentMessageEntity();
     model         = new Daiv_OA.BLL.ParentMessageBLL().GetEntity(Str2Int(q("id"), 0));
     model.Mtitle  = this.Mtitle.Text;
     model.Content = this.Content.Text;
     new Daiv_OA.BLL.ParentMessageBLL().Update(model);
     logHelper.logInfo("修改班级成功!操作人:" + UserId);
     FinalMessage("操作成功", "ParentMessage_List.aspx", 0);
 }
        //添加
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            Entity.ParentMessageEntity parentMessageEntity = new Entity.ParentMessageEntity();
            parentMessageEntity.Mtitle  = this.Mtitle.Text;
            parentMessageEntity.Content = this.Content.Text;
            parentMessageEntity.ToUid   = UserId;
            parentMessageEntity.FromUid = UserId;
            parentMessageEntity.Addtime = DateTime.Now;
            //获取用户实体
            Entity.UserEntity userEntity = new Daiv_OA.BLL.UserBLL().GetEntity(UserId);
            //获取学生信息
            Entity.StudentEntity stuEntity = new Daiv_OA.BLL.StudentBLL().GetEntityByNumber(userEntity.Uname);
            if (stuEntity != null)
            {
                parentMessageEntity.Touser = stuEntity.Sname;
            }
            int i = new Daiv_OA.BLL.ParentMessageBLL().Add(parentMessageEntity);

            if (i > 0)
            {
                logHelper.logInfo("添加留言成功!");
                FinalMessage("操作成功", "ParentMessage_List.aspx", 0);
            }
        }
示例#3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Entity.ParentMessageEntity model)
 {
     dal.Update(model);
 }
示例#4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Entity.ParentMessageEntity model)
 {
     return(dal.Add(model));
 }