private void cmdValidateMainTask_Click(object sender, System.EventArgs e) { try { Tools.Tools.ThrowExceptionIfCurrentUserIsNotAdmin(_Group); if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { var selectedMainTask = GetSelectedMainTask(); if (selectedMainTask == null) { return; } using (var releaseService = new Service.Release.Front.ReleaseService(_Group.GetEnvironment().GetSQLExtendConnectionString())) { releaseService.AcceptMainTaskRequest(selectedMainTask.MainTaskId); InternalReLoadControl(); } } } catch (Exception ex) { ex.ShowInMessageBox(); } }
private void cmdUpdateMainTask_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { var selectedMainTask = GetSelectedMainTask(); if (selectedMainTask == null) { return; } UpdateMainTask(GetSelectedMainTask()); DisplayEditMode(); } } catch (Exception ex) { ex.ShowInMessageBox(); } }
private void cmdDeleteProjectTask_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { using (var releaseService = new Service.Release.Front.ReleaseService(_Group.GetEnvironment().GetSQLExtendConnectionString())) { var selectedProjectTask = GetSelectedSubTask(); if (selectedProjectTask == null) { return; } //suppression project task releaseService.DeleteProjectTask(selectedProjectTask); } //Applications des droits sur dev Tools.Tools.ReleaseProjectsRights(_Group); } //Doit être à l'extérieur du boollocker pour permettre le reload. DeletedProjectTask(sender, e); } catch (Exception ex) { ex.ShowInMessageBox(); } }
private void cmdHideProjet_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { var selectedExternalProject = GetSelectedExternalProject(); if (selectedExternalProject != null) { using (var releaseService = new ReleaseService(_Group.GetEnvironment().GetSQLExtendConnectionString())) { releaseService.ProcessedExternalProject(selectedExternalProject); LoadDatagridview(); } } } } catch (Exception ex) { ex.ShowInMessageBox(); } }
public void Initialize() { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { cboExternalProjectSearch = cboExternalProjectSearch.FillByDictionary(new ExternalProjectStatusSearchEnum().ToDictionary("FR")); cboExternalProjectSearch.SelectedValue = ExternalProjectStatusSearchEnum.UnProcessed; LoadDatagridview(); dgvProject.MultiSelect = false; dgvProject.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dgvProject.ReadOnly = true; dgvProject.AllowUserToAddRows = false; dgvProject.RowHeadersVisible = false; dgvProject.AllowUserToResizeRows = false; dgvProject.AllowUserToResizeColumns = true; dgvProject.AllowUserToOrderColumns = true; dgvProject.DataSource = _ExternalProjetBindingSource; _ExternalProjetBindingSource.DataSource = new List <ExternalProjectView>(); dgvProject.FormatColumns <ExternalProjectView>("FR"); } }
private void cmdImportFromProjectExcelFile_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { Tools.Tools.ThrowExceptionIfCurrentUserIsNotAdmin(_Group); var ucImportTaskControl = new ucImportTaskFromPDC(_Group); using (var ImportTaskForm = new frmUserControl(ucImportTaskControl, "Importation Tâche", true, false)) { ucImportTaskControl.Close += (s, d) => ImportTaskForm.Close(); ImportTaskForm.StartPosition = FormStartPosition.CenterParent; ucImportTaskControl.Initialize(); ImportTaskForm.ShowDialog(); InternalReLoadControl(); dgvMain.Refresh(); } } } catch (Exception ex) { ex.ShowInMessageBox(); } }
private void cmdRefresh_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { var ucMessageBox = new ucMessageBox("Traitement en cours..."); using (var messageBoxForm = new frmUserControl(ucMessageBox, "Traitement", false, false)) { messageBoxForm.Show(); using (var releaseService = new ReleaseService(_Group.GetEnvironment().GetSQLExtendConnectionString())) { releaseService.AddAndUpdateExternalProjectFromFile(); LoadDatagridview(); } messageBoxForm.Close(); } } } catch (Exception ex) { ex.ShowInMessageBox(); } }
public void LoadFromExternalProject(ExternalProject iExternalProject) { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { LoadPackageCombo(); _StatusEnum = StatusEnum.New; _MainTask = null; FillControl(); cboCreationUser.SelectedValue = _Group.CurrentUser.Id; txtCreationDate.Text = DateTime.Now.ToShortDateString(); txtDescription.Text = iExternalProject.Description; txtName.Text = iExternalProject.ProjectName; cboProjectNumber.Text = iExternalProject.ProjectNumber; cboRequestUser.Text = iExternalProject.Pilote; cboTaskType.SelectedValue = MainTaskTypeEnum.ProjectDeveloppement; if (iExternalProject.DateObjectiveEnd != null) { dtpObjectifDate.Checked = true; dtpObjectifDate.Value = (DateTime)iExternalProject.DateObjectiveEnd; } ControlValidator(); this.Focus(); } }
private void cmdRunUnusedAnalyse_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { using (var projectOpenLocker = new BoolLocker(ref Consts.Consts.DontShowCheckTaskOnStartup)) { var inProgressUserControl = new ucMessageBox("Traitement en cours"); using (var inProgressForm = new frmUserControl(inProgressUserControl, "Recherche des tables inutilisées", false, false)) { inProgressForm.TopMost = true; inProgressForm.Show(); inProgressForm.Refresh(); var projectService = _Application.ServiceManager.GetService <IProjectService>(); var activeProject = projectService.ActiveProject; var result = new List <string>(); //Récupération de la liste des tables settings var settingsDatatable = activeProject.GetTableSettingsList(); settingsDatatable.AddRange(activeProject.GetControlTableNameList()); //récupération de la liste des tables var searchProcess = new SearchRuleProcess(activeProject); foreach (var tableItem in activeProject.DataTables.Enum()) { //ignore les tables de settings if (settingsDatatable.Exists(x => x == tableItem.InvariantName)) { continue; } if (!searchProcess.GetSearchResult("DwLookup" + tableItem.InvariantName).IsNotNullAndNotEmpty()) { result.Add(tableItem.DisplayName); } } dgvUnusedTable.DataSource = result.Enum().Select(x => TableView.ConvertTo(x)).Enum().ToList(); dgvUnusedTable.FormatColumns <TableView>("FR"); MessageBox.Show("{0} tables sont inutilisées sur {1} tables".FormatString(result.Count, activeProject.DataTables.Count())); } } } } catch (Exception ex) { ex.ShowInMessageBox(); } }
public void SelectionMode() { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { DisplaySelectionMode(); } }
public void ReLoadControl(long?iMainTaskId = null) { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { InternalReLoadControl(iMainTaskId); } }
public void LoadControl(MainTask iMainTask) { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { _MainTask = iMainTask; LoadDataGridViewSubTask(); DisplaySelectionMode(); } }
public void EditPackage(EquinoxeExtend.Shared.Object.Release.Package iPackage) { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { _Package = iPackage; FillControl(); cmdOk.Focus(); } }
public void LoadControl(long iMainTaskId) { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { _LoadingType = LoadingType.MainTaskId; _MainTaskId = iMainTaskId; LoadDataGridViewMainTask(true, null); DisplaySelectionMode(); } }
private void cmdOldConstantCopy_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { if (_DeletedConstantManaged.Any()) { var oldConstants = new List <DeletedConstantManaged>(); var currentConstantList = _Project.GetCurrentConstantList(); //Ajout des nouvelles données foreach (DataGridViewRow item in dgvOldConstant.Rows) { var newDeletedConstantManaged = DeletedConstantView.GetFromRow(item); if (newDeletedConstantManaged.TransfertConstantName.IsNotNullAndNotEmpty()) { if (currentConstantList.Any(x => x.Name == newDeletedConstantManaged.TransfertConstantName) == false) { throw new Exception("Le transfert de {0} vers {1} est impossible car {1} est introuvable".FormatString(newDeletedConstantManaged.ConstantName, newDeletedConstantManaged.TransfertConstantName)); } } oldConstants.Add(newDeletedConstantManaged); } _Project.AddToDeletedConstantProjectDataTable(oldConstants); //modification de la version du projet DriveWorks.Helper.Manager.SettingsManager.UpdateProjectVersionNumber(_Project, NewVersionNumber); LoadData(); SaveNeeded = true; MessageBox.Show("Les données sont maintenant ajoutées"); } } } catch (Exception ex) { ex.ShowInMessageBox(); } }
public void EditMainTask(MainTask iMainTask) { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { LoadPackageCombo(); _StatusEnum = StatusEnum.Modified; _MainTask = iMainTask; FillControl(); ControlValidator(); this.Focus(); } }
private void cmdRunUnusedVariable_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { using (var projectOpenLocker = new BoolLocker(ref Consts.Consts.DontShowCheckTaskOnStartup)) { var projectService = _Application.ServiceManager.GetService <IProjectService>(); var activeProject = projectService.ActiveProject; var inProgressUserControl = new ucMessageBox("Traitement en cours"); using (var inProgressForm = new frmUserControl(inProgressUserControl, "Recherches des variables inutilisés", false, false)) { inProgressForm.TopMost = true; inProgressForm.Show(); inProgressForm.Refresh(); var result = new List <string>(); //récupération de la liste des tables var searchProcess = new SearchRuleProcess(activeProject); foreach (var variableItem in activeProject.Variables.GetVariables().Enum()) { if (!searchProcess.GetSearchResult(variableItem.Name).IsNotNullAndNotEmpty()) { result.Add(variableItem.Name); } } dgvUnusedVariables.DataSource = result.Enum().Select(x => VariableView.ConvertTo(x)).Enum().ToList(); dgvUnusedVariables.FormatColumns <VariableView>("FR"); MessageBox.Show("{0} paramètres sont inutilisés sur {1} paramètres".FormatString(result.Count, activeProject.Variables.GetVariables().Enum().Count())); } } } } catch (Exception ex) { ex.ShowInMessageBox(); } }
public void EditProjectTask(SubTask iSubTask) { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { _StatusEnum = StatusEnum.Modified; cboProject.Enabled = false; cmdDeleteProject.Enabled = false; _SubTask = iSubTask; FillControl(); ControlValidator(); cmdOk.Focus(); } }
private void cmdUpPriority_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { Tools.Tools.ThrowExceptionIfCurrentUserIsNotAdmin(_Group); var selectedMainTask = GetSelectedMainTask(); if (selectedMainTask == null) { return; } using (var releaseService = new Service.Release.Front.ReleaseService(_Group.GetEnvironment().GetSQLExtendConnectionString())) { if (selectedMainTask.Priority == null) { if (MessageBox.Show("Etes-vous sûr de vouloir placer cette tâche en priorité 1 et de décaler tous les autres ?", "Confirmation", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } } releaseService.MoveUpMainTaskPriority(selectedMainTask); InternalReLoadControl(); dgvMain.Refresh(); dgvMain.SelectRowByPropertyValue <MainTaskView>(x => x.MainTaskId.ToString(), selectedMainTask.MainTaskIdString); var reSelectedMainTask = GetSelectedMainTask(); if (reSelectedMainTask != null) { MainTaskSelectionChanged(reSelectedMainTask); } } } } catch (Exception ex) { ex.ShowInMessageBox(); } }
private void cmdDeletePackage_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { cboPackage.SelectedIndex = -1; } } catch (Exception ex) { ex.ShowInMessageBox(); } }
private void cboTaskType_SelectedIndexChanged(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { EnableActionProjectNumber(); } } catch (Exception ex) { ex.ShowInMessageBox(); } }
private void ValidatorNeeded(object sender, CancelEventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { ControlValidator(); } } catch (Exception ex) { ex.ShowInMessageBox(); } }
private void cmdSearch_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { LoadDatagridview(); } } catch (Exception ex) { ex.ShowInMessageBox(); } }
private void cmdOk_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { ValidateEdit(); } } catch (Exception ex) { ex.ShowInMessageBox(); } }
public void Initialize(DriveWorks.Group iGroup) { _Group = iGroup; if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { cboProject.DisplayMember = PropertyObserver.GetPropertyName <DriveWorks.ProjectDetails>(x => x.Name); cboProject.ValueMember = PropertyObserver.GetPropertyName <DriveWorks.ProjectDetails>(x => x.Id); cboProject.DataSource = _Group.Projects.GetProjects().ToList().Enum().OrderBy(x => x.Name).ToList(); cboDevelopper.DisplayMember = PropertyObserver.GetPropertyName <DriveWorks.Security.UserDetails>(x => x.DisplayName); cboDevelopper.ValueMember = PropertyObserver.GetPropertyName <DriveWorks.Security.UserDetails>(x => x.Id); cboDevelopper.DataSource = _Group.GetUserAllowedCaptureList(); } }
private void cmdSetTaskPriority_Click(object sender, EventArgs e) { try { var selectedTask = GetSelectedMainTask(); if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { Tools.Tools.ThrowExceptionIfCurrentUserIsNotAdmin(_Group); if (selectedTask == null) { return; } var priorityInputBoxUC = new Library.Control.UserControls.ucInputBox("Saisir la nouvelle priorité : ", InputTypeAllowEnum.Numeric); using (var inProgressForm = new frmUserControl(priorityInputBoxUC, "Priorité", false, false)) { inProgressForm.ShowDialog(); if (priorityInputBoxUC.DialogResult != DialogResult.OK) { return; } using (var releaseService = new Service.Release.Front.ReleaseService(_Group.GetEnvironment().GetSQLExtendConnectionString())) { releaseService.SetTaskPriority(selectedTask, priorityInputBoxUC.AnswerString.ToInt32()); } } } InternalReLoadControl(); } catch (Exception ex) { ex.ShowInMessageBox(); } }
public void CreateProjectTask(MainTask iMainTask) { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { _StatusEnum = StatusEnum.New; cboProject.Enabled = true; cmdDeleteProject.Enabled = true; _MainTask = iMainTask; _SubTask = null; FillControl(); ControlValidator(); cmdOk.Focus(); } }
private void ucNavigator_LoadRequested(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { LoadDataGridViewMainTask(false); dgvMain.Focus(); } } catch (Exception ex) { ex.ShowInMessageBox(); } }
private void cmdCancel_Click(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { DialogResult = System.Windows.Forms.DialogResult.Cancel; } Close(null, e); } catch (Exception ex) { ex.ShowInMessageBox(); } }
private void dgvMain_SelectionChanged(object sender, System.EventArgs e) { try { if (_IsLoading.Value) { return; } using (var locker = new BoolLocker(ref _IsLoading)) { MainTaskSelectionChange(); CommandEnableManagement(); dgvMain.Select(); } } catch (Exception ex) { ex.ShowInMessageBox(); } }