public async void ShowDialog(clsMyOrder prOrder) { _Order = prOrder; _Instrument = await Admin.ServiceClient.GetInstrumentAsync(_Order.SerialNo); UpdateDisplay(); ShowDialog(); }
internal static async Task <string> DeleteInstrumentAsync(clsAllInstruments prInstrument) { using (HttpClient lcHttpClient = new HttpClient()) { HttpResponseMessage lcRespMessage = await lcHttpClient.DeleteAsync ($"http://localhost:60065/api/shop/DeleteInstrument?SerialNo={prInstrument.SerialNo}"); return(await lcRespMessage.Content.ReadAsStringAsync()); } }
private void add_Click(object sender, EventArgs e) { try { string lcReply = new InputBox(clsAllInstruments.FACTORY_PROMPT).Answer; if (!string.IsNullOrEmpty(lcReply)) // not cancelled? { clsAllInstruments lcInstrument = clsAllInstruments.NewWork(lcReply[0]); if (lcInstrument != null) // valid instrument created? { lcInstrument.CategoryName = _Category.CategoryName; FrmInstrument.DispatchInstrumentForm(lcInstrument); if (!string.IsNullOrEmpty(lcInstrument.InstrumentName)) // not cancelled? { refreshFormFromDBAsync(_Category.CategoryName); FrmMain.Instance.UpdateDisplayAsync(); } } } } catch (Exception) { } }
internal static async Task <string> UpdateInstrumentAsync(clsAllInstruments prInstrument) { return(await InsertOrUpdateAsync(prInstrument, "http://localhost:60065/api/shop/PutInstrument", "PUT")); }
public static void Run(clsAllInstruments prUsedInstrument) { Instance.SetDetails(prUsedInstrument); }
public static void DispatchInstrumentForm(clsAllInstruments prInstrument) { _InstrumentForm[prInstrument.InstrumentType].DynamicInvoke(prInstrument); }
public void SetDetails(clsAllInstruments prInstrument) { _Instrument = prInstrument; updateForm(); ShowDialog(); }