private void BtnEmployees_Click(object sender, EventArgs e) { EmployeesGUI employeesGUI = EmployeesGUI.Instance; Nav(employeesGUI, content); RecolorButtons(); BtnEmployees.BackColor = Color.DarkGray; employeesGUI.AddDataToTable(); }
public async Task <bool> Delete(int id) { employeesGUI = EmployeesGUI.Instance; bool res = false; bCtrl = new BaseController(); using (var client = bCtrl.GetClient()) { var response = await client.DeleteAsync(bCtrl.BaseUrl + "employees/" + id); string result = response.Content.ReadAsStringAsync().Result; res = true; employeesGUI.AddDataToTable(); return(res); } }
public void CleanSession() { DashboardGUI dGUI = DashboardGUI.Instance; VenuesGUI vGUI = VenuesGUI.Instance; EmployeesGUI eGUI = EmployeesGUI.Instance; TablesGUI tGUI = TablesGUI.Instance; TablePackagesGUI tpGUI = TablePackagesGUI.Instance; vGUI.DeleteDataFromTable(); eGUI.DeleteDataFromTable(); tGUI.DeleteDataFromTable(); tpGUI.DeleteDataFromTable(); vGUI.DeleteDataFromTable(); dGUI = null; }
public async Task <bool> Create(Employee employee, Venue venue) { employeesGUI = EmployeesGUI.Instance; bool res = false; bCtrl = new BaseController(); var root = new { Employee = employee, Venue = venue }; var json = JsonConvert.SerializeObject(root); var data = new StringContent(json, Encoding.UTF8, "application/json"); using (var client = bCtrl.GetClient()) { var response = await client.PostAsync(bCtrl.BaseUrl + "employees/", data); string result = response.Content.ReadAsStringAsync().Result; res = true; } employeesGUI.AddDataToTable(); return(res); }