Exemplo n.º 1
0
        public async Task <AddCompanyResponse> AddCompany(AddNewCompany company)
        {
            try {
                var MappedCompany = Mapper.MapProperties <TblStockCompany>(company);
                await _unitofwork.StockCompanies.AddAsync(MappedCompany);

                return(new AddCompanyResponse {
                    ResponseCode = "00", ResponseMessage = "success"
                });
            }
            catch (Exception ex)
            {
                _logWriter.LogWrite("Message: " + ex.Message + Environment.NewLine + "InnerException: " + ex.InnerException + Environment.NewLine + "StackTrace: " + ex.StackTrace);

                return(new AddCompanyResponse {
                    ResponseCode = "99", ResponseMessage = ex.Message
                });
            }
        }
 public async Task <AddCompanyResponse> AddStockCompany(AddNewCompany company)
 {
     return(await _stockCompanyService.AddCompany(company));
 }