public void SetDetails(clsAllComponents prComponent) { _Component = prComponent; txtType.Enabled = false; updateForm(); ShowDialog(); }
private async void UpdateOrderLabels() { clsOrder Order = await ServiceClient.GetOrderDetailsAsync(Convert.ToInt32(lstOrders.SelectedValue)); lblCustomerName.Text = Order.CustomerName.ToString(); lblCustomerEmail.Text = Order.CustomerEmail.ToString(); lblQuantity.Text = Order.Quantity.ToString(); lblTotal.Text = Order.Total.ToString(); clsAllComponents lccomponent = await ServiceClient.GetComponentDetails(Order.tblProductID); lblProductName.Text = lccomponent.Name; lblBrand.Text = lccomponent.Brand; // lblWarranty.Text = Convert.ToString(lccomponent.Warranty); lblType.Text = lccomponent.Type; string warranty = Convert.ToString(lccomponent.Warranty); string condition = lccomponent.Condition; if (lblType.Text == "NEW") { lblVariable.Text = "Warranty Length"; lblVariableContent.Text = warranty; } if (lblType.Text == "USED") { lblVariable.Text = "Condition"; lblVariableContent.Text = condition; } //clsComponent lccomponent = await ServiceClient.GetComponentAsync(Convert.ToString((lstOrders.SelectedValue))); //lccomponent.ComponentList. //lblProductName.Text = lccomponent. }
internal async static Task <string> DeleteComponentAsync(clsAllComponents clsAllComponents) { using (HttpClient lcHttpClient = new HttpClient()) { HttpResponseMessage lcRespMessage = await lcHttpClient.DeleteAsync ($"http://localhost:8555/api/store/DeleteComponent?Name={clsAllComponents.Name}&ProductName={clsAllComponents.tblCategoryName}"); return(await lcRespMessage.Content.ReadAsStringAsync()); } }
private void btnAdd_Click(object sender, EventArgs e) { clsAllComponents lcComponent = clsAllComponents.NewComponent(cbType.SelectedItem.ToString()); lcComponent.tblCategoryName = _Component.Name; FrmProduct.DispatchComponentForm(lcComponent); if (!string.IsNullOrEmpty(lcComponent.Name)) { refreshFormFromDB(_Component.Name); //UpdateComponents(); } }
internal async static Task <string> InsertComponentAsync(clsAllComponents component) { return(await InsertOrUpdateAsync(component, "http://localhost:8555/api/store/PostComponent", "POST")); }
public static void DispatchComponentForm(clsAllComponents prComponent) { _ComponentForm[prComponent.Type].DynamicInvoke(prComponent); }
public static void Run(clsAllComponents prComponent) { Instance.SetDetails(prComponent); }