public ActionResult Save(DispatchStatusEntity model)
        {
            var entity = new DispatchStatusEntity();

            //if (ModelState.IsValid)
            //{
            if (model.Id > 0)
            {
                var sess = SessionSystem.GetUser();
                Logs.logs("Sửa Tình trạng công văn", "Truy cập vào trang DispatchStatus", "/DispatchStatus/CreateDispatchStatus", sess.UserId);
                entity = _ipldispatchstatus.ViewDetail(model.Id);

                if (entity != null && entity.Id > 0)
                {
                    entity.Name = model.Name;

                    var retVal = _ipldispatchstatus.Update(entity);
                    if (retVal)
                    {
                        return(RedirectToAction("Index", "DispatchStatus"));
                    }
                }
            }
            else
            {
                var sess = SessionSystem.GetUser();
                Logs.logs("Thêm Tình trạng công văn", "Truy cập vào trang DispatchStatus", "/DispatchStatus/CreateDispatchStatus", sess.UserId);
                model.CreateDate = DateTime.Now;
                var empId = _ipldispatchstatus.Insert(model);
                if (empId > 0)
                {
                    return(RedirectToAction("Index", "DispatchStatus", new { id = empId }));
                }
            }
            //}
            ViewBag.Msg = ConstantMsg.ErrorProgress;
            return(View("DispatchStatus", model));
        }
 //[AuthorizeUser(ModuleName = "Department", AccessLevel = Constants.Add)]
 public ActionResult CreateDispatchStatus(DispatchStatusEntity entity)
 {
     return(View(entity));
 }