Пример #1
0
        public ActionResult PostAdd(WebLoveShow model)
        {
            #region 初始化参数

            model.AddUserId = AdminUser.ID;
            model.DeptId = AdminUser.DeptId;
            model.AddTime = DateTime.Now;
            model.State = RowState.有效;

            #endregion

            using (LoveBankDBContext db = new LoveBankDBContext())
            {
                db.Add(model);
                db.SaveChanges();

                return Success("添加成功");
            }
        }
Пример #2
0
        public ActionResult PostEdit(WebLoveShow parm)
        {
            using (LoveBankDBContext db = new LoveBankDBContext())
            {

                var t_wsn = db.T_WebLoveShow;
                WebLoveShow model = t_wsn.Find(parm.ID);
                model.Sort = parm.Sort;

                model.Title = parm.Title;
                model.Content = parm.Content;

                db.Update(model);
                db.SaveChanges();

                return Success("修改成功");
            }
        }