Example #1
0
        public ActionResult ChannelEdit(MobileChannel model)
        {
            var channel = dbContextService.Single <MobileChannel>(model.Id);

            channel.Name           = model.Name;
            channel.Value          = channel.Value;
            channel.Status         = model.Status;
            channel.Comment        = model.Comment;
            channel.CreateDateTime = DateTime.Now;

            dbContextService.Update <MobileChannel>(channel);
            return(RedirectToAction("ChannelList"));
        }
Example #2
0
        public ActionResult ChannelAdd(MobileChannel model)
        {
            var exist = dbContextService.Exists <MobileChannel>(x => x.Value == model.Value);

            if (exist)
            {
                TempData["errorMsg"] = "该渠道已经存在!";
                return(View());
            }
            var ret = dbContextService.Add <MobileChannel>(model);

            return(RedirectToAction("ChannelList"));
        }