示例#1
0
        public string LoadAdvisor(string advisorFriendlyName, string advisorVersion = "1")
        {
            AdvisorRequest advRequest = new AdvisorRequest();

            advRequest.FriendlyName  = advisorFriendlyName;
            advRequest.VersionNumber = int.Parse(advisorVersion);
            return(AdvStdService.LoadAdvisor(advRequest).SessionId);
        }
示例#2
0
        public IActionResult EditProfile([FromBody] AdvisorRequest advisorRequest)
        {
            if (!ModelState.IsValid)
            {
                return(StatusCode(400, "Invaild Adivor"));
            }
            var account = _mapper.Map <Account>(advisorRequest);

            _accountService.Update(account);

            return(StatusCode(200, new { message = "Update Success" }));
        }
 protected async Task <IActionResult> EditAdvisorAsync(int id, AdvisorRequest advisorRequest)
 {
     if (advisorRequest.ChangedPicture && RequestHasFile())
     {
         var fileExtension = GetValidPictureExtension();
         using (var stream = Request.Form.Files[0].OpenReadStream())
             return(Ok(await AdvisorBusiness.EditAdvisorAsync(id, advisorRequest.Name, advisorRequest.Description, true, stream, fileExtension)));
     }
     else
     {
         return(Ok(await AdvisorBusiness.EditAdvisorAsync(id, advisorRequest.Name, advisorRequest.Description, advisorRequest.ChangedPicture, null, null)));
     }
 }
示例#4
0
        protected virtual IActionResult Advisor(AdvisorRequest advisorRequest)
        {
            if (advisorRequest == null)
            {
                return(BadRequest());
            }

            Auctus.DomainObjects.Advisor.Advisor advisor;
            try
            {
                advisor = AdvisorServices.CreateAdvisor(GetUser(), advisorRequest.Name, advisorRequest.Description);
            }
            catch (ArgumentException ex)
            {
                return(BadRequest(new { error = ex.Message }));
            }
            return(Ok(new { id = advisor.Id }));
        }
示例#5
0
 public new async Task <IActionResult> EditAdvisorAsync(int id, [FromForm] AdvisorRequest advisorRequest)
 {
     return(await base.EditAdvisorAsync(id, advisorRequest));
 }
示例#6
0
 public new IActionResult Advisor([FromBody] AdvisorRequest advisorRequest)
 {
     return(base.Advisor(advisorRequest));
 }
示例#7
0
 public Task <AdvisorResponse> LoadAdvisorAsync(AdvisorRequest request)
 {
     throw new NotImplementedException();
 }
示例#8
0
 public AdvisorResponse LoadAdvisor(AdvisorRequest request)
 {
     throw new NotImplementedException();
 }