public ActionResult Edit(int?Id)
        {
            var DocumentType = DocumentTypeRepository.GetDocumentTypeById(Id.Value);

            if (DocumentType != null && DocumentType.IsDeleted != true)
            {
                var model = new DocumentTypeViewModel();
                AutoMapper.Mapper.Map(DocumentType, model);

                //if (model.CreatedUserId != Erp.BackOffice.Helpers.Common.CurrentUser.Id && Erp.BackOffice.Helpers.Common.CurrentUser.UserTypeId != 1)
                //{
                //    TempData["FailedMessage"] = "NotOwner";
                //    return RedirectToAction("Index");
                //}

                return(View(model));
            }
            if (Request.UrlReferrer != null)
            {
                return(Redirect(Request.UrlReferrer.AbsoluteUri));
            }
            return(RedirectToAction("Index"));
        }