Ejemplo n.º 1
0
        public ActionResult Modify(M_Users User)
        {
            object result = "";

            try
            {
                B_Users bUser   = new B_Users();
                var     oldUser = bUser.GetUsers(User.Id);
                if (oldUser.ImageName.ToLower() != "default.jpg" && oldUser.ImageName.ToLower() != User.ImageName)
                {
                    System.IO.File.Delete(Server.MapPath("~/Areas/Admin/Images/Profile") + "/" + oldUser.ImageName);
                }
                bUser.Edit(User);
                result = "Success";
            }
            catch (Exception ex)
            {
                M_SystemLog exx = new M_SystemLog(E_SystemType.SHAHRDARI_WEB_APPLICATION, E_LogType.ERROR, ex);
                result = "Error";
                if (ex.Source == E_LogType.SYSTEM_ERROR.ToString())
                {
                    exx.LogType = E_LogType.SYSTEM_ERROR;
                    result      = exx;
                }
                L_Log.SubmitLog(exx);
            }
            return(Json(result));
        }
Ejemplo n.º 2
0
        public ActionResult Modify(int Id)
        {
            ViewBag.Route = new List <MFRoute>
            {
                new MFRoute {
                    ActionName = "Index", ControllerName = "Users", Title = "لیست کاربران", Priority = 1
                }
            };
            B_Users bUser = new B_Users();
            var     user  = bUser.GetUsers(Id);

            if (user == null || user.Id == CurrentUser.Id)
            {
                return(RedirectToAction("Index"));
            }
            ViewBag.AnistetoType = new B_PublicCategory().GetPublicCategory(E_PublicCategory.PUBLIC_CATEGORY_PARENT.INSTITUTE_TYPE);
            return(View(user));
        }