Beispiel #1
0
        private void editDatasetWithDesignerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode node = g.SelectedNode;

            if (node == null)
            {
                return;
            }
            TableInfo info = node.Tag as TableInfo;

            if (info == null)
            {
                return;
            }
            DataSet datasets = info.datasets;

            if (datasets == null)
            {
                return;
            }

            DocumentForm df  = ExplorerForms.ef.Command_OpenDocumentForm("Designer");
            DesignerForm dvf = new DesignerForm();

            dvf.FormBorderStyle = FormBorderStyle.None;
            dvf.TopLevel        = false;
            dvf.Dock            = DockStyle.Fill;
            dvf.LoadModel(datasets);
            dvf.Show();
            df.Controls.Add(dvf);
        }
        private void DocumentControl1_Added(object sender, EventArgs e)
        {
            var docSubType  = GlobalObjects.CasEnvironment.GetDictionary <DocumentSubType>().GetByFullName("ATLB") as DocumentSubType;
            var newDocument = new Document
            {
                Parent             = Flight,
                ParentId           = Flight.ItemId,
                ParentTypeId       = Flight.SmartCoreObjectType.ItemId,
                DocType            = DocumentType.TechnicalRecords,
                DocumentSubType    = docSubType,
                IsClosed           = true,
                ContractNumber     = $"{Flight.PageNo}",
                Description        = Flight.ParentATLB.ATLBNo,
                IssueDateValidFrom = Flight.FlightDate,
                ParentAircraftId   = Flight.AircraftId
            };

            var form = new DocumentForm(newDocument, false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                Flight.Document = newDocument;
                documentControl1.CurrentDocument = newDocument;
            }
        }
Beispiel #3
0
        private void DocumentControl1_Added(object sender, EventArgs e)
        {
            var docSubType   = GlobalObjects.CasEnvironment.GetDictionary <DocumentSubType>().GetByFullName("Component CRS Form") as DocumentSubType;
            var partNumber   = _parentComponent.PartNumber;
            var serialNumber = _parentComponent.SerialNumber;
            var description  = _parentComponent.Description;


            var newDocument = new Document
            {
                Parent           = _currentComponentDirective,
                ParentTypeId     = _currentComponentDirective.SmartCoreObjectType.ItemId,
                DocType          = DocumentType.TechnicalRecords,
                DocumentSubType  = docSubType,
                IsClosed         = true,
                ContractNumber   = $"P/N:{partNumber} S/N:{serialNumber}",
                Description      = description,
                ParentAircraftId = _parentComponent.ParentAircraftId
            };
            var form = new DocumentForm(newDocument, false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                _currentComponentDirective.Document = newDocument;
                documentControl1.CurrentDocument    = newDocument;
            }
        }
Beispiel #4
0
        private void ShowDialogForm(WIN.SCHEDULING_APPLICATION.DOMAIN.Document label)
        {
            try
            {
                //frm = null;

                //Thread t = new Thread(() => Sleep(label));
                //t.Start();



                //if (!t.Join(3000))
                //{
                //    t.Abort();
                //    XtraMessageBox.Show("Si è verifica un problema nell'apertura del documento riprovare!", "Messaggio", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                //    return;
                //}

                DocumentForm frm = new DocumentForm(label);
                frm.CheckSecurityForView();

                frm.ShowDialog();
                frm.Dispose();
                MemoryHelper.ReduceMemory();
                //GC.Collect();
                //GC.WaitForPendingFinalizers();
            }
            catch (Exception ex)
            {
                ErrorHandler.Show(ex);
            }
        }
Beispiel #5
0
        private void DataGridViewItemsOnCellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }

            var row  = dataGridViewItems.Rows[e.RowIndex];
            var item = row.Tag as CourseRecord;

            if (item != null && item.CloseDocument == null)
            {
                var type = GlobalObjects.CaaEnvironment.GetDictionary <ServiceType>().GetByFullName("Training") as ServiceType;
                item.CloseDocument = new SmartCore.Entities.General.Document
                {
                    Parent       = item,
                    ParentId     = item.ItemId,
                    ParentTypeId = item.SmartCoreObjectType.ItemId,
                    DocType      = DocumentType.Certificate,
                    ServiceType  = type
                };
            }

            var form = new DocumentForm(item.CloseDocument, false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                item.CloseDocument = item.CloseDocument;
            }

            row.Cells[2].Value = item.CloseDocument != null;
        }
Beispiel #6
0
        private void DocumentControl1_Added(object sender, EventArgs e)
        {
            var control     = sender as DocumentControl;
            var docSubType  = GlobalObjects.CaaEnvironment.GetDictionary <DocumentSubType>().GetByFullName("Work package") as DocumentSubType;
            var newDocument = new SmartCore.Entities.General.Document
            {
                Parent          = _currentWp,
                ParentId        = _currentWp.ItemId,
                ParentTypeId    = _currentWp.SmartCoreObjectType.ItemId,
                DocType         = DocumentType.TechnicalRecords,
                DocumentSubType = docSubType,
                IsClosed        = true,
                ContractNumber  = $"{_currentWp.Settings.Number}",
                Description     = _currentWp.Title,
            };

            var form = new DocumentForm(newDocument, false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (_currentWp.Settings.ClosingDocument == null)
                {
                    _currentWp.Settings.ClosingDocument = new List <SmartCore.Entities.General.Document>();
                }
                _currentWp.Settings.ClosingDocument.Add(newDocument);
                control.CurrentDocument = newDocument;
            }
        }
        public IActionResult Put(long id, [FromBody] DocumentForm documentPost)
        {
            Document newDocument = documentPost.document;
            Document document    = _service.Update(id, newDocument);

            return(Ok(document));
        }
Beispiel #8
0
        protected override void OnMdiChildActivate(EventArgs e)
        {
            DocumentForm olddocument = m_activeDocument;

            base.OnMdiChildActivate(e);
            m_activeDocument = this.ActiveMdiChild as DocumentForm;
        }
Beispiel #9
0
        private void DocumentControl2_Added(object sender, EventArgs e)
        {
            var docSubType  = GlobalObjects.CasEnvironment.GetDictionary <DocumentSubType>().GetByFullName("IPC Ref") as DocumentSubType;
            var dep         = GlobalObjects.CasEnvironment.GetDictionary <Department>().GetByFullName("Planning") as Department;
            var spec        = GlobalObjects.CasEnvironment.GetDictionary <Specialization>().GetByFullName("Maintenance Data Librarian") as Specialization;
            var nomen       = GlobalObjects.CasEnvironment.GetDictionary <Nomenclatures>().GetByFullName("e-library") as Nomenclatures;
            var location    = GlobalObjects.CasEnvironment.GetDictionary <Locations>().GetByFullName("e-Server CIT") as Locations;
            var newDocument = new Document
            {
                Parent                = _currentItem,
                ParentId              = _currentItem.ItemId,
                ParentTypeId          = _currentItem.SmartCoreObjectType.ItemId,
                DocType               = DocumentType.TechnicalPublication,
                DocumentSubType       = docSubType,
                Department            = dep,
                ResponsibleOccupation = spec,
                Nomenсlature          = nomen,
                Location              = location
            };

            var form = new DocumentForm(newDocument, false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                _currentItem.Document            = newDocument;
                documentControl2.CurrentDocument = newDocument;
            }
        }
Beispiel #10
0
        private void DocumentControl1_Added(object sender, EventArgs e)
        {
            var control     = sender as DocumentControl;
            var docSubType  = GlobalObjects.CasEnvironment.GetDictionary <DocumentSubType>().GetByFullName("Work package") as DocumentSubType;
            var newDocument = new Document
            {
                Parent           = _order,
                ParentId         = _order.ItemId,
                ParentTypeId     = _order.SmartCoreObjectType.ItemId,
                DocType          = DocumentType.TechnicalRecords,
                DocumentSubType  = docSubType,
                IsClosed         = true,
                ContractNumber   = $"{_order.Number}",
                Description      = _order.Title,
                ParentAircraftId = _order.ParentId
            };

            var form = new DocumentForm(newDocument, false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                _order.ClosingDocument.Add(newDocument);
                control.CurrentDocument = newDocument;
            }
        }
Beispiel #11
0
 private void cmdNew_Click(object sender, EventArgs e)
 {
     try
     {
         try
         {
             DocumentForm frm = new DocumentForm();
             frm.CheckSecurityForInsert();
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 if (frm.CurrentDocument != null)
                 {
                     IBindingList g = gridView2.DataSource as IBindingList;
                     g.Add(frm.CurrentDocument);
                 }
             }
         }
         catch (AccessDeniedException)
         {
             XtraMessageBox.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         catch (Exception ex)
         {
             ErrorHandler.Show(ex);
         }
     }
     catch (AccessDeniedException)
     {
         XtraMessageBox.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception ex)
     {
         ErrorHandler.Show(ex);
     }
 }
Beispiel #12
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DocumentForm documentForm = new DocumentForm();

            documentForm.MdiParent = this;
            documentForm.Show();
        }
Beispiel #13
0
        private void AWBEditor_DoubleClick(object sender, MouseEventArgs e)
        {
            Guid   result;
            String attributeValue = "";

            //MessageBox.Show(result.ToString());
            attributeValue = GetAttributeValueFromPosition(Selection.Text);

            if (ModifierKeys == Keys.Control) //e.Control && e.KeyCode == Keys.O)
            {
                if (Guid.TryParse(Selection.Text, out result))
                {
                    var      form     = new DocumentForm();
                    Document document = DocumentManager.GetDocument(attributeValue);
                    if (document == null)
                    {
                        MessageBox.Show(string.Format("The document with id \"{0}\" does not exist in the database.",
                                                      attributeValue));
                    }
                    else
                    {
                        form.Document      = document;
                        form.StartPosition = FormStartPosition.WindowsDefaultLocation;
                        form.ShowDialog();
                    }
                }
                //from current position go back upto 32 chars to see if there is a quote
            }
        }
Beispiel #14
0
        public void ShowEditor(Control editor)
        {
            var form = new DocumentForm();

            form.SetContent(editor, "Blah");
            form.Show(DockPanel);
        }
 void OpenDocument()
 {
     try
     {
         DataRow dr = CurrentDataRow;
         if (dr != null)
         {
             DataRow drClone = this.dtDocuments.NewRow();
             drClone.ItemArray = (object[])dr.ItemArray.Clone();
             Document     doc  = new Document(drClone);
             DocumentForm form = new DocumentForm(doc);
             form.ShowDialog();
             timeleft = 0;
         }
     }
     catch (Exception ex)
     {
         App.ScanHandler = null;
         Log.Exception(ex);
     }
     finally
     {
         App.ScanHandler = null;
     }
 }
Beispiel #16
0
        // Checking Size
        public async Task Test2()
        {
            string errorMessage = "Size is invalid: Size must be greater than 0 MB and less than 500 MB";

            await CheckOnBadRequest(new DocumentForm
            {
                Title  = "Monthly Revenue Report",
                Size   = 0,
                Format = "txt"
            }, errorMessage);
            await CheckOnBadRequest(new DocumentForm
            {
                Title  = "Monthly Revenue Report",
                Size   = 501,
                Format = "txt"
            }, errorMessage);

            var document = new DocumentForm
            {
                Title  = "Monthly Revenue Report",
                Size   = 1,
                Format = "txt"
            };
            var response3 = await Client.PostAsync($"/api/documents",
                                                   new StringContent(JsonConvert.SerializeObject(document), Encoding.UTF8, "application/json"));

            response3.StatusCode.Should().BeEquivalentTo(StatusCodes.Status200OK);
        }
Beispiel #17
0
        // Checking Title
        public async Task Test1()
        {
            string titleError = "Title is invalid: Title must contain a minimum of 5 characters and a maximum of 35, and each word should start with an uppercase letter";

            await CheckOnBadRequest(new DocumentForm
            {
                Title  = "Mont",
                Size   = 300,
                Format = "pdf"
            }, titleError);
            await CheckOnBadRequest(new DocumentForm
            {
                Title  = "Monthly Revenue Report Monthly Revenue Report",
                Size   = 300,
                Format = "pdf"
            }, titleError);
            await CheckOnBadRequest(new DocumentForm
            {
                Title  = "monthly revenue report",
                Size   = 300,
                Format = "pdf"
            }, titleError);

            var document = new DocumentForm
            {
                Title  = "Monthly Revenue Report",
                Size   = 300,
                Format = "pdf"
            };
            var response3 = await Client.PostAsync($"/api/documents",
                                                   new StringContent(JsonConvert.SerializeObject(document), Encoding.UTF8, "application/json"));

            response3.StatusCode.Should().BeEquivalentTo(StatusCodes.Status200OK);
        }
        private void buttonAddDoc_Click(object sender, EventArgs e)
        {
            var _departmentPalanning = GlobalObjects.CasEnvironment.NewLoader.GetObject <DepartmentDTO, Department>(new Filter("FullName", "Planning"));
            var spec        = GlobalObjects.CasEnvironment.GetDictionary <Occupation>().GetByFullName("Records and Planning Manager") as Occupation;
            var docSubType  = GlobalObjects.CasEnvironment.GetDictionary <DocumentSubType>().GetByFullName("EXEMPTION") as DocumentSubType;
            var newDocument = new Document
            {
                Parent                = _currentAircraft,
                ParentId              = _currentAircraft.ItemId,
                ParentTypeId          = _currentAircraft.SmartCoreObjectType.ItemId,
                DocType               = DocumentType.Permission,
                DocumentSubType       = docSubType,
                IsClosed              = false,
                ContractNumber        = $"",
                Description           = "",
                ProlongationWay       = ProlongationWay.Auto,
                ParentAircraftId      = _currentAircraft.ItemId,
                Department            = _departmentPalanning,
                ResponsibleOccupation = spec
            };

            var form = new DocumentForm(newDocument, false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                MessageBox.Show("Document created successfully!", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
        public DocumentForm poaReading(string[] tableData, POAElements poaElements)
        {
            DocumentForm documentForm = new DocumentForm();

            documentForm.fillTable(tableData);
            documentForm.fillFields(poaElements);
            return(documentForm);
        }
Beispiel #20
0
        private void linkLabelAddDocument_LinkClicked(object sender, EventArgs e)
        {
            var newDocument = new Document
            {
                Parent             = _currentDirectiveRecord,
                ParentTypeId       = _currentDirectiveRecord.SmartCoreObjectType.ItemId,
                DocType            = DocumentType.TechnicalRecords,
                IsClosed           = true,
                IssueDateValidFrom = _currentDirectiveRecord.RecordDate,
            };

            if (_currentDirective is ComponentDirective)
            {
                var component = _currentDirective.LifeLengthParent as Component;

                newDocument.DocumentSubType  = GlobalObjects.CasEnvironment.GetDictionary <DocumentSubType>().GetByFullName("Component compliance") as DocumentSubType;
                newDocument.ContractNumber   = $"P/N:{component.PartNumber} S/N:{component.SerialNumber}";
                newDocument.Description      = component.Description;
                newDocument.ParentAircraftId = component.ParentAircraftId;
            }
            else if (_currentDirective is Directive)
            {
                var directive = _currentDirective as Directive;
                newDocument.DocumentSubType  = GlobalObjects.CasEnvironment.GetDictionary <DocumentSubType>().GetByFullName("Directive compliance") as DocumentSubType;
                newDocument.Description      = directive.Description;
                newDocument.ParentAircraftId = directive.ParentBaseComponent.ParentAircraftId;

                if (directive.DirectiveType == DirectiveType.AirworthenessDirectives)
                {
                    newDocument.ContractNumber = directive.Title + "  §: " + directive.Paragraph;
                }
                else if (directive.DirectiveType == DirectiveType.SB)
                {
                    newDocument.ContractNumber = directive.ServiceBulletinNo != "" ? directive.ServiceBulletinNo : "N/A";
                }
                else if (directive.DirectiveType == DirectiveType.EngineeringOrders)
                {
                    newDocument.ContractNumber = directive.EngineeringOrders != "" ? directive.EngineeringOrders : "N/A";
                }
            }
            else if (_currentDirective is MaintenanceDirective)
            {
                var directive = _currentDirective as MaintenanceDirective;
                newDocument.DocumentSubType  = GlobalObjects.CasEnvironment.GetDictionary <DocumentSubType>().GetByFullName("MPD Compliance") as DocumentSubType;
                newDocument.Description      = directive.Description;
                newDocument.ParentAircraftId = directive.ParentBaseComponent.ParentAircraftId;
                newDocument.ContractNumber   = directive.TaskNumberCheck;
            }


            var form = new DocumentForm(newDocument, false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                _currentDirectiveRecord.Document = newDocument;
                documentControl1.CurrentDocument = newDocument;
            }
        }
Beispiel #21
0
        private void ButtonAddClick(object sender, EventArgs e)
        {
            var form = new DocumentForm(new Document(), _currentItem);

            if (form.ShowDialog() == DialogResult.OK)
            {
                InvokeReload();
            }
        }
Beispiel #22
0
        // Checking Format
        public async Task Test3()
        {
            string errorMessage = "Format is invalid: Format must be lowercase and equal one of the following: 'txt', 'pdf', 'docx'";

            await CheckOnBadRequest(new DocumentForm
            {
                Title  = "Monthly Revenue Report",
                Size   = 334,
                Format = ""
            }, errorMessage);
            await CheckOnBadRequest(new DocumentForm
            {
                Title  = "Monthly Revenue Report",
                Size   = 334,
                Format = "TXT"
            }, errorMessage);
            await CheckOnBadRequest(new DocumentForm
            {
                Title  = "Monthly Revenue Report",
                Size   = 334,
                Format = "xls"
            }, errorMessage);

            var document = new DocumentForm
            {
                Title  = "Monthly Revenue Report",
                Size   = 234,
                Format = "txt"
            };
            var response3 = await Client.PostAsync($"/api/documents",
                                                   new StringContent(JsonConvert.SerializeObject(document), Encoding.UTF8, "application/json"));

            response3.StatusCode.Should().BeEquivalentTo(StatusCodes.Status200OK);

            var document2 = new DocumentForm
            {
                Title  = "Monthly Revenue Report",
                Size   = 234,
                Format = "pdf"
            };
            var response4 = await Client.PostAsync($"/api/documents",
                                                   new StringContent(JsonConvert.SerializeObject(document2), Encoding.UTF8, "application/json"));

            response4.StatusCode.Should().BeEquivalentTo(StatusCodes.Status200OK);

            var document3 = new DocumentForm
            {
                Title  = "Monthly Revenue Report",
                Size   = 234,
                Format = "docx"
            };
            var response5 = await Client.PostAsync($"/api/documents",
                                                   new StringContent(JsonConvert.SerializeObject(document3), Encoding.UTF8, "application/json"));

            response5.StatusCode.Should().BeEquivalentTo(StatusCodes.Status200OK);
        }
Beispiel #23
0
        public void init(AssetManagerForm mainForm, Snippet snippet)
        {
            form = this.snippetEditor1.NewDocument();

            this.mainForm = mainForm;
            this.snippet  = snippet;

            this.form.Scintilla.Text = snippet.Function;
            this.DisplayObjectProperties();
        }
Beispiel #24
0
        public void init(AssetManagerForm mainForm, Snippet snippet)
        {
            form = this.snippetEditor1.NewDocument();

            this.mainForm = mainForm;
            this.snippet = snippet;

            this.form.Scintilla.Text = snippet.Function;
            this.DisplayObjectProperties();
        }
    static int Main()
    {
        DocumentForm <object> browseForm = new DocumentForm <object> ();

        if (browseForm.DoInit() != 248)
        {
            return(1);
        }
        return(0);
    }
        public IActionResult Post([FromBody] DocumentForm documentPost)
        {
            Document document = documentPost.document;

            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            _service.Save(document);
            return(CreatedAtAction("GetDocument", new { id = document.Id }, document));
        }
Beispiel #27
0
        private async Task CheckOnBadRequest(DocumentForm document, string errorMessage)
        {
            var response0 = await Client.PostAsync($"/api/documents",
                                                   new StringContent(JsonConvert.SerializeObject(document), Encoding.UTF8, "application/json"));

            response0.StatusCode.Should().BeEquivalentTo(StatusCodes.Status400BadRequest);

            var responseMessage = await response0.Content.ReadAsStringAsync();

            responseMessage.ToString().Contains(errorMessage).Should().BeTrue();
        }
Beispiel #28
0
        private void DocumentControl1_Added(object sender, EventArgs e)
        {
            var newDocument = CreateNewDocument();
            var form        = new DocumentForm(newDocument, false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                _license.Document = newDocument;
                documentControl1.CurrentDocument = newDocument;
            }
        }
Beispiel #29
0
        private void Goto(WIN.SCHEDULING_APPLICATION.DOMAIN.Document label)
        {
            //Hashtable h = new Hashtable();
            //h.Add("Id", label.Id);
            //h.Add("Task", label);
            //NavigateTo("Tasks", h);
            DocumentForm frm = new DocumentForm(label);

            frm.CheckSecurityForView();
            frm.ShowDialog();
            frm.Dispose();
        }
Beispiel #30
0
        private void ButtonAddFileClick(object sender, EventArgs e)
        {
            DocumentForm form = new DocumentForm(new Document(), _currentSupplier);

            if (form.ShowDialog() == DialogResult.OK)
            {
                Document document = form.CurrentDocument;
                _documents.Add(document);

                documentationListView.SetItemsArray(_documents.ToArray());
            }
        }
Beispiel #31
0
        private void ButtonAddNonRoutineJobClick(object sender, EventArgs e)
        {
            var form = new DocumentForm(new SmartCore.Entities.General.Document(), _parent, _operatorId);

            if (form.ShowDialog() == DialogResult.OK)
            {
                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoWork;
                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoFilteringWork;
                AnimatedThreadWorker.DoWork += AnimatedThreadWorkerDoWork;

                AnimatedThreadWorker.RunWorkerAsync();
            }
        }
Beispiel #32
0
 public void OpenDocument(Document doc)
 {
     foreach (var form in this.MdiChildren)
     {
         if (form.Tag == doc)
         {
             this.ActivateMdiChild(form);
             return;
         }
     }
     DocumentForm childForm = new DocumentForm(doc);
     childForm.MdiParent = this;
     childForm.Show(this.dockPanel);
 }