private void SetBinding(ProjectItem[] projects) { projectsBinding.DataSource = projects; cboProjekt.DataSource = projectsBinding; cboProjekt.DisplayMember = "Name"; cboProjekt.ValueMember = "Id"; }
public static async Task<CreateProjectResult> DeleteProject(ProjectItem project) { var handler = SessionStore.GetInstance().GetHttpClientHandlerWithSID(); using (var client = new HttpClient(handler)) { client.BaseAddress = new Uri(serviceUrl); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); var response = await client.DeleteAsync(string.Format("/api/project/{0}", project.Id)); response.EnsureSuccessStatusCode(); return await response.Content.ReadAsAsync<CreateProjectResult>(); } }