예제 #1
0
 public static Models.Client ConvertToDal(Shared.Client model)
 {
     return(new Models.Client
     {
         LastName = model.LastName,
         FirstName = model.FirstName,
         Id = model.Id
     });
 }
예제 #2
0
 public ClientWindow(Form callback, Shared.Client client)
 {
     InitializeComponent();
     this.callback     = callback;
     this.client       = client;
     this.label6.Text  = client.cpf.ToString();
     this.label7.Text  = client.Name;
     this.label8.Text  = client.phone.ToString();
     this.label9.Text  = client.email;
     this.label10.Text = client.address;
 }
예제 #3
0
        public async Task <Shared.Client> CreateUser(Shared.Client user)
        {
            await _AirTechContext.Client.AddAsync(ConvertToDal(user));

            await _AirTechContext.SaveChangesAsync();

            List <Models.Client> clients = _AirTechContext.Client.OrderByDescending(t => t.Id).ToList();

            Models.Client final = clients.FirstOrDefault <Models.Client>();
            return(ConvertToEndPoint(final));
        }
예제 #4
0
 public async Task <Shared.Client> AddUser([FromBody] Shared.Client user)
 {
     try
     {
         return(await _dao.CreateUser(user));
     }
     catch (Exception e)
     {
         Console.Error.WriteLine(e.ToString());
         return(null);
     }
 }
예제 #5
0
        private static async Task <ReportItem> reportViaClient(string requestUri, ReportItem reportItem, HttpClient httpClient)
        {
            var apiClient = new Shared.Client(requestUri, httpClient);

            return(await apiClient.PostReportItemAsync(reportItem));
        }