예제 #1
0
 private void FilterValueChanged(object sender, EventArgs e)
 {
     try
     {
         if (radioAll.Checked)
         {
             Reset("", Convert.ToInt32(txtSearch.Text));
         }
         else if (radioDelivered.Checked)
         {
             Reset("DISPATCHED", Convert.ToInt32(txtSearch.Text));
         }
         else if (radioInProgress.Checked)
         {
             Reset("IN PROGRESS", Convert.ToInt32(txtSearch.Text));
         }
         else if (radioPending.Checked)
         {
             Reset("PENDING", Convert.ToInt32(txtSearch.Text));
         }
     }
     catch (FormatException)
     {
         txtSearch.Text = 0.ToString();
     }
     catch (Exception ex)
     {
         MessageBoxes.Error(ex.Message);
     }
 }
예제 #2
0
 private void delBtn_Click(object sender, EventArgs e)
 {
     if (viewProductsGridView.SelectedRows.Count == 0)
     {
         MessageBoxes.Info("No item(s) selected.\nPlease select an item to delete.");
     }
     else
     {
         string warningMessage = "Are you sure want to delete " + viewProductsGridView.SelectedRows.Count + "Item(s)?\nThis action can't be overturned.";
         if (MessageBoxes.Warning(warningMessage) == true)
         {
             foreach (DataGridViewRow row in viewProductsGridView.SelectedRows)
             {
                 try
                 {
                     int     id = (int)row.Cells[0].Value;
                     Product p  = new Product();
                     p.id = id;
                     p.Delete();
                     Reset();
                 }
                 catch (Exception ex)
                 {
                     MessageBoxes.Error(ex.Message);
                 }
             }
             viewProductsGridView.Refresh();
         }
     }
 }
예제 #3
0
        private void ObjUsedCitationsCatalog_SelectionChanged(List <PDFDocument> selected_pdf_documents)
        {
            try
            {
                FeatureTrackingManager.Instance.UseFeature(Features.InCite_ClickUsedReference);

                if (0 < selected_pdf_documents.Count)
                {
                    foreach (UsedCitation used_citation in latest_used_citations)
                    {
                        if (used_citation.pdf_document == selected_pdf_documents[0])
                        {
                            WordConnector.Instance.FindCitationCluster(used_citation.citation_cluster);
                            break;
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                Logging.Error(ex, "Error locating used citation.");
                MessageBoxes.Error("There was a problem locating the used citation.  Is Word still running?");
            }
        }
예제 #4
0
 public ViewPrescriptionGlasses(PrescriptionGlasses prescriptionglass)
 {
     try
     {
         InitializeComponent();
         prescriptionGlasses = prescriptionglass;
         lstIVM.Add(new ImagesViewModel {
             ImageName = prescriptionGlasses.PrimaryImage
         });
         foreach (var item in prescriptionGlasses.Images)
         {
             if (item != prescriptionGlasses.PrimaryImage)
             {
                 lstIVM.Add(new ImagesViewModel {
                     ImageName = item
                 });
             }
         }
         Reset();
     }
     catch (Exception ex)
     {
         MessageBoxes.Error(ex.Message);
     }
 }
예제 #5
0
 private void btnStatus_Click(object sender, EventArgs e)
 {
     try
     {
         if (order.Status.Contains("PENDING"))
         {
             order.Status = "IN PROGRESS";
             Close();
         }
         else if (order.Status.Contains("IN PROGRESS"))
         {
             DispatchedDetails dd = new DispatchedDetails(order.Cart.Buyer.Name);
             if (dd.ShowDialog() == DialogResult.OK)
             {
                 order.Status       = "DISPATCHED";
                 order.DispatchDate = DateTime.Now;
                 Close();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBoxes.Error(ex.Message);
     }
 }
예제 #6
0
        private void ButtonAddDocumentsFromLibrary_Click(object sender, RoutedEventArgs e)
        {
            using (AugmentedPopupAutoCloser apac = new AugmentedPopupAutoCloser(ButtonAddPDFPopup))
            {
                // First choose the source library
                string           message = String.Format("You are about to import a lot of PDFs into the library named '{0}'.  Please choose the library FROM WHICH you wish to import the PDFs.", web_library_detail.Title);
                WebLibraryDetail picked_web_library_detail = WebLibraryPicker.PickWebLibrary(message);
                if (null != picked_web_library_detail)
                {
                    if (picked_web_library_detail == web_library_detail)
                    {
                        MessageBoxes.Error("You can not copy documents into the same library.");
                        return;
                    }

                    // Then check that they still want to do this
                    string message2 = String.Format("You are about to copy ALL of the PDFs from the library named '{0}' into the library named '{1}'.  Are you sure you want to do this?", picked_web_library_detail.Title, web_library_detail.Title);
                    if (!MessageBoxes.AskQuestion(message2))
                    {
                        return;
                    }

                    // They are sure!
                    ImportingIntoLibrary.ClonePDFDocumentsFromOtherLibrary_ASYNCHRONOUS(picked_web_library_detail.Xlibrary.PDFDocuments, web_library_detail);
                }
            }
        }
        /// <summary>
        /// Метод получает cуммарную ширину столбцов главного грида.
        /// </summary>
        private void WidthVisibleColumnsGrid(object sender)
        {
            try
            {
                nSumWidthColumnsGrid = 0;
                DataGridView dg = (DataGridView)sender;

                // Расширяем столбец по содержимому.
                igMain.Columns["colNote"].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;

                // Получаем cуммарную ширину столбцов.
                for (int i = 0; i < dg.ColumnCount; i++)
                {
                    if (dg.Columns[i].Visible == true)
                    {
                        nSumWidthColumnsGrid += dg.Columns[i].Width;
                    }
                }

                // Задаём ширину столбца примечаний в зависимости от содержимого.
                SetColumnWidth();
            }
            catch (Exception ex)
            {
                MessageBoxes.Error(this, ex, "Ошибка расчёта суммарной ширины полей таблицы!");
                return;
            }
        }
예제 #8
0
 private void btnSendSms_Click(object sender, EventArgs e)
 {
     if (txtMessage.Text != "")
     {
         if (txtMessage.Text.Length < 140)
         {
             string message;
             try
             {
                 foreach (var customer in customers)
                 {
                     message = "Dear " + customer.Name + ",\n" + txtMessage.Text + "\nRegrads: Eyeworld Team";
                     SendSms(message, customer.PhoneNumber);
                 }
                 MessageBoxes.Success("SMS(s) sent succesfully");
             }
             catch (Exception ex)
             {
                 MessageBoxes.Error(ex.Message);
             }
         }
         else
         {
             MessageBoxes.Error("Messsage Body is too Large.");
         }
     }
     else
     {
         MessageBoxes.Info("Message Body is empty.");
     }
 }
        protected override void OnBeforeExpand(TreeViewCancelEventArgs e)
        {
            base.OnBeforeExpand(e);

            var folder = e.Node as FolderNode;

            if (folder != null && !folder.HasLoaded)
            {
                try
                {
                    Cursor = Cursors.WaitCursor;

                    folder.Load(Client);
                } catch (Exception ex)
                {
                    MessageBoxes.Error(this, "Error Loading Folder", ex);

                    folder.AddErrorNode(ex.Message);
                } finally
                {
                    Cursor = Cursors.Default;
                };
            }
            ;
        }
        int nSumWidthColumnsGrid = 0;    // Суммарная ширина столбцов главного грида.

        #endregion Private Members

        #region Events Handlers

        private void ProductHeapUnionDialog_Load(object sender, EventArgs e)
        {
            try
            {
                if (!DesignMode)
                {
                    // Загрузка справочников.
                    LoadDicts();

                    // Установка значений по умолчанию для справочников материалов и фракций в соответствии
                    // с параметрами входного террикона.
                    itbMaterial.SelectedValue = MaterialId;
                    itbFraction.SelectedValue = FractionId;

                    // Загрузка терриконов в главный грид окна.
                    RefreshSimilarHeaps();
                }
            }
            catch (Exception ex)
            {
                // public class MessageBoxes from Itm.WClient.Com;
                MessageBoxes.Error(this, ex, "Ошибка загрузки справочников и терриконов!");
                return;
            }
        }
        // Выбор площадки из справочника.
        // (! будет время  - выполнить рефакторинг загрузки справочников).
        private void itbPlace_ButtonClick(object sender, EventArgs e)
        {
            try
            {
                using (var dlg = new TableSelectionForm
                {
                    Name = "dlgPlace",
                    Text = "Выбор места",
                    ValueColumnName = "nUnitId",
                    Width = 600,
                    Height = 380
                })
                {
                    dlg.AddTextColumn("Наименование места",
                                      "cNameUnit", DataGridViewAutoSizeColumnMode.Fill, 100, 100);
                    SQLCoreInterfaceHelper.InitializeChildSQLCore(dlg, this);

                    var itb = (ItmTextBox)sender;
                    dlg.DataSource    = itb.DataSource;
                    dlg.SelectedValue = itb.SelectedValue;
                    if (dlg.ShowDialog(this) == DialogResult.OK)
                    {
                        itb.SelectedValue = dlg.SelectedValue;
                    }
                }
            }
            catch (Exception ex)
            {
                // public class MessageBoxes from Itm.WClient.Com;
                MessageBoxes.Error(this, ex, "Ошибка выбора площадки!");
                return;
            }
        }
        void btnImport_Click(object sender, RoutedEventArgs e)
        {
            FeatureTrackingManager.Instance.UseFeature(Features.Library_ImportFromThirdParty);

            IEnumerable <AugmentedBindable <BibTeXEntry> > allEntries = GetEntries().Where(x => x.Underlying.Selected);

            if (allEntries.Count() == 0)
            {
                MessageBoxes.Error("Please select at least one entry to import, by checking the checkbox.");
                return;
            }

            List <ImportingIntoLibrary.FilenameWithMetadataImport> filename_and_bibtex_imports = new List <ImportingIntoLibrary.FilenameWithMetadataImport>();

            foreach (AugmentedBindable <BibTeXEntry> entry in allEntries)
            {
                ImportingIntoLibrary.FilenameWithMetadataImport filename_with_metadata_import = new ImportingIntoLibrary.FilenameWithMetadataImport
                {
                    filename = entry.Underlying.Filename,
                    bibtex   = entry.Underlying.BibTeX,
                    tags     = entry.Underlying.Tags,
                    notes    = entry.Underlying.Notes
                };

                filename_and_bibtex_imports.Add(filename_with_metadata_import);
            }

            StatusManager.Instance.UpdateStatus("ImportFromThirdParty", "Started importing documents");

            ImportingIntoLibrary.AddNewPDFDocumentsToLibraryWithMetadata_ASYNCHRONOUS(_library, false, false, filename_and_bibtex_imports.ToArray());

            MessageBoxes.Info("{0} files are now being imported - this may take a little while.  You can track the import progress in the status bar.", filename_and_bibtex_imports.Count);

            this.Close();
        }
예제 #13
0
        /// <summary>
        /// Launches application
        /// </summary>
        public void Launch()
        {
            Process p = new Process();

            p.StartInfo.FileName = PathFormatted;

            if (UseCustomArguments)
            {
                p.StartInfo.Arguments = ArgumentsFormatted;
            }

            if (UseCustomWorkingDirectory)
            {
                p.StartInfo.WorkingDirectory = CustomWorkingDirectoryFormatted;
            }

            try
            {
                p.Start();
            }
            catch (Exception ex)
            {
                MessageBoxes.Error("Unable to launch an application!", ex);
            }
        }
예제 #14
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     if (txtDeliveryCode.Text == "" || txtMaximumDeliveryTime.Text == "" || txtServiceProviderName.Text == "")
     {
         MessageBoxes.Info("No field should be empty.");
         DialogResult = DialogResult.Cancel;
     }
     else
     {
         logisticsServiceProviderName = txtServiceProviderName.Text;
         deliveryCode        = txtDeliveryCode.Text;
         maximumDeliveryTime = txtMaximumDeliveryTime.Text;
         string emailBody = "Dear " + buyerName + ",\n\tYour Order has been dispatched. Details:\n\tDelivery Service Provider: " + logisticsServiceProviderName + "\n\t\tDelivery Code: " + deliveryCode + "\n\t\tMaxmium Time: " + maximumDeliveryTime + "\nRegards,\nEyeWorld Team";
         try
         {
             SendEmail(emailBody);
             DialogResult = DialogResult.OK;
         }
         catch (Exception ex)
         {
             MessageBoxes.Error(ex.Message);
             DialogResult = DialogResult.Cancel;
         }
     }
 }
예제 #15
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         Frame f;
         if (dataFrames.SelectedRows.Count == 0)
         {
             MessageBoxes.Info("No item(s) selected.\nPlease select an item to delete.");
         }
         else
         {
             string warningMessage = "Are you sure want to delete " + dataFrames.SelectedRows.Count + "Item(s)?\nThis action can't be overturned.";
             if (MessageBoxes.Warning(warningMessage) == true)
             {
                 foreach (DataGridViewRow row in dataFrames.SelectedRows)
                 {
                     int id = (int)row.Cells[0].Value;
                     f = new Frame(id);
                     f.Delete();
                 }
                 Reset();
                 dataFrames.Refresh();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBoxes.Error(ex.Message);
     }
 }
예제 #16
0
        private void OnArgumentsLoaded(object sender, RunWorkerCompletedEventArgs e)
        {
            try
            {
                if (e.Cancelled)
                {
                    //We'll need to reload the next time
                    m_currentReportPath = null;
                    return;
                }
                ;

                if (e.Error != null)
                {
                    throw e.Error;
                }

                var parameters = e.Result as IEnumerable <ParameterNode>;

                Node.SetParameters(parameters);
                PropertyGrid.Enabled = true;
                PropertyGrid.Refresh();
                PropertyGrid.ExpandAllGridItems();
            } catch (Exception ex)
            {
                MessageBoxes.Error(this, "Error Loading Parameters", ex);
            } finally
            {
                this.Cursor = Cursors.Default;
            };
        }
예제 #17
0
        private void ButtonJoinCreate_Click(object sender, RoutedEventArgs e)
        {
            FeatureTrackingManager.Instance.UseFeature(Features.StartPage_CreateIntranetLibrary);

            if (String.IsNullOrEmpty(TxtPath.Text))
            {
                MessageBoxes.Error("Please enter a path to your Intranet Library.");
                return;
            }

            string db_base_path   = TxtPath.Text;
            string db_title       = TxtTitle.Text;
            string db_description = TxtDescription.Text;

            SafeThreadPool.QueueUserWorkItem(o =>
            {
                bool validation_successful = EnsureIntranetLibraryExists(db_base_path, db_title, db_description);

                if (validation_successful)
                {
                    WPFDoEvents.InvokeInUIThread(() =>
                    {
                        Close();
                    });
                }
            });
        }
예제 #18
0
        private void ButtonExportExcel_Click(object sender, RoutedEventArgs e)
        {
            if (null == last_ObjGridControl)
            {
                MessageBoxes.Error("Please regenerate your Pivot before trying to export it.");
                return;
            }


            SaveFileDialog save_file_dialog = new SaveFileDialog();

            save_file_dialog.AddExtension     = true;
            save_file_dialog.CheckPathExists  = true;
            save_file_dialog.DereferenceLinks = true;
            save_file_dialog.OverwritePrompt  = true;
            save_file_dialog.ValidateNames    = true;
            save_file_dialog.DefaultExt       = "csv";
            save_file_dialog.Filter           = "CSV files (*.csv)|*.csv|All files (*.*)|*.*";
            save_file_dialog.FileName         = "QiqqaLibraryPivot.csv";

            if (true == save_file_dialog.ShowDialog())
            {
                string target_filename = save_file_dialog.FileName;
                ExportToExcel(target_filename);
            }
        }
예제 #19
0
        public ViewSunglasses(Sunglasses sunglasses)
        {
            InitializeComponent();
            try
            {
                this.sunglasses = sunglasses;
                lstIVM.Add(new ImagesViewModel {
                    ImageName = sunglasses.PrimaryImage
                });
                foreach (var item in sunglasses.Images)
                {
                    if (item != sunglasses.PrimaryImage)
                    {
                        lstIVM.Add(new ImagesViewModel {
                            ImageName = item
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxes.Error(ex.Message);
            }

            Reset();
        }
        // Установка курсора в нужную позицию текстового поля с названием результирующего террикона.
        // Пользователю останется только ввести цифровой номер нового террикона.
        // Метод предназначен для упрощения работы пользователя (сокращает количество операции).
        private void cmsCommentTemplate_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            try
            {
                // Получаем выбранный пользователем шаблон названия террикона.
                string str = e.ClickedItem.Text.Trim();

                // Ищем первое вхождение подстроки "тер" в строку "str" без учёта регистра.
                int n = str.IndexOf("тер", StringComparison.CurrentCultureIgnoreCase);

                // Если вхождение было найдено(или переменная "str" оказалась пустая)
                // выполняется установка курсора в нужную позицию TextBox'а, компоненту передаётся фокус.
                // Пользователю останется только ввести цифровой номер нового террикона.
                if (n != -1)
                {
                    str                    = str.Insert(n, " ");
                    tbName.Text            = str;
                    tbName.SelectionStart  = n;
                    tbName.SelectionLength = 0;
                    tbName.Focus();
                }
            }
            catch (Exception ex)
            {
                // public class MessageBoxes from Itm.WClient.Com;
                MessageBoxes.Error(this, ex, "Ошибка установки курсора в названии результирующего террикона!");
                return;
            }
        }
        public static void CitePDFDocuments(List <PDFDocument> pdf_documents, bool separate_author_and_date)
        {
            try
            {
                foreach (var pdf_document in pdf_documents)
                {
                    if (String.IsNullOrEmpty(pdf_document.BibTex))
                    {
                        MessageBoxes.Warn("One or more of your documents have no associated BibTeX information.  Please add some or use the BibTeX Sniffer to locate it on the Internet.");
                        return;
                    }
                }

                CitationCluster citation_cluster = GenerateCitationClusterFromPDFDocuments(pdf_documents);
                citation_cluster.citation_items[0].SeparateAuthorsAndDate(separate_author_and_date);

                if (null != citation_cluster)
                {
                    WordConnector.Instance.WaitForAtLeastOneIteration();
                    WordConnector.Instance.AppendCitation(citation_cluster);
                }
            }
            catch (Exception ex)
            {
                Logging.Error(ex, "Exception while citing PDFDocument.");
                MessageBoxes.Error("There has been a problem while trying to add the citation.  Please check that Microsoft Word is running.\n\nIf the problem persists, perhaps open InCite from the Start Page as it may offer more details about the problem.");
            }
        }
        /// <summary>
        /// 1) Принудительная установка checkbox'а для строки грида с входным терриконом.
        /// 2) Динамическое формирование примечания результирующего террикона.
        /// </summary>
        private void RequiredProductHeapChecked()
        {
            try
            {
                // Принудительный выбор входного террикона
                if (!igMain.CheckedRowsIDs.Contains(HeapId))
                {
                    igMain.CheckRow(requiredRow, true);
                    igMain.Refresh();
                }

                // Динамическое формирование примечания.
                // Примечание состоит из названий терриконов, выбранных для слияния, и их параметров.
                if (dts.Rows != null)
                {
                    string cNote = "";
                    // Список ID "прочеканных" терриконов.
                    var ids = new List <int>(igMain.CheckedRowsIDs);
                    if (ids.Count > 0)
                    {
                        cNote = "Террикон создан в результате слияния терриконов: ";
                        // Цикл по строкам главного грида с терриконами.
                        foreach (DataRow row in dts.Rows)
                        {
                            // Цикл по списку ID "прочеканных" терриконов.
                            for (int i = 0; i < ids.Count; i++)
                            {
                                decimal nWeight = row.Field <decimal?>("nWeight") ?? 0;
                                // Если террикон из главного грида выбран,
                                // добавляем его в примечание.
                                if (row.Field <int>("nHeapId").Equals(ids[i]))
                                {
                                    cNote += "\""
                                             + row.Field <string>("cNameUnit") + "\\"                     // название площадки;
                                             + row.Field <string>("cNameHeap") + "\"("                    // название террикона;
                                             + row.Field <string>("cNameMaterial") + ", фр.:"             // материал;
                                             + row.Field <string>("cNameFraction").ToLower() + ", масса:" // фракция;
                                             + nWeight.ToString() + " т.)"                                // масса террикона.
                                             + ", ";
                                }
                            }
                        }
                    }
                    // Удаление символов " ," в конце строки.
                    if (cNote.Length > 3)
                    {
                        cNote = cNote.Remove(cNote.Length - 2, 2) + '.';
                    }

                    // Отображение текста примечания.
                    tbNote.Text = cNote;
                }
            }
            catch (Exception ex)
            {
                // public class MessageBoxes from Itm.WClient.Com;
                MessageBoxes.Error(this, ex, "Ошибка формирования примечания результирующего террикона!");
                return;
            }
        }
예제 #23
0
        void ButtonGet_Click(object sender, RoutedEventArgs e)
        {
            if (null == library)
            {
                MessageBoxes.Error("You must choose a library...");
                return;
            }

            TxtData.Text = "";

            var items = library.LibraryDB.GetLibraryItems(TxtFingerprint.Text, TxtExtension.Text);

            if (0 == items.Count)
            {
                MessageBoxes.Warn("No entry was found.");
            }
            else if (1 == items.Count)
            {
                byte[] data = items[0].data;
                string json = Encoding.UTF8.GetString(data);
                TxtData.Text = json;
            }
            else
            {
                MessageBoxes.Warn("{0} entries were found, so not showing them...", items.Count);
            }
        }
예제 #24
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         PromoCode p;
         if ((int)dataPromos.SelectedRows[0].Cells[0].Value != 6)
         {
             if (dataPromos.SelectedRows.Count == 0)
             {
                 MessageBoxes.Info("No item(s) selected.\nPlease select an item to delete.");
             }
             else
             {
                 string warningMessage = "Are you sure want to delete " + dataPromos.SelectedRows.Count + "Item(s)?\nThis action can't be overturned.";
                 if (MessageBoxes.Warning(warningMessage) == true)
                 {
                     p = new PromoCode((int)dataPromos.SelectedRows[0].Cells[0].Value);
                     p.Delete();
                     Reset();
                     dataPromos.Refresh();
                 }
             }
         }
         else
         {
             MessageBoxes.Info("The Promo Code you have chosen is the default code and cannot be deleted.");
         }
     }
     catch (Exception ex)
     {
         MessageBoxes.Error(ex.Message);
     }
 }
예제 #25
0
        private void ManageDownload(BundleLibraryManifest manifest)
        {
            WPFDoEvents.AssertThisCodeIs_NOT_RunningInTheUIThread();

            string url = manifest.BaseUrl + @"/" + manifest.Id + Common.EXT_BUNDLE;

            using (UrlDownloader.DownloadAsyncTracker download_async_tracker = UrlDownloader.DownloadWithNonBlocking(url))
            {
                string STATUS_TOKEN = "BundleDownload-" + manifest.Version;

                StatusManager.Instance.ClearCancelled(STATUS_TOKEN);
                while (!download_async_tracker.DownloadComplete)
                {
                    if (ShutdownableManager.Instance.IsShuttingDown)
                    {
                        Logging.Error("Canceling download of Bundle Library due to signaled application shutdown");
                        StatusManager.Instance.SetCancelled(STATUS_TOKEN);
                    }

                    if (StatusManager.Instance.IsCancelled(STATUS_TOKEN))
                    {
                        download_async_tracker.Cancel();
                        break;
                    }

                    StatusManager.Instance.UpdateStatus(STATUS_TOKEN, "Downloading Bundle Library...", download_async_tracker.ProgressPercentage, 100, true);

                    ShutdownableManager.Sleep(3000);
                }

                // Check the reason for exiting
                if (download_async_tracker.DownloadDataCompletedEventArgs.Cancelled)
                {
                    StatusManager.Instance.UpdateStatus(STATUS_TOKEN, "Cancelled download of Bundle Library.");
                }
                else if (null != download_async_tracker.DownloadDataCompletedEventArgs.Error)
                {
                    MessageBoxes.Error(download_async_tracker.DownloadDataCompletedEventArgs.Error, "There was an error during the download of your Bundle Library.  Please try again later or contact {0} for more information.", manifest.SupportEmail);
                    StatusManager.Instance.UpdateStatus(STATUS_TOKEN, "Error during download of Bundle Library.");
                }
                else if (null == download_async_tracker.DownloadDataCompletedEventArgs.Result)
                {
                    MessageBoxes.Error(download_async_tracker.DownloadDataCompletedEventArgs.Error, "There was an error during the download of your Bundle Library.  Please try again later or contact {0} for more information.", manifest.SupportEmail);
                    StatusManager.Instance.UpdateStatus(STATUS_TOKEN, "Error during download of Bundle Library.");
                }
                else
                {
                    StatusManager.Instance.UpdateStatus(STATUS_TOKEN, "Completed download of Bundle Library.");
                    if (MessageBoxes.AskQuestion("The Bundle Library named '{0}' has been downloaded.  Do you want to install it now?", manifest.Title))
                    {
                        LibraryBundleInstaller.Install(manifest, download_async_tracker.DownloadDataCompletedEventArgs.Result);
                    }
                    else
                    {
                        MessageBoxes.Warn("Not installing Bundle Library.");
                    }
                }
            }
        }
예제 #26
0
 public void Reset()
 {
     try
     {
         List <ItemViewModel> l = new List <ItemViewModel>();
         ItemViewModel        ivm;
         foreach (var item in order.Cart.PrescriptionGlasses)
         {
             ivm = new ItemViewModel(item.Prescription)
             {
                 Id = item.PrescriptionGlasses.ProductId, Name = item.PrescriptionGlasses.Name, Price = item.ItemTotal, Quantity = item.Quantity
             };
             l.Add(ivm);
         }
         foreach (var item in order.Cart.Sunglasses)
         {
             ivm = new ItemViewModel()
             {
                 Id = item.Sunglasses.ProductId, Name = item.Sunglasses.Name, Price = item.ItemTotal, Quantity = item.Quantity
             };
             l.Add(ivm);
         }
         BindingSource itemsBinding = new BindingSource();
         itemsBinding.DataSource         = l;
         itemsBinding.Sort               = "Name";
         dataItemsLst.DataSource         = itemsBinding;
         dataItemsLst.Columns[4].Visible = false;
         txtCity.Text            = order.Cart.Buyer.City.Name;
         txtDeliveryCharges.Text = decimal.Round(order.Cart.Buyer.City.DeliverCharges).ToString();
         txtOrderId.Text         = order.OrderId.ToString();
         txtPromoDiscount.Text   = "% " + order.Promo.Discount.ToString();
         txtAddress.Text         = order.Cart.Buyer.Address;
         txtName.Text            = order.Cart.Buyer.Name;
         txtTotalPrice.Text      = decimal.Round(order.TotalPrice).ToString();
         decimal gTotal = Convert.ToInt32(txtDeliveryCharges.Text) + order.GetDiscountedPrice();
         txtGTotal.Text = gTotal.ToString();
         if (order.Status.Contains("PENDING"))
         {
             btnStatus.Text = "IN PROGRESS";
         }
         else if (order.Status.Contains("IN PROGRESS"))
         {
             btnStatus.Text = "DISPATCHED";
         }
         else if (order.Status.Contains("DISPATCHED"))
         {
             btnStatus.Enabled = false;
         }
     }
     catch (InvalidCastException)
     {
     }
     catch (Exception ex)
     {
         MessageBoxes.Error(ex.Message);
     }
 }
        // Объединение терриконов.
        private void btOK_Click(object sender, EventArgs e)
        {
            try
            {
                if (Check())         // Проверка кол-ва выбранных терриконов и их масс.
                {
                    if (CheckData()) // Проверка - все ли параметры результирующего террикона заполнены.
                    {
                        // Формирование списка параметров результирующего террикона
                        // (в данный террикон будет произведено слияние).
                        NameHeap   = tbName.Text.Trim();                              // Название террикона;
                        MaterialId = (int?)itbMaterial.SelectedValue;                 // материал;
                        FractionId = (int?)itbFraction.SelectedValue;                 // фракция;
                        PlaceId    = (int?)itbPlace.SelectedValue;                    // месторасположение;
                        OwnerId    = (int?)itbOwner.SelectedValue;                    // цех - владелец;
                        Note       = tbNote.Text.Trim();                              // примечание.

                        // Получаем список GUID'ов выбранных терриконов для объединения.
                        if (dts.Rows != null)
                        {
                            // Список ID "прочеканных" терриконов.
                            var ids = new List <int>(igMain.CheckedRowsIDs);

                            if (ids.Count > 0)
                            {
                                cHeapGUIDList = "";
                                // Цикл по строкам главного грида с терриконами.
                                foreach (DataRow row in dts.Rows)
                                {
                                    // Цикл по списку ID "прочеканных" терриконов.
                                    for (int i = 0; i < ids.Count; i++)
                                    {
                                        // Если террикон из главного грида – выбран,
                                        // добавляем его GUID в строковую переменную.
                                        if (row.Field <int>("nHeapId").Equals(ids[i]))
                                        {
                                            cHeapGUIDList += row.Field <Guid>("nGUID").ToString().ToUpper() + ",";
                                        }
                                    }
                                }
                                // Удаление последней запятой.
                                cHeapGUIDList = cHeapGUIDList.Remove(cHeapGUIDList.Length - 1, 1);
                            }
                        }

                        DialogResult = DialogResult.OK;
                    }
                }
            }
            catch (Exception ex)
            {
                // public class MessageBoxes from Itm.WClient.Com;
                MessageBoxes.Error(this, ex, "Ошибка объединения терриконов!");
                return;
            }
        }
예제 #28
0
        private void HyperlinkDelete_OnClick(object sender, MouseButtonEventArgs e)
        {
            WebLibraryDetail web_library_detail = DataContext as WebLibraryDetail;

            if (null != web_library_detail)
            {
                MessageBoxes.Error("Sorry!\n\nMethod has not been implemented yet!");
            }
            e.Handled = true;
        }
 private void ButtonRegenerate_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Regenerate();
     }
     catch (OutOfMemoryException)
     {
         MessageBoxes.Error("The pivot that you have requested requires too much memory to be calculated.  Please try a smaller analysis.");
     }
 }
예제 #30
0
 void FileSystemNodeContentControl_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         Process.Start(fsnc.path);
     }
     catch (Exception ex)
     {
         MessageBoxes.Error(ex, "There was a problem launching your application");
     }
 }