Exemple #1
0
        public static ResponseDto ChangeProfile(ChangeProfileAgentAdminRequest request)
        {
            request.mobile_number = Common.GetStandardMobileNumber(request.mobile_number);
            ResponseDto response = new ResponseDto();
            AgentAdmin  admin    = null;

            try
            {
                if (!AgentAdminServices.CheckAdmin(request.user_id, request.auth_token, response))
                {
                    return(response);
                }
                using (AgentAdminDao dao = new AgentAdminDao())
                {
                    admin = dao.FindById(request.user_id);
                    admin.AgentAdminName = request.agent_admin_name;
                    //admin.MobileNumber = request.mobile_number;
                    //admin.ProfileImage = string.IsNullOrWhiteSpace(request.profile_image) ? admin.ProfileImage : request.profile_image; //Commented bcz image is uploading as multipart
                    admin.email = request.agent_admin_email;
                    dao.Update(admin);
                    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 static void CopyToEntity(AgentAdmin agent, ChangeProfileAgentAdminRequest request)
 {
     agent.ProfileImage   = request.profile_image; // user_id, auth_token
     agent.MobileNumber   = request.mobile_number;
     agent.AgentAdminName = request.agent_admin_name;
 }
        public NegotiatedContentResult <ResponseDto> PostChangeProfile([FromBody] ChangeProfileAgentAdminRequest request)
        {
            ResponseDto resp = AgentAdminServices.ChangeProfile(request);

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