Пример #1
0
        public async void ShowDialog(clsMyOrder prOrder)
        {
            _Order      = prOrder;
            _Instrument = await Admin.ServiceClient.GetInstrumentAsync(_Order.SerialNo);

            UpdateDisplay();
            ShowDialog();
        }
Пример #2
0
        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());
            }
        }
Пример #3
0
 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)
     {
     }
 }
Пример #4
0
 internal static async Task <string> UpdateInstrumentAsync(clsAllInstruments prInstrument)
 {
     return(await InsertOrUpdateAsync(prInstrument, "http://localhost:60065/api/shop/PutInstrument", "PUT"));
 }
Пример #5
0
 public static void Run(clsAllInstruments prUsedInstrument)
 {
     Instance.SetDetails(prUsedInstrument);
 }
Пример #6
0
 public static void DispatchInstrumentForm(clsAllInstruments prInstrument)
 {
     _InstrumentForm[prInstrument.InstrumentType].DynamicInvoke(prInstrument);
 }
Пример #7
0
 public void SetDetails(clsAllInstruments prInstrument)
 {
     _Instrument = prInstrument;
     updateForm();
     ShowDialog();
 }