Beispiel #1
0
            public static AddedControlView ConvertTo(AddedControlManaged iObj)
            {
                if (iObj == null)
                {
                    return(null);
                }

                var newView = new AddedControlView();

                newView.Object = iObj;

                newView.ControlName    = iObj.ControlName;
                newView.Message        = iObj.Message;
                newView.ProjectVersion = iObj.ProjectVersion;

                return(newView);
            }
Beispiel #2
0
        private void cmdNewControlCopy_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (_IsLoading.Value)
                {
                    return;
                }
                using (var locker = new BoolLocker(ref _IsLoading))
                {
                    if (_AddedControlManaged.Any())
                    {
                        var newControls = new List <AddedControlManaged>();

                        //Ajout des nouvelles données
                        foreach (DataGridViewRow item in dgvNewControl.Rows)
                        {
                            newControls.Add(AddedControlView.GetFromRow(item));
                        }

                        _Project.AddToAddedControlProjectDataTable(newControls);

                        //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();
            }
        }
Beispiel #3
0
        private void LoadData()
        {
            var groupService = _Application.ServiceManager.GetService <IGroupService>();

            var tupleValues = _Project.GetAddedDeletedControlConstant();

            _AddedControlManaged = tupleValues.Item1;
            //bouclage pour définir la bonne version
            foreach (var item in _AddedControlManaged.Enum())
            {
                item.ProjectVersion = NewVersionNumber;
            }

            _DeletedControlManaged = tupleValues.Item2;
            //bouclage pour définir la bonne version
            foreach (var item in _DeletedControlManaged.Enum())
            {
                item.ProjectVersion = NewVersionNumber;
            }

            _AddedConstantManaged = tupleValues.Item3;
            //bouclage pour définir la bonne version
            foreach (var item in _AddedConstantManaged.Enum())
            {
                item.ProjectVersion = NewVersionNumber;
            }

            _DeletedConstantManaged = tupleValues.Item4;
            //bouclage pour définir la bonne version
            foreach (var item in _DeletedConstantManaged.Enum())
            {
                item.ProjectVersion = NewVersionNumber;
            }

            dgvNewControl.DataSource = _AddedControlManaged.Enum().Select(x => AddedControlView.ConvertTo(x)).ToList();
            dgvNewControl.FormatColumns <AddedControlView>("FR");
            if (!_AddedControlManaged.Any())
            {
                cmdNewControlCopy.Enabled = false;
            }

            dgvOldControl.DataSource = _DeletedControlManaged.Enum().Select(x => DeletedControlView.ConvertTo(x)).ToList();
            dgvOldControl.FormatColumns <DeletedControlView>("FR");
            if (!_DeletedControlManaged.Any())
            {
                cmdOldControlCopy.Enabled = false;
            }

            dgvNewConstant.DataSource = _AddedConstantManaged.Enum().Select(x => AddedConstantView.ConvertTo(x)).ToList();
            dgvNewConstant.FormatColumns <AddedConstantView>("FR");
            if (!_AddedConstantManaged.Any())
            {
                cmdNewConstantCopy.Enabled = false;
            }

            dgvOldConstant.DataSource = _DeletedConstantManaged.Enum().Select(x => DeletedConstantView.ConvertTo(x)).ToList();
            dgvOldConstant.FormatColumns <DeletedConstantView>("FR");
            if (!_DeletedConstantManaged.Any())
            {
                cmdOldConstantCopy.Enabled = false;
            }

            lblNewConstantCount.Text = _AddedConstantManaged.Count.ToString();
            lblOldConstantCount.Text = _DeletedConstantManaged.Count.ToString();
            lblNewControlCount.Text  = _AddedControlManaged.Count.ToString();
            lblOldControlCount.Text  = _DeletedControlManaged.Count.ToString();
        }