Ejemplo n.º 1
0
        public InsertThirdPartyClientResponse  AddThirdPartyClient(InsertThirdPartyClientRequest request)
        {
            InsertThirdPartyClientResponse response = new InsertThirdPartyClientResponse();
            ThirdPartyClient thirdPartyClient       = Mapper.Map <ThirdPartyClientViewModel, ThirdPartyClient>(request.ThirdPartyClientViewModel);

            thirdPartyClientRepository.AddThirdPartyClient(thirdPartyClient);
            return(response);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Inserts the API keys.
        /// </summary>
        /// <param name="apiKeys">The API keys.</param>
        /// <returns></returns>
        public ActionResult InsertApiKeys(string apiKeys)
        {
            int userID = UserExtensions.ToUserID(this.Identity);
            ThirdPartyClientViewModel thirdPartyClientViewmodel = JsonConvert.DeserializeObject <ThirdPartyClientViewModel>(apiKeys);

            thirdPartyClientViewmodel.LastUpdatedBy = userID;
            thirdPartyClientViewmodel.LastUpdatedOn = DateTime.Now.ToUniversalTime();
            InsertThirdPartyClientResponse response = thirdPartyClientService.AddThirdPartyClient(new InsertThirdPartyClientRequest()
            {
                RequestedBy = userID,
                ThirdPartyClientViewModel = thirdPartyClientViewmodel
            });

            return(Json(new
            {
                success = true,
                response = response
            }, JsonRequestBehavior.AllowGet));
        }