Beispiel #1
0
        private void InnerDocumentsList_DeleteClicked(object sender, int DocumentID, int DocumentCategoryID)
        {
            if (InfiniumDocuments.IsAccessGrantedInner(Security.CurrentUserID, DocumentID) == false)
            {
                InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав для изменения документа", 3600);
                return;
            }

            bool OK = LightMessageBox.Show(ref TopForm, true,
                                           "Удалить выбранный документ?", "Удаление");

            if (!OK)
            {
                return;
            }

            CoverDocumentsList();

            InfiniumDocuments.RemoveInnerDocument(DocumentID);
            InfiniumDocuments.FillInnerDocuments(GetFilter());
            InnerDocumentsList.InitializeItems();

            if (bNeedSplash)
            {
                bC = true;
            }
        }
Beispiel #2
0
        private void btnSavePatina_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < dgvPatina.Rows.Count; i++)
            {
                if (dgvPatina.Rows[i].IsNewRow)
                {
                    continue;
                }
                if (dgvPatina.Rows[i].Cells["DisplayName"].FormattedValue.ToString().Length == 0)
                {
                    LightMessageBox.Show(ref TopForm, false, "Патина: Поле \"Отображаемое имя\" должно быть заполнено", "Ошибка сохранения");
                    return;
                }
            }
            for (int i = 0; i < dgvPatinaRal.Rows.Count; i++)
            {
                if (dgvPatinaRal.Rows[i].IsNewRow)
                {
                    continue;
                }
                if (dgvPatinaRal.Rows[i].Cells["DisplayName"].FormattedValue.ToString().Length == 0)
                {
                    LightMessageBox.Show(ref TopForm, false, "Патина RAL: Поле \"Отображаемое имя\" должно быть заполнено", "Ошибка сохранения");
                    return;
                }
            }

            Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Сохранение данных.\r\nПодождите..."); });

            T.Start();
            while (!SplashWindow.bSmallCreated)
            {
                ;
            }

            try
            {
                PManager.SavePatina();
                PManager.SavePatinaRal();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                while (SplashWindow.bSmallCreated)
                {
                    SmallWaitForm.CloseS = true;
                }
                InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700);
            }
        }
Beispiel #3
0
        private void NavigateMenuCloseButton_Click(object sender, EventArgs e)
        {
            if (bShow)
            {
                bool OK = LightMessageBox.Show(ref TopForm, true,
                                               "Для возврата к альбомам нажмите кнопку \"Назад\" слева вверху, или нажмите OK чтобы закрыть модуль", "");

                if (!OK)
                {
                    return;
                }
            }

            FormEvent            = eClose;
            AnimateTimer.Enabled = true;
        }
        private void kryptonContextMenuItem5_Click(object sender, EventArgs e)
        {
            if (dgvComplaints.SelectedRows.Count == 0)
            {
                return;
            }

            bool bOkCancel = LightMessageBox.Show(ref TopForm, true,
                                                  "Подтвердить?",
                                                  "Подтверждение рекламации");

            if (!bOkCancel)
            {
                return;
            }

            Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Подтверждение рекламации.\r\nПодождите..."); });

            T.Start();

            while (!SplashWindow.bSmallCreated)
            {
                ;
            }

            int ComplaintID = 0;

            if (dgvComplaints.SelectedRows.Count > 0 && dgvComplaints.SelectedRows[0].Cells["ComplaintID"].Value != DBNull.Value)
            {
                ComplaintID = Convert.ToInt32(dgvComplaints.SelectedRows[0].Cells["ComplaintID"].Value);
            }
            ComplaintsManager.ConfirmComplaint(ComplaintID, true, 100);
            ComplaintsManager.GetComplaints();
            ComplaintsManager.MoveToComplaint(ComplaintID);

            while (SplashWindow.bSmallCreated)
            {
                SmallWaitForm.CloseS = true;
            }
        }
Beispiel #5
0
        private void kryptonContextMenuItem2_Click(object sender, EventArgs e)
        {
            int ManagerID = 0;

            if (dgvManagers.SelectedRows.Count != 0 && dgvManagers.SelectedRows[0].Cells["ManagerID"].Value != DBNull.Value)
            {
                ManagerID = Convert.ToInt32(dgvManagers.SelectedRows[0].Cells["ManagerID"].Value);
            }
            if (ManagerID != 0 && ClientsManagers.IsUserClientManager(ManagerID))
            {
                LightMessageBox.Show(ref TopForm, false, "Удаление запрещено, так как у менеджера есть клиенты. Для удаления открепите менеджера от всех клиентов", "Отмена");
                return;
            }
            bool OKCancel = Infinium.LightMessageBox.Show(ref TopForm, true,
                                                          "Удалить позицию?",
                                                          "Удаление");

            if (OKCancel)
            {
                ClientsManagers.RemoveManager();
            }
        }
Beispiel #6
0
        private void DocumentsUpdatesList_DeleteCommentClicked(object sender, int DocumentCommentID)
        {
            bool OK = LightMessageBox.Show(ref TopForm, true,
                                           "Удалить комментарий?", "Удаление");

            if (!OK)
            {
                return;
            }

            CoverUpdatesList();

            InfiniumDocuments.RemoveComment(DocumentCommentID);
            FillUpdates();
            DocumentsUpdatesList.InitializeItems();
            GC.Collect();


            if (bNeedSplash)
            {
                bC = true;
            }
        }
Beispiel #7
0
        private void DocumentsUpdatesList_ConfirmDeleteClicked(object sender, int DocumentConfirmationID)
        {
            bool OK = LightMessageBox.Show(ref TopForm, true,
                                           "Удалить запрос подтверждения?", "Удаление");

            if (!OK)
            {
                return;
            }

            CoverUpdatesList();

            InfiniumDocuments.DeleteConfirm(DocumentConfirmationID);

            FillUpdates();

            DocumentsUpdatesList.InitializeItems();

            if (bNeedSplash)
            {
                bC = true;
            }
        }
Beispiel #8
0
        private void MenuFileSaveFile_Click(object sender, EventArgs e)
        {
            if (InfiniumFileList.CheckVisible == false)
            {
                SaveFileDialog.Filter = "(*" + Path.GetExtension(InfiniumFileList.FileItems[InfiniumFileList.Selected].Caption) + ")|*" +
                                        Path.GetExtension(InfiniumFileList.FileItems[InfiniumFileList.Selected].Caption);
                SaveFileDialog.FileName = InfiniumFileList.FileItems[InfiniumFileList.Selected].Caption;

                if (SaveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    PhantomForm PhantomForm = new PhantomForm();
                    PhantomForm.Show();

                    UploadFileForm UploadFileForm = new UploadFileForm(ref InfiniumFiles.FM, ref InfiniumFiles,
                                                                       InfiniumFileList.FileItems[InfiniumFileList.Selected].Caption,
                                                                       InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID,
                                                                       InfiniumFileList.FileItems[InfiniumFileList.Selected].FileID,
                                                                       true, SaveFileDialog.FileName, ref TopForm);

                    TopForm = UploadFileForm;

                    UploadFileForm.ShowDialog();

                    if (UploadFileForm.bOk == 0)
                    {
                        InfiniumTips.ShowTip(this, 50, 85, "Отсутствует файл либо нет доступа к интернет", 5000);
                    }

                    PhantomForm.Close();
                    PhantomForm.Dispose();

                    TopForm = null;
                    UploadFileDialog.Dispose();
                }
            }
            else
            {
                int r = InfiniumFiles.CheckCheckedItems(InfiniumFileList.ItemsDataTable);

                if (r == -2)
                {
                    bool OK = LightMessageBox.Show(ref TopForm, true,
                                                   "Копирование папок не поддерживается, скопируются только выбранные файлы. Продолжить?", "Копирование файла");

                    if (!OK)
                    {
                        return;
                    }
                }

                if (r == -1)
                {
                    LightMessageBox.Show(ref TopForm, false,
                                         "Копирование папок не поддерживается.", "Копирование файла");

                    return;
                }

                if (r == 0)
                {
                    InfiniumTips.ShowTip(this, 50, 85, "Выберите один или несколько файлов", 5600);

                    return;
                }



                if (FolderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    if (InfiniumFiles.CheckFilesExists(InfiniumFileList.ItemsDataTable, FolderBrowserDialog.SelectedPath))
                    {
                        bool OK = LightMessageBox.Show(ref TopForm, true,
                                                       "Файл с таким именем в указанной папке уже существует. Заменить?", "Копирование файла");

                        if (!OK)
                        {
                            return;
                        }
                    }

                    PhantomForm PhantomForm = new PhantomForm();
                    PhantomForm.Show();

                    UploadFileForm UploadFileForm = new UploadFileForm(ref InfiniumFiles.FM, ref InfiniumFiles, FolderBrowserDialog.SelectedPath,
                                                                       InfiniumFileList.ItemsDataTable, ref TopForm);

                    TopForm = UploadFileForm;

                    UploadFileForm.ShowDialog();

                    PhantomForm.Close();
                    PhantomForm.Dispose();

                    TopForm = null;
                    UploadFileDialog.Dispose();


                    if (InfiniumFileList.CheckVisible)
                    {
                        InfiniumFileList.CheckVisible = false;
                        CheckMultipleButton.BringToFront();
                    }
                }
            }
        }
Beispiel #9
0
        private void RemoveButton_Click(object sender, EventArgs e)
        {
            if (InfiniumFileList.Selected == -1)
            {
                return;
            }

            if (InfiniumFileList.FileItems[InfiniumFileList.Selected].Caption == "[...]")
            {
                return;
            }

            if (InfiniumFiles.CurrentItemsDataTable.Select("FolderID = " +
                                                           InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID)[0]["Extension"].ToString() == "folder")
            {
                if (InfiniumFiles.CheckFolderPermission(Security.CurrentUserID, InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID) == false)
                {
                    InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав", 3600);
                    return;
                }
            }
            else
            {
                if (InfiniumFiles.CanEditFile(Security.CurrentUserID, InfiniumFileList.FileItems[InfiniumFileList.Selected].FileID) == false)
                {
                    InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав", 3600);
                    return;
                }
            }



            if (InfiniumFileList.CheckVisible)
            {
                int r = InfiniumFiles.CheckCheckedItems(InfiniumFileList.ItemsDataTable);

                if (r == 0)
                {
                    InfiniumTips.ShowTip(this, 50, 85, "Выберите один или несколько файлов", 5600);

                    return;
                }

                bool OK = LightMessageBox.Show(ref TopForm, true,
                                               "Удалить выбранные файлы\\папки?", "Удаление");

                if (!OK)
                {
                    return;
                }

                InfiniumFiles.RemoveFolder(InfiniumFileList.ItemsDataTable);
                InfiniumFiles.RemoveFile(InfiniumFileList.ItemsDataTable);
            }
            else
            {
                if (InfiniumFileList.Selected > -1)
                {
                    bool OK = LightMessageBox.Show(ref TopForm, true,
                                                   "Удалить?", "Удаление");

                    if (!OK)
                    {
                        return;
                    }

                    if (InfiniumFiles.CurrentItemsDataTable.Select("FolderID = " +
                                                                   InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID)[0]["Extension"].ToString() == "folder")
                    {
                        if (InfiniumFiles.RemoveFolder(InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID) == false)
                        {
                            InfiniumTips.ShowTip(this, 50, 85, "Ошибка удаления папки с хостинга", 4000);
                        }
                    }
                    else
                    {
                        InfiniumFiles.RemoveFile(InfiniumFileList.FileItems[InfiniumFileList.Selected].FileID,
                                                 InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID,
                                                 InfiniumFileList.FileItems[InfiniumFileList.Selected].Caption);
                    }
                }
            }


            Thread T = new Thread(delegate()
            {
                SplashWindow.CreateCoverSplash(InfiniumFileList.Top + UpdatePanel.Top, InfiniumFileList.Left + UpdatePanel.Left,
                                               InfiniumFileList.Height, InfiniumFileList.Width);
            });

            T.Start();

            while (!SplashWindow.bSmallCreated)
            {
                ;
            }


            InfiniumFiles.EnterFolder(InfiniumFileList.Entered);

            InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable;
            InfiniumFileList.EnterInFolder(InfiniumFileList.Entered);


            if (InfiniumFileList.CheckVisible)
            {
                InfiniumFileList.CheckVisible = false;
                CheckMultipleButton.BringToFront();
            }

            bC = true;
        }
Beispiel #10
0
        private void SendMailButton_Click(object sender, EventArgs e)
        {
            int i = -1;

            if (InfiniumFileList.Selected == -1)
            {
                InfiniumTips.ShowTip(this, 50, 85, "Не выбран клиент", 3000);
                return;
            }


            PhantomForm PhantomForm = new Infinium.PhantomForm();

            PhantomForm.Show();

            LightMessageBoxForm LightMessageBoxForm = new Infinium.LightMessageBoxForm(true, "Прикрепить к уведомлению файлы?",
                                                                                       "Уведомление клиенту");

            TopForm = LightMessageBoxForm;

            LightMessageBoxForm.ShowDialog();

            TopForm = null;

            PhantomForm.Close();
            PhantomForm.Dispose();

            if (LightMessageBoxForm.OKCancel)
            {
                openFileDialog1.ShowDialog();
            }

            if (InfiniumFileList.Entered == 4)
            {
                i = InfiniumFiles.GetCurrentClientFolder(InfiniumFileList.FileItems[InfiniumFileList.Selected].FolderID);
            }
            else
            {
                i = InfiniumFiles.GetCurrentClientFolder(InfiniumFileList.Entered);
            }

            if (i == -1)
            {
                InfiniumTips.ShowTip(this, 50, 85, "Невозможно определить клиента", 4000);
                return;
            }

            string r = InfiniumFiles.SendEmailNotifyClient(i, openFileDialog1.FileNames);

            if (r == "-1")
            {
                LightMessageBox.Show(ref TopForm, false, "У клиента не указан Email", "Уведомление");
                //InfiniumTips.ShowTip(this, 50, 85, "У клиента не указан Email", 3000);
                return;
            }
            else
            if (r == "1")
            {
                LightMessageBox.Show(ref TopForm, false, "Уведомление успешно отправлено", "Уведомление");
                //InfiniumTips.ShowTip(this, 50, 85, "Уведомление успешно отправлено", 3000);
                return;
            }
            else
            {
                LightMessageBox.Show(ref TopForm, false, r, "Уведомление");
                //InfiniumTips.ShowTip(this, 50, 85, "Не подключения к интернет", 3000);
                return;
            }
        }
Beispiel #11
0
 private void SaveImageButton_Click(object sender, EventArgs e)
 {
     AdminDepartmentsEdit.SetDepartmentPhoto(PhotoBox.Image, iDepartmentID);
     LightMessageBox.Show(ref TopForm, false, "Аватар успешно сохранен", "Сохранение");
 }