Ejemplo n.º 1
0
        public ActionResult Edit(string id)
        {
            long      idParse;
            WebVedios model = new WebVedios();

            if (long.TryParse(id, out idParse))
            {
                model = webVediosBll.GetModelById(idParse);
            }
            return(View(model));
        }
Ejemplo n.º 2
0
        public AjaxResult Edit(WebVedios model, long @operator)
        {
            AjaxResult result     = new AjaxResult();
            var        procResult = dal.Edit(model, @operator);

            result.flag = procResult.IsSuccess;
            if (result.flag)
            {
                result.message = "修改成功!";
            }
            else
            {
                result.message = procResult.ProcMsg;
            }
            return(result);
        }
Ejemplo n.º 3
0
        public AjaxResult Add(WebVedios model)
        {
            AjaxResult result     = new AjaxResult();
            var        procResult = dal.Add(model);

            result.flag = procResult.IsSuccess;
            if (result.flag)
            {
                result.message = "新增成功!";
            }
            else
            {
                result.message = procResult.ProcMsg;
            }
            return(result);
        }
Ejemplo n.º 4
0
        public ProcResult Add(WebVedios model)
        {
            ProcResult result = new ProcResult();

            try
            {
                db.WebVedios.Add(model);
                result.IsSuccess = db.SaveChanges() > 0;
            }
            catch (Exception ex)
            {
                result.ProcMsg = ex.InnerException.Message;
                LogUtil.Exception("ExceptionLogger", ex);
            }
            return(result);
        }
Ejemplo n.º 5
0
        public ProcResult Edit(WebVedios model, long currentOperator)
        {
            ProcResult result = new ProcResult();

            try
            {
                model.Creator    = currentOperator;
                model.CreateTime = DateTime.Now;
                db.WebVedios.Attach(model);
                db.Entry(model).State = System.Data.Entity.EntityState.Modified;
                result.IsSuccess      = db.SaveChanges() > 0;
                return(result);
            }
            catch (Exception ex)
            {
                result.ProcMsg = ex.InnerException.Message;
                LogUtil.Exception("ExceptionLogger", ex);
            }
            return(result);
        }
Ejemplo n.º 6
0
        public ProcResult Auditor(WebVedios model, long auditor)
        {
            ProcResult result = new ProcResult();

            try
            {
                var entity = GetModelById(model.ID);
                if (entity != null)
                {
                    entity.Auditor   = auditor;
                    entity.AuditTime = DateTime.Now;
                }
                db.Entry <WebVedios>((WebVedios)entity).State = System.Data.Entity.EntityState.Modified;
                result.IsSuccess = db.SaveChanges() > 0;
            }
            catch (Exception ex)
            {
                result.ProcMsg = ex.InnerException.Message;
                LogUtil.Exception("ExceptionLogger", ex);
            }
            return(result);
        }
Ejemplo n.º 7
0
        public ActionResult Edit(WebVedios model)
        {
            var currentUser = HttpContext.Session[Constants.USER_KEY] as USP.Models.POCO.User;

            model.Creator    = currentUser.SysOperator.ID;
            model.CreateTime = DateTime.Now;
            model.Auditor    = null;
            model.AuditTime  = null;
            if (ModelState.IsValid)
            {
                var result = webVediosBll.Edit(model, currentUser.SysOperator.ID);
                if (result.flag)
                {
                    TempData["isSuccess"]   = "true";
                    TempData["MessageInfo"] = "完善信息成功!";
                    return(View("Index"));
                }
            }
            TempData["isSuccess"]   = "false";
            TempData["MessageInfo"] = "完善信息失败!";
            return(View(model));
        }
Ejemplo n.º 8
0
        public ActionResult Add(WebVedios model)
        {
            var currentUser = HttpContext.Session[Constants.USER_KEY] as USP.Models.POCO.User;

            if (ModelState.IsValid)
            {
                model.CreateTime = DateTime.Now;
                model.Creator    = currentUser.SysOperator.ID;
                AjaxResult result = webVediosBll.Add(model);
                if (result.flag)
                {
                    TempData["returnMsgType"] = "success";
                    TempData["returnMsg"]     = "添加成功";
                    return(View("Index"));
                }
                else
                {
                    TempData["returnMsgType"] = "error";
                    TempData["returnMsg"]     = result.message;
                }
            }
            return(View(model));
        }