Ejemplo n.º 1
0
        private void openTable()
        {
            if (CloseButton.Visibility != System.Windows.Visibility.Visible || this.Step4.Grid.SelectedItems.Count <= 0)
            {
                return;
            }
            List <object> ids   = new List <object>(0);
            int           count = this.Step4.Grid.SelectedItems.Count;

            if (this.Step4.Grid.SelectedItems != null && count > 0)
            {
                Object item = this.Step4.Grid.SelectedItems[count - 1];
                if (((SaveInfo)item).errorMessage == null)
                {
                    ids.Add(((SaveInfo)item).oid);
                }
                else
                {
                    MessageDisplayer.DisplayInfo("Multiple Upload", "Unable to open the table");
                    return;
                }
                HistoryHandler.Instance.openPage(NavigationToken.GetModifyViewToken(Misp.Sourcing.Base.SourcingFunctionalitiesCode.INPUT_TABLE_EDIT, ids));
                Close();
            }
        }
Ejemplo n.º 2
0
        protected override void Rename(string name)
        {
            PresentationEditorItem page = (PresentationEditorItem)getEditor().getActivePage();

            if (!Kernel.Util.FileUtil.isValidFileName(name))
            {
                MessageDisplayer.DisplayInfo("Presentation", "The slide name " + name + " is not valid");
                return;
            }
            if (validateName(page, name))
            {
                ChangePowerPointFileName(name, page, page.EditedObject);
                base.Rename(name);
            }
        }
        private void viewFromToDate(Kernel.Domain.PeriodInterval interval)
        {
            NamePanel namePanel = new NamePanel();

            namePanel.gridDefault.Visibility  = System.Windows.Visibility.Collapsed;
            namePanel.gridViewDate.Visibility = System.Windows.Visibility.Visible;
            namePanel.FromDate.Text           = interval.periodFromDateTime.ToShortDateString();
            namePanel.toDate.Text             = interval.periodToDateTime.ToShortDateString();
            namePanel.Height = 70;
            Dialog dialog = new Dialog(interval.name, namePanel);

            dialog.cancelButton.Visibility = System.Windows.Visibility.Collapsed;
            dialog.Height = 200;
            dialog.Width  = 245;
            Kernel.Domain.PeriodInterval intervalPeriod = GetSelectedPeriodInterval();

            DateTime from = intervalPeriod.periodFromDateTime;
            DateTime to   = intervalPeriod.periodToDateTime;

            dialog.ShowCenteredToMouse();
            intervalPeriod.periodTo   = namePanel.toDate.ToString();
            intervalPeriod.periodFrom = namePanel.FromDate.ToString();

            if (intervalPeriod.periodToDateTime < intervalPeriod.periodFromDateTime)
            {
                intervalPeriod.periodTo   = to.ToShortDateString();
                intervalPeriod.periodFrom = from.ToShortDateString();
                namePanel.FromDate.Text   = to.ToShortDateString();
                namePanel.toDate.Text     = from.ToShortDateString();
                MessageDisplayer.DisplayInfo("Unable to change Period interval : " + intervalPeriod.name, "The Date To must be after the Date From");
                return;
            }

            if (from != interval.periodFromDateTime || to != interval.periodToDateTime)
            {
                intervalPeriod.periodFrom = interval.periodFrom;
                intervalPeriod.periodTo   = interval.periodTo;
                interval.GetParent().UpdateChild(intervalPeriod);
                if (Changed != null)
                {
                    Changed();
                }
            }
        }
Ejemplo n.º 4
0
        protected void OnUpload(object sender, RoutedEventArgs e)
        {
            List <string> selectedFiles = new List <string>(0);

            foreach (Object item in this.Step1.ExcelFilesGrid.SelectedItems)
            {
                string name = ((FileInfo)item).FullName;
                if (ApplicationManager.Instance.ApplcationConfiguration.IsMultiuser())
                {
                    string path = System.IO.Path.GetDirectoryName(name) + System.IO.Path.DirectorySeparatorChar;
                    name = System.IO.Path.GetFileName(name);
                    this.InputTableService.FileService.FileTransferService.MultipleUploadTable(name, path);
                }
                selectedFiles.Add(name);
            }

            int selectedTableOID = ((InputTableBrowserData)Step2.TableGrid.SelectedItem).oid;

            if (Step3.GroupField.Group == null)
            {
                MessageDisplayer.DisplayInfo("Group ", "The groupe value cannot be empty");
            }

            if (Step3.GroupField.Group == null)
            {
                Step3.GroupField.Group = Step3.GroupField.GroupService.getDefaultGroup();
            }

            int groupOid = Step3.GroupField.Group.oid.Value;

            DisplayStep(4);

            MultiTableLoadData data = new MultiTableLoadData();

            data.templateOid = selectedTableOID;
            data.groupOid    = groupOid;
            data.excelFiles  = selectedFiles;

            InputTableService.LoadMultipleTableHandler += Update;
            InputTableService.LoadMultipleTable(data);
        }
 public void Export()
 {
     try
     {
         string filePath = openFileDialog("Export to Excel", null);
         if (filePath == null)
         {
             return;
         }
         InputGridEditorItem page   = (InputGridEditorItem)getEditor().getActivePage();
         GrilleFilter        filter = page.getInputGridForm().GridForm.filterForm.Fill();
         filter.grid = page.EditedObject;
         filter.file = filePath;
         bool response = this.GetInputGridService().exportToExcel(filter);
         if (response)
         {
             MessageDisplayer.DisplayInfo("Export to Excel", "Grid exported!");
         }
     }
     catch (ServiceExecption) { }
 }
        /// <summary>
        /// Crée un nouvel objet et affiche la view d'édition
        /// </summary>
        /// <returns>
        /// OperationState.CONTINUE si la création a réussi
        /// OperationState.STOP sinon
        /// </returns>
        public OperationState Create()
        {
            List <InputTableBrowserData> items = this.Service.getRunnedTableBrowserDatas();

            if (items.Count > 0)
            {
                runWindow       = new RunWindow(false);
                runWindow.Owner = ApplicationManager.MainWindow;
                runWindow.initializeGroup(this.Service);
                runWindow.SetRunClearLabel("Clear");
                runWindow.Controller = this;
                runWindow.Service    = this.Service;
                runWindow.DisplayDatas(items);
                runWindow.ShowDialog();
            }
            else
            {
                MessageDisplayer.DisplayInfo("Clear Grid/Table", "There is no runned Grid/Table!");
            }
            return(OperationState.CONTINUE);
            //   return Clear();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Ouvre l'arbre passé en parametre dans l'éditeur.
        /// </summary>
        /// <param name="table">L'arbre à ouvrir</param>
        /// <returns>
        /// - CONTINUE si l'ouverture de l'arbre se termine avec succès.
        /// - STOP sinon
        /// </returns>
        public override OperationState Open(TransformationTree tree)
        {
            if (tree == null)
            {
                MessageDisplayer.DisplayInfo("Transformation Tree", "Unable to open the selected tree");
                this.ApplicationManager.HistoryHandler.closePage(this);
                return(OperationState.STOP);
            }

            bool isReadonly = false;

            if (tree.oid.HasValue)
            {
                bool isOk = GetTransformationTreeService().locked(ApplicationManager.File.oid.Value, tree.oid.Value);
                if (!isOk)
                {
                    MessageBoxResult response = MessageDisplayer.DisplayYesNoQuestion("Tree Locked", "Tree '" + tree.name + "' is locked by another user!\n"
                                                                                      + "You cannot edit the tree until the tree is open by another user.\n"
                                                                                      + "Do you want to switch in read only mode ?");
                    if (MessageBoxResult.Yes != response)
                    {
                        return(OperationState.STOP);
                    }
                    else
                    {
                        isReadonly = true;
                    }
                }
            }
            ((TransformationTreeSideBar)SideBar).TransformationTreeGroup.TransformationTreeTreeview.AddTransformationTreeIfNatExist(tree);
            TransformationTreeEditorItem page = (TransformationTreeEditorItem)getTransformationTreeEditor().addOrSelectPage(tree, isReadonly);

            page.GetTransformationTreeForm().TransformationTreeService = this.GetTransformationTreeService();
            initializePageHandlers(page);
            getEditor().ListChangeHandler.AddNew(tree);
            return(OperationState.CONTINUE);
        }