public void ReceiveOperationComplete(object sender, OperationCompleteEventArgs e)
 {
     if (_OperationComplete != null)
     {
         lock (_OperationComplete)
         {
             if (_OperationComplete != null)
             {
                 _OperationComplete(sender, e);
             }
         }
     }
 }
Exemple #2
0
 public void ReceiveOperationComplete(object sender, OperationCompleteEventArgs e)
 {
     if (_OperationComplete != null)
     {
         lock (_OperationComplete)
         {
             if (_OperationComplete != null)
             {
                 _OperationComplete(sender, e);
             }
         }
     }
 }
Exemple #3
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");
                }
            }
        }
 private void OnOperationComplete(object sender, OperationCompleteEventArgs e)
 {
     if (_OperationComplete != null)
     {
         lock (_OperationComplete)
         {
             if (_OperationComplete != null)
             {
                 _OperationComplete(sender, e);
             }
         }
     }
 }
 private void OnOperationComplete(object sender, OperationCompleteEventArgs e)
 {
     try
     {
         if (_OperationComplete != null)
         {
             _OperationComplete(sender, e);
         }
         _OperationCompleteCaller.ReceiveOperationComplete(sender, e);
     }
     finally
     {
         IsRunningEmployeeTimeImport = false;
     }
 }
        private void importTimePlanning(object param)
        {
            OperationCompleteEventArgs operationCompleteEventArgs = new OperationCompleteEventArgs(false);
            ImportParam importParam = (ImportParam)param;
            try
            {
                SaveDataResult saveDataResult =
                    _EmployeeTimeDao.ImportTime(importParam.List, importParam.ImportTimeType);
                operationCompleteEventArgs.Success = saveDataResult.Success;
                //[0,0]- min date
                //[0,1]- max date
                DateTime?[,] minmaxDate = (DateTime?[,])saveDataResult.Data;

                // calculate holidays absence - need change Time field

                if (minmaxDate != null && minmaxDate[0, 0] != null && minmaxDate[0, 1] != null)
                {
                    DateTime minDate = minmaxDate[0, 0].Value;
                    DateTime maxDate = minmaxDate[0, 1].Value;

                    if (Log.IsDebugEnabled)
                        Log.Debug(minDate.ToShortDateString() + "  " +
                            maxDate.ToShortDateString() + " - start recalculation");

                    EmployeeBusinessObject.RecalculateHolidaysTimeRanges(minDate, maxDate);
                    if (Log.IsDebugEnabled)
                        Log.Debug(minDate.ToShortDateString() + "  " +
                            maxDate.ToShortDateString() + " - finished recalculation");
                }
                //operationCompleteEventArgs.Param = saveDataResult.Data;
            }
            catch (Exception ex)
            {
                operationCompleteEventArgs.Param = ex;
            }
            OnOperationComplete(null, operationCompleteEventArgs);
        }
 private void storeService_OnImportBusinessVolumeComplete(object sender, OperationCompleteEventArgs e)
 {
     ImportBusinessValuesResult importBusinessValuesResult = (ImportBusinessValuesResult)e.Param;
     if (importBusinessValuesResult.BusinessVolumeType == _ImportType)
     {
         _CompleteResult = e.Success;
         if (_CompleteResult)
         {
             if (importBusinessValuesResult.FilesCount <= 0)
             {
                 _CompleteResult = false;
                 _Exception = new Exception(GetLocalized("NoFilesMatchSpec"));
             }
         }
         else
         {
             _Exception = (Exception)importBusinessValuesResult.Data;
         }
         _ImportRunning = false;
     }
 }
Exemple #8
0
 void StoreService_BVCopyFromStoreComplete(object sender, OperationCompleteEventArgs e)
 {
     MessageBox.Show(string.Format("Complite. Result {0} ",e.Success));
 }