Esempio n. 1
0
        private void StoreService_BVCopyFromStoreComplete(object sender, OperationCompleteEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new OperationCompleteDelegate(StoreService_BVCopyFromStoreComplete), new object[] { sender, e });
            }
            else
            {
                if (!e.Success)
                {
                    if (e.Param is Exception)
                    {
                        error        = (Exception)e.Param;
                        DialogResult = DialogResult.Cancel;
                    }
                    else
                    {
                        result = (BVcopyFromStoreResult)e.Param;
                        switch (result)
                        {
                        case BVcopyFromStoreResult.DataExistsInSelectedTimeRange:
                            DialogResult = DialogResult.Cancel;
                            break;

                        case BVcopyFromStoreResult.NoDataCopy:
                            DialogResult = DialogResult.Cancel;
                            break;

                        case BVcopyFromStoreResult.Success:

                            lb_mess.ForeColor = Color.Green;
                            lb_mess.Text      = Localizer.GetLocalized("CopyingCompletedSuccessfully");
                            ProgressBar.Properties.Stopped = true;
                            bt_OK.Enabled = true;
                            break;

                        default:
                            error        = new ApplicationException(result.ToString() + "Get Value From invalid result in case");
                            DialogResult = DialogResult.Cancel;
                            break;
                        }
                    }
                }
                else
                {
                    result = BVcopyFromStoreResult.Success;
                    ProgressBar.Properties.Stopped = true;
                    bt_OK.Enabled     = true;
                    lb_mess.ForeColor = Color.Green;
                    lb_mess.Text      = Localizer.GetLocalized("CopyingCompletedSuccessfully");
                }
            }
        }
Esempio n. 2
0
        private void StoreService_BVCopyFromStoreComplete(object sender, OperationCompleteEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new OperationCompleteDelegate(StoreService_BVCopyFromStoreComplete), new object[] { sender, e });
            }
            else
            {
                if (!e.Success)
                {
                    if (e.Param is Exception)
                    {
                        error = (Exception)e.Param;
                        DialogResult = DialogResult.Cancel;
                    }
                    else
                    {
                        result = (BVcopyFromStoreResult)e.Param;
                        switch (result)
                        {
                            case BVcopyFromStoreResult.DataExistsInSelectedTimeRange:
                                DialogResult = DialogResult.Cancel;
                                break;
                            case BVcopyFromStoreResult.NoDataCopy:
                                DialogResult = DialogResult.Cancel;
                                break;
                            case BVcopyFromStoreResult.Success:

                                lb_mess.ForeColor = Color.Green;
                                lb_mess.Text = Localizer.GetLocalized("CopyingCompletedSuccessfully");
                                ProgressBar.Properties.Stopped = true;
                                bt_OK.Enabled = true;
                                break;
                            default:
                                error = new ApplicationException(result.ToString() + "Get Value From invalid result in case");
                                DialogResult = DialogResult.Cancel;
                                break;
                        }
                    }
                }
                else
                {
                    result = BVcopyFromStoreResult.Success;
                    ProgressBar.Properties.Stopped = true;
                    bt_OK.Enabled = true;
                    lb_mess.ForeColor = Color.Green;
                    lb_mess.Text = Localizer.GetLocalized("CopyingCompletedSuccessfully");
                }
            }
        }