예제 #1
0
        public static ResponseDto ChangeProfile(ChangeProfileAgentBossRequest request)
        {
            request.mobile_number = Common.GetStandardMobileNumber(request.mobile_number);
            ResponseDto response  = new ResponseDto();
            AgentBoss   agentBoss = null;

            try
            {
                if (!AgentBossServices.CheckAgentBoss(request.user_id, request.auth_token, response))
                {
                    return(response);
                }
                using (AgentBossDao dao = new AgentBossDao())
                {
                    agentBoss           = dao.FindById(request.user_id);
                    agentBoss.OwnerName = request.agent_boss_name;
                    //agentBoss.MobileNumber = request.mobile_number;
                    //agentBoss.ProfileImage = request.profile_image; //Commented bcz image is uploading as multipart
                    agentBoss.Email = request.agent_boss_email;
                    dao.Update(agentBoss);
                    response.code         = 0;
                    response.has_resource = 1;
                    response.message      = MessagesSource.GetMessage("profile.changed");
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response.MakeExceptionResponse(ex);
                return(response);
            }
        }
        public NegotiatedContentResult <ResponseDto> PostChangeProfile([FromBody] ChangeProfileAgentBossRequest request)
        {
            ResponseDto resp = AgentBossServices.ChangeProfile(request);

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