private void ActionResultCode_Error_ServerTimeout(ActionResultBase result, WebPanelItems.WebPanelItemBase item)
 {
     OnProgressChanged(result.ErrorMessage + ".Проверяем был удален или нет.", ViewStatus.ErrorNotCritical);
     if (!GetInstance.Exist(item))
     {
         base.ActionResultCode_Success(result);
     }
     else
     {
         OnProgressChanged("Объект не был удален, пробуем еще раз.", ViewStatus.ErrorNotCritical);
         this.CurrentIndex--;
     }
 }
Exemplo n.º 2
0
 protected override void OnDoWork2(System.ComponentModel.DoWorkEventArgs e)
 {
     IWebPanelBasicActions.IEdit EditInstance = WebPanelAccount.AccountManager.SelectAccount.WebPanelAPI;
     for (this.CurrentIndex = 0; this.CurrentIndex < base.Quenu.Count; this.CurrentIndex++)
     {
         if (base.CancellationPending)
         {
             e.Cancel = true;
             return;
         }
         WebPanelItems.WebPanelItemBase workObject = this.Quenu[this.CurrentIndex];
         OnProgressChanged("", ViewStatus.Select);
         base.ProcessResult(EditInstance.Edit(workObject, this.PropertyData), workObject);
         TimeOut();
     }
     this.ReportProgress(100);
 }
 protected override void OnDoWork2(System.ComponentModel.DoWorkEventArgs e)
 {
     PrepareData();
     for (this.CurrentIndex = 0; this.CurrentIndex < base.Quenu.Count; this.CurrentIndex++)
     {
         if (base.CancellationPending)
         {
             e.Cancel = true;
             return;
         }
         WebPanelItems.WebPanelItemBase workObject = this.Quenu[this.CurrentIndex];
         OnProgressChanged("", ViewStatus.Select);
         base.ProcessResult(RemoveInstance.RemoveOject(workObject), workObject);
         TimeOut();
     }
     this.ReportProgress(100);
 }
Exemplo n.º 4
0
        protected override void OnDoWork2(System.ComponentModel.DoWorkEventArgs e)
        {
            ActionResultBase       result        = null;
            WebPanelItemCollection TopDomainList = null;

            if (this.Quenu.CollectionType == typeof(SubDomainItem))
            {
                this.ReportProgress(0, "Получаем список основных доменов.");
                TopDomainList = new WebPanelItemCollection(typeof(DomainItem));
                if (!(result = this.GetInstance.Get(TopDomainList)))
                {
                    this.ReportProgress(0, string.Format("[MCOLOR:Red]Не удалось получить список основных доменов:{0}[/MCOLOR]", result.ErrorMessage));
                    this.CancelAsync();
                    return;
                }
                if (TopDomainList.Count == 0)
                {
                    this.ReportProgress(0, "[MCOLOR:Red]Не обнаруженно основных доменов. Невозможно добавит поддомены не имея основных доменов.[/MCOLOR]");
                    this.CancelAsync();
                    return;
                }
            }
            for (this.CurrentIndex = 0; this.CurrentIndex < base.Quenu.Count; this.CurrentIndex++)
            {
                if (base.CancellationPending)
                {
                    e.Cancel = true;
                    return;
                }
                WebPanelItems.WebPanelItemBase workObject = this.Quenu[this.CurrentIndex];
                OnProgressChanged("", ViewStatus.Select);
                if (TopDomainList != null)
                {
                    workObject = WebPanelItems.SubDomainItem.FindAndMake(workObject.Name, TopDomainList);
                    if (workObject == null)
                    {
                        OnProgressChanged("Не возможно добавить поддомен, поскольку не найден основной домен.", ViewStatus.Error);
                        continue;
                    }
                }
                result = AddInstance.Add(workObject, base.PropertyData);
                base.ProcessResult(result, workObject);
                TimeOut();
            }
            this.ReportProgress(100);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Метод обрабатывает результат выполнеия оцерации над объектом из очереди
 /// </summary>
 /// <param name="result"></param>
 protected void ProcessResult(ActionResultBase result, WebPanelItems.WebPanelItemBase item)
 {
     if (ResultDelegates.ContainsKey(result.ActionCode))
     {
         ResultDelegates[result.ActionCode](result, item);
     }
     else
     {
         if (result)
         {
             this.ActionResultCode_Success(result);
         }
         else
         {
             this.ActionResultCode_ErrorBasic(result);
         }
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Метод вызывается при попытки добавить объект, который уже есть в панели управления
 /// </summary>
 private void ActionResultCode_Error_ObjectAlreadyExist(ActionResultBase result, WebPanelItems.WebPanelItemBase item)
 {
     OnProgressChanged("Уже добавлен!", ViewStatus.ErrorNotCritical);
     base.ActionResultCode_Success(result);
 }