Ejemplo n.º 1
0
        protected override void ProgressOperation_OperationError(object sender, ProErrorEventArgs e)
        {
            if (!FormCtrl.IsHandleCreated)
            {
                return;
            }
            FormCtrl.Invoke(new Action(() =>
            {
#if DEBUG
                string errorMsg = e.OptException.ToString();
#else
                string errorMsg = e.OptException.Message;
#endif
                if (MessageCtrl != null)
                {
                    MessageCtrl.Text = MessageAppend ? MessageCtrl.Text.Insert(0, errorMsg + Environment.NewLine) : errorMsg;
                }

                var opt        = sender as IProgressOperation;
                opt.Msgs.Error = e.OptException.ToString();
                opt.WriteLogFile();
                MessageBoxEx.ShowError(e.OptException);
                ChangeView?.Invoke(false);
                RunningOpt = null;
            }));
        }
 // Metoda umożliwiająca przepływ danych z formularza z klientami
 private void GetClient(Client client)
 {
     CurrentClient = client;
     OnPropertyChanged(nameof(CurrentClient));
     ChangeView?.Invoke("ViewServicesHistory", false);
     visitRecord.GetVisits(CurrentClient);
     OnPropertyChanged(nameof(Visits));
 }
Ejemplo n.º 3
0
 protected override void ProgressOperation_OperationFinished(object sender, EventArgs e)
 {
     FormCtrl.Invoke(new Action(() =>
     {
         FormCtrl.FormClosing -= OptForm_Closing;
         var opt = sender as IProgressOperation;
         opt.WriteLogFile();
         ChangeView?.Invoke(false);
         MessageBoxEx.ShowInfo(FormCtrl, "全部处理完成!");
         RunningOpt = null;
     }));
 }
 private void GotoMainMenuFunc()
 {
     ChangeView?.Invoke("ViewMenuWindow", false);
     Clear();
 }
 private void GetSingleUseProduct(SingleUseProduct product)
 {
     SingleUseProducts.Add(product);
     OnPropertyChanged(nameof(SingleUseProducts));
     ChangeView?.Invoke("ViewServiceDone", false);
 }
 // Metody umożliwiające przepływ danych pomiędzy podformularzami a głównym formularzem dodawania wizyty
 private void GetClient(Client client)
 {
     CurrentClient = client;
     OnPropertyChanged(nameof(CurrentClient));
     ChangeView?.Invoke("ViewServiceDone", false);
 }
Ejemplo n.º 7
0
 protected virtual void OnChangeView(ChangeViewEventArgs e)
 {
     ChangeView?.Invoke(this, e);
 }
 private void GetNewProduct(object product)
 {
     NewProducts.Add(product as SingleUseProduct);
     OnPropertyChanged(nameof(NewProducts));
     ChangeView?.Invoke("ViewDeliveryAdd", false);
 }