Esempio n. 1
0
        public BasicResponse AddAccount(AccountDTO dto)
        {
            BasicResponse response = new BasicResponse();
               try
               {
               var account = new Account()
                                 {
                                     Name = dto.Name,
                                     Id = dto.Id,
                                     IsActive = true,
                                     CreatedOn = DateTime.Now,
                                     UpdatedOn = DateTime.Now,
                                 };

               _accountRepository.Save(account);
               response.Status = true;
               response.Info = "Success";

               }
               catch (Exception ex)
               {

               response.Status = false;
               response.Info = ex.Message;
               }
               return response;
        }
Esempio n. 2
0
        protected Guid GetAccountId()
        {
            if ( AccountNo == Guid.Empty)
               {
               string urlSuffix = "api/phone/masterdata/addaccount";
               HttpClient client = Client();

               client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
               Guid accountId = Guid.NewGuid();
               AccountDTO dto = new AccountDTO()
                                    {
                                        Name = Guid.NewGuid().ToString(),
                                        Id = accountId,
                                        IsActive = true,
                                    };
               var response = client.PostAsJsonAsync("api/phone/masterdata/addaccount", dto);
               var _response = response.Result;
               AccountNo = accountId;

               }

               return AccountNo;
        }
 public BasicResponse AddAccount(AccountDTO account)
 {
     var all = _dataTransferBuilder.AddAccount(account);
     return all;
 }