예제 #1
0
        public ActionResult PostEdit(Notice model)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                Notice entity = db.T_Notice.Find(model.Id);
                entity.Des = model.Des;
                entity.ImgUrl = model.ImgUrl;
                entity.Title = model.Title;
                entity.State = model.State;
                entity.LinkSocSerUrl = model.LinkSocSerUrl;
                entity.UploadHtmlFile = model.UploadHtmlFile;
                // entity.AddTime = DateTime.Now;
                db.Update(entity);
                db.SaveChanges();

            }
            return Success("添加成功");
        }
예제 #2
0
        public ActionResult PostAdd(Notice entity)
        {
            entity.DepId = AdminUser.DeptId;
            entity.AddUser = AdminUser.UserName;

            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                entity.AddTime = DateTime.Now;
                db.Add(entity);
                db.SaveChanges();

            }
            return Success("添加成功");
        }