Beispiel #1
0
        private void SaveImageButton_Click(object sender, EventArgs e)
        {
            DecorCatalog.SetDecorProductPicture(pbFullImage.Image, ProductID);

            if (pbFullImage.Image != null)
            {
                MemoryStream ms = new MemoryStream();

                ImageCodecInfo ImageCodecInfo            = UserProfile.GetEncoderInfo("image/jpeg");
                System.Drawing.Imaging.Encoder eEncoder1 = System.Drawing.Imaging.Encoder.Quality;

                EncoderParameter  myEncoderParameter1 = new EncoderParameter(eEncoder1, 100L);
                EncoderParameters myEncoderParameters = new EncoderParameters(1);

                myEncoderParameters.Param[0] = myEncoderParameter1;

                pbFullImage.Image.Save(ms, ImageCodecInfo, myEncoderParameters);

                //FrontsCatalog.ConstFrontsDataTable.Select("FrontID = " + FrontID)[0]["Picture"] = ms.ToArray();
                ms.Dispose();
            }
            InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700);
            //else
            //    FrontsCatalog.ConstFrontsDataTable.Select("FrontID = " + FrontID)[0]["Picture"] = DBNull.Value;
        }
Beispiel #2
0
        private void btnSaveError_Click(object sender, EventArgs e)
        {
            int ClientErrorsWriteOffID = 0;

            if (dgvClientErrors.SelectedRows.Count != 0 && dgvClientErrors.SelectedRows[0].Cells["ClientErrorsWriteOffID"].Value != DBNull.Value)
            {
                ClientErrorsWriteOffID = Convert.ToInt32(dgvClientErrors.SelectedRows[0].Cells["ClientErrorsWriteOffID"].Value);
            }
            bool   bShowAllErrors = cbShowAllErrors.Checked;
            object DateFrom       = CalendarFrom.SelectionEnd;
            object DateTo         = CalendarTo.SelectionEnd;

            ClientErrorsWriteOffs.SaveClientErrors();
            ClientErrorsWriteOffs.UpdateClientErrors(bShowAllErrors, DateFrom, DateTo);
            ClientErrorsWriteOffs.MoveToClientError(ClientErrorsWriteOffID);
            InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700);

            decimal ErrorsSumCost = 0;

            for (int i = 0; i < dgvClientErrors.Rows.Count; i++)
            {
                if (dgvClientErrors.Rows[i].Cells["Cost"].Value != DBNull.Value)
                {
                    ErrorsSumCost += Convert.ToDecimal(dgvClientErrors.Rows[i].Cells["Cost"].Value);
                }
            }
            label2.Text = "Общая сумма: " + ErrorsSumCost + " €";
        }
Beispiel #3
0
        private void IncomeDocumentsList_EditClicked(object sender, int DocumentID, int DocumentCategoryID)
        {
            if (InfiniumDocuments.IsAccessGrantedIncome(Security.CurrentUserID, DocumentID) == false)
            {
                InfiniumTips.ShowTip(this, 50, 85, "Недостаточно прав для изменения документа", 3600);
                return;
            }

            PhantomForm PhantomForm = new PhantomForm();

            PhantomForm.Show();

            CreateIncomeDocumentForm CreateDocumentForm = new CreateIncomeDocumentForm(ref TopForm, ref InfiniumDocuments, DocumentID);

            TopForm = CreateDocumentForm;

            CreateDocumentForm.ShowDialog();

            InfiniumDocuments.FillIncomeDocuments(GetFilter());
            IncomeDocumentsList.InitializeItems();

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

            TopForm = null;
        }
Beispiel #4
0
        private void cmiBindToPermit_Click(object sender, EventArgs e)
        {
            if (UnloadDataGrid.SelectedRows.Count == 0)
            {
                return;
            }
            Thread T = new Thread(delegate() { SplashWindow.CreateSplash(); });

            T.Start();

            while (!SplashForm.bCreated)
            {
                ;
            }

            bool        BindingOk   = false;
            int         UnloadID    = Convert.ToInt32(UnloadDataGrid.SelectedRows[0].Cells["UnloadID"].Value);
            PermitsForm PermitsForm = new PermitsForm(this, UnloadID);

            TopForm = PermitsForm;

            PermitsForm.ShowDialog();
            BindingOk = PermitsForm.BindingOk;
            PermitsForm.Close();
            PermitsForm.Dispose();

            TopForm = null;
            if (BindingOk)
            {
                InfiniumTips.ShowTip(this, 50, 85, "Привязка выполнена", 1700);
            }
        }
Beispiel #5
0
        private void btnSignPermit_Click(object sender, EventArgs e)
        {
            if (dgvPermits.SelectedRows.Count == 0)
            {
                return;
            }
            int PermitID = Convert.ToInt32(dgvPermits.SelectedRows[0].Cells["PermitID"].Value);

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

            T.Start();

            while (!SplashWindow.bSmallCreated)
            {
                ;
            }
            NeedSplash = false;

            PermitsManager.SignPermit(PermitID);
            PermitsManager.SavePermits();
            UpdatePermits();
            PermitsManager.MoveToPermit(PermitID);

            NeedSplash = true;
            while (SplashWindow.bSmallCreated)
            {
                SmallWaitForm.CloseS = true;
            }
            InfiniumTips.ShowTip(this, 50, 85, "Пропуск утвержден", 1700);
        }
Beispiel #6
0
        private void MenuFileOpenFile_Click(object sender, EventArgs e)
        {
            if (InfiniumFileList.FileItems[InfiniumFileList.Selected].FileID != -1)
            {
                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,
                                                                   false, "", ref TopForm);

                TopForm = UploadFileForm;

                UploadFileForm.ShowDialog();

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

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

                TopForm = null;
                UploadFileDialog.Dispose();
            }
        }
Beispiel #7
0
        private void CreateButton_Click(object sender, EventArgs e)
        {
            if (NameTextBox.Text.Length == 0)
            {
                InfiniumTips.ShowTip(this, 50, 85, "Введите название", 2600);
                return;
            }

            if (ContractorID > -1)
            {
                Contractors.EditContractor(ContractorID, NameTextBox.Text, EmailTextBox.Text, WEBSiteTextBox.Text, AddressTextBox.Text, FacebookTextBox.Text,
                                           SkypeTextBox.Text, Convert.ToInt32(CountryComboBox.SelectedValue), Convert.ToInt32(CityComboBox.SelectedValue),
                                           UNNTextBox.Text, DescriptionTextBox.Text, Convert.ToInt32(CategoriesComboBox.SelectedValue),
                                           Convert.ToInt32(SubCategoriesComboBox.SelectedValue), ContactsDataTable);
            }
            else
            {
                if (Contractors.AddContractor(NameTextBox.Text, EmailTextBox.Text, WEBSiteTextBox.Text, AddressTextBox.Text, FacebookTextBox.Text,
                                              SkypeTextBox.Text, Convert.ToInt32(CountryComboBox.SelectedValue), Convert.ToInt32(CityComboBox.SelectedValue),
                                              UNNTextBox.Text, DescriptionTextBox.Text, Convert.ToInt32(CategoriesComboBox.SelectedValue),
                                              Convert.ToInt32(SubCategoriesComboBox.SelectedValue), ContactsDataTable) == false)
                {
                    InfiniumTips.ShowTip(this, 50, 85, "Контрагент с таким именем уже существует", 4600);
                    return;
                }
            }

            FormEvent            = eClose;
            AnimateTimer.Enabled = true;
        }
        private void OKFolderButton_Click(object sender, EventArgs e)
        {
            string res = FolderNameTextBox.Text.Trim();

            //check symbols
            {
                if (res.IndexOf(@"*") > -1 || res.IndexOf(@"/") > -1 ||
                    res.IndexOf(@"\") > -1 || res.IndexOf(@"|") > -1 ||
                    res.IndexOf(@"?") > -1 ||
                    res.IndexOf(@":") > -1 || res.IndexOf(@"<") > -1 ||
                    res.IndexOf(@">") > -1 || res.IndexOf(@"[") > -1 || res.IndexOf(@"]") > -1)
                {
                    InfiniumTips.ShowTip(this, 50, 85, "Название папки содержит недопустимые символы", 2600);
                    return;
                }
            }

            if (res.Length == 0)
            {
                InfiniumTips.ShowTip(this, 50, 85, "Название папки не может быть пустым", 2600);
                return;
            }

            //check exists
            if (InfiniumDocuments.CurrentItemsDataTable.Select("Extension = 'folder'" + " AND ItemName = '" + res + "'").Count() > 0)
            {
                InfiniumTips.ShowTip(this, 50, 85, "Папка с таким именем уже существует", 2600);
                return;
            }

            FolderName = res;

            FormEvent            = eClose;
            AnimateTimer.Enabled = true;
        }
Beispiel #9
0
        private void btnSaveManagers_Click(object sender, EventArgs e)
        {
            Thread T = new Thread(delegate() { SplashWindow.CreateSmallSplash(ref TopForm, "Сохранение данных.\r\nПодождите..."); });

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

            try
            {
                ClientsManagers.SaveManagers();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                while (SplashWindow.bSmallCreated)
                {
                    SmallWaitForm.CloseS = true;
                }
                InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700);
            }
        }
Beispiel #10
0
        private void AddTechStoreToStoreDetailButton_Click(object sender, EventArgs e)
        {
            TechStoreIDArray.Clear();
            IsHalfStuff1Array.Clear();
            LengthArray.Clear();
            HeightArray.Clear();
            WidthArray.Clear();
            for (int i = 0; i < ItemsDataGrid.SelectedRows.Count; i++)
            {
                TechStoreIDArray.Add(Convert.ToInt32(ItemsDataGrid.SelectedRows[i].Cells["TechStoreID"].Value));
                IsHalfStuff1Array.Add(ItemsDataGrid.SelectedRows[i].Cells["IsHalfStuff"].Value);
                LengthArray.Add(ItemsDataGrid.SelectedRows[i].Cells["Length"].Value);
                HeightArray.Add(ItemsDataGrid.SelectedRows[i].Cells["Height"].Value);
                WidthArray.Add(ItemsDataGrid.SelectedRows[i].Cells["Width"].Value);
            }
            if (TechStoreIDArray.Count == 0)
            {
                return;
            }

            int[]    TechStoreID  = TechStoreIDArray.OfType <int>().Distinct().ToArray();
            object[] IsHalfStuff1 = IsHalfStuff1Array.OfType <object>().ToArray();
            object[] Length       = LengthArray.OfType <object>().ToArray();
            object[] Height       = HeightArray.OfType <object>().ToArray();
            object[] Width        = WidthArray.OfType <object>().ToArray();

            TechStoreManager.AddTechCatalogStoreDetail(TechCatalogOperationsDetailID, TechStoreID, IsHalfStuff1, Length, Height, Width);
            InfiniumTips.ShowTip(this, 50, 85, "Добавлено в материалы", 1700);
        }
        private void btnDeleteStaff_Click(object sender, EventArgs e)
        {
            bool OKCancel = Infinium.LightMessageBox.Show(ref TopForm, true,
                                                          "Вместе с этой будут удалены и связанные с ней обязанности. Продолжить удаление?",
                                                          "Удаление позиции");

            if (!OKCancel)
            {
                return;
            }

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

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

            StaffListManager.DeleteStaffFunctions(Convert.ToInt32((dgvStaffList.SelectedRows[0].Cells["StaffListID"].Value)));
            StaffListManager.DeleteStaff(Convert.ToInt32((dgvStaffList.SelectedRows[0].Cells["StaffListID"].Value)));

            while (SplashWindow.bSmallCreated)
            {
                SmallWaitForm.CloseS = true;
            }

            InfiniumTips.ShowTip(this, 50, 85, "Удалено", 1700);
        }
        private void btnDenyPermit_Click(object sender, EventArgs e)
        {
            if (dgvPermits.SelectedRows.Count == 0 || dgvPermits.SelectedRows[0].Cells["MachinePermitID"].Value == DBNull.Value)
            {
                return;
            }

            int PermitID = Convert.ToInt32(dgvPermits.SelectedRows[0].Cells["MachinePermitID"].Value);

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

            T.Start();

            while (!SplashWindow.bSmallCreated)
            {
                ;
            }
            NeedSplash = false;

            PermitsManager.DenyOutput(PermitID);
            PermitsManager.SavePermits();
            UpdatePermits();

            NeedSplash = true;
            while (SplashWindow.bSmallCreated)
            {
                SmallWaitForm.CloseS = true;
            }
            InfiniumTips.ShowTip(this, 50, 85, "Выезд запрещен", 1700);
        }
Beispiel #13
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 #14
0
        private void dgvReturnedRollers_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            PercentageDataGrid senderGrid = (PercentageDataGrid)sender;

            if (senderGrid.SelectedRows.Count == 0)
            {
                return;
            }

            //if (senderGrid.Columns[e.ColumnIndex].Name == "Column1" && e.RowIndex >= 0)
            //{
            //    ProfileAssignmentsManager.ReturnRoller();
            //}
            if (senderGrid.Columns[e.ColumnIndex].Name == "Column2" && e.RowIndex >= 0)
            {
                bool OKCancel = Infinium.LightMessageBox.Show(ref TopForm, true,
                                                              "Продолжить?",
                                                              "Удаление");

                if (!OKCancel)
                {
                    return;
                }
                ProfileAssignmentsManager.RemoveReturnedRoller();
                ProfileAssignmentsManager.SaveTransferredRollers();
                ProfileAssignmentsManager.GetTransferredRollers(DecorAssignmentID);
                ProfileAssignmentsManager.GetRollersInColorOnStorage(CoverID);
                InfiniumTips.ShowTip(this, 50, 85, "Удалено", 1700);
            }
        }
        private void label3_Click(object sender, EventArgs e)
        {
            //LightMessage.SendMessage(321, "Нужен доступ к модулю " + Tile.Name);
            //LightMessage.SendMessage(322, "Нужен доступ к модулю " + Tile.Name);

            InfiniumTips.ShowTip(this, 50, 85, "Запрос отправлен. Администратор свяжется с Вами. Спасибо", 7000);
            return;
        }
Beispiel #16
0
        private void AddTechSubGroupToStoreDetailButton_Click(object sender, EventArgs e)
        {
            int TechSubGroupID = Convert.ToInt32(SubGroupsDataGrid.SelectedRows[0].Cells["TechStoreSubGroupID"].Value);

            TechStoreManager.AddTechCatalogStoreDetail(TechCatalogOperationsDetailID, TechSubGroupID);

            InfiniumTips.ShowTip(this, 50, 85, "Добавлено в материалы", 1700);
        }
Beispiel #17
0
        private void btnEnd_Click(object sender, EventArgs e)
        {
            if (dgvWorks.SelectedRows.Count == 0)
            {
                return;
            }
            bool OKCancel = Infinium.LightMessageBox.Show(ref _topForm, true,
                                                          "Вы собираетесь завершить работу. Продолжить?",
                                                          "Завершение");

            if (!OKCancel)
            {
                return;
            }

            int PlannedWorkID = 0;

            if (dgvWorks.SelectedRows[0].Cells["PlannedWorkID"].Value != DBNull.Value)
            {
                PlannedWorkID = Convert.ToInt32(dgvWorks.SelectedRows[0].Cells["PlannedWorkID"].Value);
            }
            if (PlannedWorkID == 0)
            {
                return;
            }

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

                while (!SplashWindow.bSmallCreated)
                {
                    ;
                }
                NeedSplash = false;

                _plannedWorkManager.End(PlannedWorkID);
                _plannedWorkManager.SaveWorks();
                UpdateWorks();
                _plannedWorkManager.MoveToPosition(PlannedWorkID);

                NeedSplash = true;
                while (SplashWindow.bSmallCreated)
                {
                    SmallWaitForm.CloseS = true;
                }
            }
            else
            {
                _plannedWorkManager.End(PlannedWorkID);
                _plannedWorkManager.SaveWorks();
                UpdateWorks();
                _plannedWorkManager.MoveToPosition(PlannedWorkID);
            }
            InfiniumTips.ShowTip(this, 50, 85, "Работа завершена", 1700);
        }
Beispiel #18
0
        private void MenuFileReplaceFile_Click(object sender, EventArgs e)
        {
            if (InfiniumFiles.CheckFileVersion(InfiniumFileList.FileItems[InfiniumFileList.Selected].FileID, Security.CurrentUserID) == false)
            {
                InfiniumTips.ShowTip(this, 50, 85, "Файл был кем-то изменен. Замена файла не возможна. Скачайте файл заново, \n" +
                                     "примените свои изменения, а затем попытайтесь заменить еще раз", 7600);
                return;
            }

            if (InfiniumFiles.CheckUploadPending(InfiniumFileList.FileItems[InfiniumFileList.Selected].FileID))//someone uploads
            {
                InfiniumTips.ShowTip(this, 50, 85, "В настоящее время указанный файл уже обновляется кем-то. Замена файла не возможна. \n" +
                                     "Скачайте файл заново, примените свои изменения, а затем попытайтесь заменить еще раз", 7600);
                return;
            }

            if (UploadFileDialog.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].FileID,
                                                                   UploadFileDialog.FileName, ref TopForm);

                TopForm = UploadFileForm;

                UploadFileForm.ShowDialog();

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

                TopForm = null;
                UploadFileDialog.Dispose();
            }


            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;

            bC = true;
        }
Beispiel #19
0
        private void InfiniumFileList_ItemDoubleClick(object sender, int FolderID, int FileID)
        {
            if (FileID > -1)//open file
            {
                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,
                                                                   false, "", ref TopForm);

                TopForm = UploadFileForm;

                UploadFileForm.ShowDialog();

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

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

                TopForm = null;
                UploadFileDialog.Dispose();

                return;
            }

            if (FolderID != -1)
            {
                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(FolderID);

                InfiniumFileList.ItemsDataTable = InfiniumFiles.CurrentItemsDataTable.Copy();

                InfiniumFileList.EnterInFolder(FolderID);
                InfiniumFileList.Entered = FolderID;

                bC = true;
            }
        }
        private void kryptonButton1_Click(object sender, EventArgs e)
        {
            if (bEdit)
            {
                StorageItemsManager.SaveChangesToStoreDetail();
                StorageItemsManager.SaveEditItems();
            }

            InfiniumTips.ShowTip(this, 50, 85, "Связанные конфигурации изменены", 1700);
        }
Beispiel #21
0
        private void InfiniumDocumentAttributesView_ReadButtonClicked(object sender, int UserID, int FileID)
        {
            if (Security.CheckAuthNull() == true)
            {
                InfiniumTips.ShowTip(this, 50, 85, "Авторизационный код отсутствует. Создайте авторизационный\n" +
                                     "код на вкладке \"Сменить пароль\" в настройках Infinium", 10000);
                return;
            }



            PhantomForm PhantomForm = new PhantomForm();

            PhantomForm.Show();

            AuthorizationForm AuthorizationForm = new AuthorizationForm(ref TopForm);

            TopForm = AuthorizationForm;

            AuthorizationForm.ShowDialog();

            if (AuthorizationForm.bCanceled)
            {
                PhantomForm.Close();
                PhantomForm.Dispose();

                TopForm = null;
            }
            else
            {
                PhantomForm.Close();
                PhantomForm.Dispose();

                TopForm = null;


                InfiniumFiles.SignReadFile(FileID, UserID);

                InfiniumFiles.FillAttributes(FileID);

                InfiniumDocumentAttributesView.AttributesDataTable = InfiniumFiles.CurrentAttributesDataTable;
                InfiniumDocumentAttributesView.SignsDT             = InfiniumFiles.CurrentSignsDataTable;
                InfiniumDocumentAttributesView.ReadListDT          = InfiniumFiles.CurrentReadDataTable;
                InfiniumDocumentAttributesView.InitializeItems();

                //int iSC = InfiniumDocuments.GetSignCount(Security.CurrentUserID);

                //if (iSC > 0)
                //    SignFilesLabel.Text = "На подпись (" + iSC.ToString() + ")";
                //else
                //    SignFilesLabel.Text = "На подпись";

                InfiniumTips.ShowTip(this, 50, 85, "Подписано", 4000);
            }
        }
        private void AddDepartmentButton_Click(object sender, EventArgs e)
        {
            if (NewDepartmentTextBox.Text.Length == 0)
            {
                return;
            }

            AdminDepartmentsEdit.AddDepartment(NewDepartmentTextBox.Text);

            InfiniumTips.ShowTip(this, 50, 85, "Отдел добавлен", 1700);
        }
Beispiel #23
0
        private void btnRemoveWork_Click(object sender, EventArgs e)
        {
            if (dgvWorks.SelectedRows.Count == 0)
            {
                return;
            }

            bool OKCancel = Infinium.LightMessageBox.Show(ref _topForm, true,
                                                          "Продолжить удаление?",
                                                          "Удаление позиции");

            if (!OKCancel)
            {
                return;
            }

            if (NeedSplash)
            {
                Thread T =
                    new Thread(
                        delegate() { SplashWindow.CreateSmallSplash(ref _topForm, "Сохранение данных.\r\nПодождите..."); });
                T.Start();
                while (!SplashWindow.bSmallCreated)
                {
                    ;
                }
                NeedSplash = false;

                int PlannedWorkID = -1;
                if (dgvWorks.SelectedRows[0].Cells["PlannedWorkID"].Value != DBNull.Value)
                {
                    PlannedWorkID = Convert.ToInt32((dgvWorks.SelectedRows[0].Cells["PlannedWorkID"].Value));
                }
                _plannedWorkManager.RemoveWork();

                NeedSplash = true;
                while (SplashWindow.bSmallCreated)
                {
                    SmallWaitForm.CloseS = true;
                }
            }
            else
            {
                int PlannedWorkID = -1;
                if (dgvWorks.SelectedRows[0].Cells["PlannedWorkID"].Value != DBNull.Value)
                {
                    PlannedWorkID = Convert.ToInt32((dgvWorks.SelectedRows[0].Cells["PlannedWorkID"].Value));
                }
                _plannedWorkManager.RemoveWork();
            }

            InfiniumTips.ShowTip(this, 50, 85, "Удалено", 1700);
        }
Beispiel #24
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);
            }
        }
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (!bEdit)
            {
                StorageItemsManager.SaveNewItems();
            }
            else
            {
                StorageItemsManager.SaveEditItems();
            }

            InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700);
        }
Beispiel #26
0
 private void MenuAddToFavorite_Click(object sender, EventArgs e)
 {
     if (InfiniumStart.AddModuleToFavorite(CurFormName) == false)
     {
         InfiniumTips.ShowTip(this, 50, 85, "Модуль уже был добавлен ранее", 4000);
         return;
     }
     else
     {
         InfiniumTips.ShowTip(this, 50, 85, "Модуль добавлен", 2500);
         return;
     }
 }
Beispiel #27
0
        private void btnSaveWorks_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < dgvWorks.Rows.Count; i++)
            {
                if (dgvWorks.Rows[i].Cells["MachineID"].Value == DBNull.Value)
                {
                    Infinium.LightMessageBox.Show(ref _topForm, false,
                                                  "Не выбран станок", "Ошибка сохранения");
                    return;
                }
                if (dgvWorks.Rows[i].Cells["Description"].Value == DBNull.Value)
                {
                    Infinium.LightMessageBox.Show(ref _topForm, false,
                                                  "Нет описания", "Ошибка сохранения");
                    return;
                }
            }

            if (NeedSplash)
            {
                Thread T =
                    new Thread(
                        delegate() { SplashWindow.CreateSmallSplash(ref _topForm, "Сохранение данных.\r\nПодождите..."); });
                T.Start();
                while (!SplashWindow.bSmallCreated)
                {
                    ;
                }
                NeedSplash = false;

                _plannedWorkManager.SaveExecutors();
                _plannedWorkManager.SaveWorks();
                UpdateWorks();

                NeedSplash = true;
                while (SplashWindow.bSmallCreated)
                {
                    SmallWaitForm.CloseS = true;
                }
            }
            else
            {
                _plannedWorkManager.SaveExecutors();
                _plannedWorkManager.SaveWorks();
                UpdateWorks();
            }

            InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700);
        }
Beispiel #28
0
        private void dgvRollersInColor_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            PercentageDataGrid senderGrid = (PercentageDataGrid)sender;

            if (senderGrid.SelectedRows.Count == 0)
            {
                return;
            }

            if (senderGrid.Columns[e.ColumnIndex].Name == "Column1" && e.RowIndex >= 0)
            {
                bool OKSplit            = false;
                int  ManufactureStoreID = 0;
                int  NewCount           = 0;
                int  OldCount           = 0;

                if (senderGrid.SelectedRows[0].Cells["ManufactureStoreID"].Value != DBNull.Value)
                {
                    ManufactureStoreID = Convert.ToInt32(senderGrid.SelectedRows[0].Cells["ManufactureStoreID"].Value);
                }
                if (senderGrid.SelectedRows[0].Cells["CurrentCount"].Value != DBNull.Value)
                {
                    OldCount = Convert.ToInt32(senderGrid.SelectedRows[0].Cells["CurrentCount"].Value);
                }
                PhantomForm PhantomForm = new Infinium.PhantomForm();
                PhantomForm.Show();

                SplitAssignmentRequestMenu SplitAssignmentRequestMenu = new SplitAssignmentRequestMenu(true, OldCount);
                TopForm = SplitAssignmentRequestMenu;
                SplitAssignmentRequestMenu.ShowDialog();

                OKSplit  = SplitAssignmentRequestMenu.OKSplit;
                NewCount = SplitAssignmentRequestMenu.Count;

                PhantomForm.Close();
                PhantomForm.Dispose();
                SplitAssignmentRequestMenu.Dispose();
                TopForm = null;
                if (OKSplit)
                {
                    ProfileAssignmentsManager.AddTransferredRoller(DecorAssignmentID, ManufactureStoreID, NewCount);
                    //ProfileAssignmentsManager.WriteOffFromManufactureStoreByManufactureStoreID(ManufactureStoreID, NewCount);
                    ProfileAssignmentsManager.SaveTransferredRollers();
                    ProfileAssignmentsManager.GetTransferredRollers(DecorAssignmentID);
                    ProfileAssignmentsManager.GetRollersInColorOnStorage(CoverID);
                    InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700);
                }
            }
        }
Beispiel #29
0
        private void dgvPatina_DragDrop(object sender, DragEventArgs e)
        {
            Point clientPoint = dgvPatina.PointToClient(new Point(e.X, e.Y));

            if (e.Effect == DragDropEffects.Move)
            {
                //int DepartmentID = (int)e.Data.GetData(typeof(int));
                var hittest = dgvPatina.HitTest(clientPoint.X, clientPoint.Y);
                if (hittest.ColumnIndex != -1 && hittest.RowIndex != -1 && CurrentPatinaIDRALID != 0)
                {
                    PManager.ChangePatinaGroup(CurrentPatinaIDRALID, Convert.ToInt32(dgvPatina.Rows[hittest.RowIndex].Cells["PatinaID"].Value));
                    InfiniumTips.ShowTip(this, 50, 85, "Патина перенесена в группу \"" +
                                         dgvPatina.Rows[hittest.RowIndex].Cells["PatinaName"].Value.ToString() + "\"", 1700);
                }
            }
        }
        private void btnDeletePermit_Click(object sender, EventArgs e)
        {
            if (dgvPermits.SelectedRows.Count == 0 || dgvPermits.SelectedRows[0].Cells["MachinePermitID"].Value == DBNull.Value)
            {
                return;
            }

            //if (RoleType != RoleTypes.AdminRole && RoleType != RoleTypes.ApprovedRole)
            //    return;

            if (Convert.ToBoolean(dgvPermits.SelectedRows[0].Cells["OutputDone"].Value))
            {
                return;
            }

            bool OKCancel = Infinium.LightMessageBox.Show(ref TopForm, true,
                                                          "Пропуск будет удален. Продолжить?",
                                                          "Удаление пропуска");

            if (!OKCancel)
            {
                return;
            }

            int PermitID = Convert.ToInt32(dgvPermits.SelectedRows[0].Cells["MachinePermitID"].Value);

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

            T.Start();

            while (!SplashWindow.bSmallCreated)
            {
                ;
            }
            NeedSplash = false;

            PermitsManager.RemovePermit(PermitID);
            PermitsManager.SavePermits();
            UpdatePermitDates();

            NeedSplash = true;
            while (SplashWindow.bSmallCreated)
            {
                SmallWaitForm.CloseS = true;
            }
            InfiniumTips.ShowTip(this, 50, 85, "Пропуск удален", 1700);
        }