public static ResponseDto ChangeProfile(ChangeProfileSuperUserRequest request)
        {
            request.mobile_number = Common.GetStandardMobileNumber(request.mobile_number);
            ResponseDto response  = new ResponseDto();
            SuperAdmin  superuser = null;

            try
            {
                if (!SuperUserServices.CheckSuperUser(request.user_id, request.auth_token, response))
                {
                    response.message = MessagesSource.GetMessage("invalid.super.user");
                    return(response);
                }
                using (SuperUserDao dao = new SuperUserDao())
                {
                    superuser          = dao.FindById(request.user_id);
                    superuser.FullName = request.super_user_name;
                    //superuser.MobileNum = request.mobile_number;
                    //superuser.ProfileImage = request.profile_image;//Commented bcz image is uploading as multipart
                    superuser.Email = request.super_user_email;
                    dao.Update(superuser);
                    response.code         = 0;
                    response.has_resource = 0;
                    response.message      = MessagesSource.GetMessage("profile.changed");
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
                return(response);
            }
        }
Exemple #2
0
        public NegotiatedContentResult <ResponseDto> PostChangeProfile([FromBody] ChangeProfileSuperUserRequest request)
        {
            ResponseDto resp = SuperUserServices.ChangeProfile(request);

            return(Content(HttpStatusCode.OK, resp));
        }