public static Models.Client ConvertToDal(Shared.Client model) { return(new Models.Client { LastName = model.LastName, FirstName = model.FirstName, Id = model.Id }); }
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; }
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)); }
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); } }
private static async Task <ReportItem> reportViaClient(string requestUri, ReportItem reportItem, HttpClient httpClient) { var apiClient = new Shared.Client(requestUri, httpClient); return(await apiClient.PostReportItemAsync(reportItem)); }