Exemplo n.º 1
0
        public ActionResult NoticeEdit(Beauty.Model.Notice model)
        {
            if (ModelState.IsValid)
            {
                Notice notice = inotice.Get(model.ID);
                notice.Msg = model.Msg;
                bool result = inotice.Update(notice);
                if (result)
                {
                    return(RedirectToAction("notice"));
                }
            }

            return(View());
        }
Exemplo n.º 2
0
        public ActionResult NoticeCreate(Beauty.Model.Notice model)
        {
            if (string.IsNullOrEmpty(model.Msg))
            {
                ModelState.AddModelError("", "公告内容不能空");
            }

            if (ModelState.IsValid)
            {
                model.Type    = 0;
                model.Statues = 1;
                model.ID      = Guid.NewGuid();
                Guid id = inotice.Create(model);
                if (id == model.ID)
                {
                    return(RedirectToAction("notice"));
                }
            }

            return(View());
        }