Beispiel #1
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 #2
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 #3
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;
            }
        }
Beispiel #4
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);
     }
 }
        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);
            }
        }
Beispiel #6
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;
        }
 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 #8
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
            }
        }
        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 #10
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 #11
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 #12
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 #13
0
        private void ButtonAddClick(object sender, EventArgs e)
        {
            var form = new DocumentForm(new Document(), _currentItem);

            if (form.ShowDialog() == DialogResult.OK)
            {
                InvokeReload();
            }
        }
Beispiel #14
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 #15
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 #16
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 #17
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 #18
0
 private static void CreateDocument()
 {
     try
     {
         DocumentForm frm = new DocumentForm();
         frm.CheckSecurityForInsert();
         frm.ShowDialog();
         frm.Dispose();
         MemoryHelper.ReduceMemory();
     }
     catch (Exception ex)
     {
         ErrorHandler.Show(ex);
     }
 }
Beispiel #19
0
        private void DocumentControl1_Added(object sender, EventArgs e)
        {
            var newDocument = new SmartCore.Entities.General.Document
            {
                Parent       = _audit,
                ParentId     = _audit.ItemId,
                ParentTypeId = _audit.SmartCoreObjectType.ItemId,
                DocType      = DocumentType.Document,
                IsClosed     = false,
            };

            var form = new DocumentForm(newDocument, _audit, _audit.OperatorId);

            if (form.ShowDialog() == DialogResult.OK)
            {
                Record.Document = newDocument;
                documentControl1.CurrentDocument = newDocument;
            }
        }
Beispiel #20
0
        private void DocumentControlCancellation_Added(object sender, EventArgs e)
        {
            var docSubType  = GlobalObjects.CasEnvironment.GetDictionary <DocumentSubType>().GetByFullName("Flight Schedule(Cancellation)") as DocumentSubType;
            var newDocument = new Document
            {
                Parent             = _planOpsRecord,
                ParentId           = _planOpsRecord.ItemId,
                ParentTypeId       = _planOpsRecord.SmartCoreObjectType.ItemId,
                DocType            = DocumentType.Order,
                DocumentSubType    = docSubType,
                IssueDateValidFrom = _planOpsRecord.Date
            };

            var form = new DocumentForm(newDocument, false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                _planOpsRecord.CancellationDocument         = newDocument;
                documentControlCancellation.CurrentDocument = newDocument;
            }
        }
Beispiel #21
0
        private void DocumentControl1_Added(object sender, EventArgs e)
        {
            var docSubType  = GlobalObjects.CasEnvironment.GetDictionary <DocumentSubType>().GetByFullName("Flight Schedule") as DocumentSubType;
            var newDocument = new Document
            {
                Parent          = _flightNumberPeriod,
                ParentId        = _flightNumberPeriod.ItemId,
                ParentTypeId    = _flightNumberPeriod.SmartCoreObjectType.ItemId,
                DocType         = DocumentType.Order,
                DocumentSubType = docSubType,
                IsClosed        = true
            };

            var form = new DocumentForm(newDocument, false);

            if (form.ShowDialog() == DialogResult.OK)
            {
                _flightNumberPeriod.Document     = newDocument;
                documentControl1.CurrentDocument = newDocument;
            }
        }
Beispiel #22
0
 private void commandBar1_NewCommandPressed(object sender, EventArgs e)
 {
     try
     {
         //Hashtable h = new Hashtable();
         //h.Add("Id", _current.Id);
         //h.Add("Customer", _current);
         //base.NavigateTo("Tasks", h);
         try
         {
             Nested_CheckSecurityForCreation();
             DocumentForm frm = new DocumentForm(_current);
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 if (frm.CurrentDocument != null)
                 {
                     IBindingList g = gridView1.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 #23
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            try
            {
                if (e.Alt && e.KeyCode == Keys.F2)
                {
                    ToggleBookmark();
                }
                else if (e.KeyCode == Keys.F2)
                {
                    GotoNextBookmark();
                }
                else if (e.KeyCode == Keys.Up ||
                         e.KeyCode == Keys.Down ||
                         e.KeyCode == Keys.Left ||
                         e.KeyCode == Keys.Right ||
                         e.Control)
                {
                    //Check if valid guid
                    Guid   result;
                    String attributeValue = "";

                    if (e.Control && e.KeyCode == Keys.O)
                    {
                        if (Guid.TryParse(Selection.Text, out result))
                        {
                            attributeValue = GetAttributeValueFromPosition(Selection.Text);
                            var form = new DocumentForm();
                            form.Document      = DocumentManager.GetDocument(attributeValue);
                            form.StartPosition = FormStartPosition.WindowsDefaultLocation;
                            form.ShowDialog();
                        }
                        //from current position go back upto 32 chars to see if there is a quote
                    }
                    else if (e.Control && e.Alt && e.KeyCode == Keys.Space)
                    {
                        Line line = Lines.Current;
                        if (line != null)
                        {
                            line.ToggleFoldExpanded();
                        }
                    }
                    else if (e.Control && e.Alt && e.KeyCode == Keys.M)
                    {
                        Commands.Execute(BindableCommand.ShowFind);
                    }
                    else if (e.Control && e.KeyCode == Keys.W)
                    {
                        ToggleWordWrap();
                    }
                    else
                    {
                        base.OnKeyDown(e);
                    }
                }
                else
                {
                    base.OnKeyDown(e);
                }
            }
            catch (Exception exception)
            {
                LogManager.Error(exception);
            }
        }
Beispiel #24
0
        /// <summary>
        /// Document Management Click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Doc_Main_btn_Click(object sender, EventArgs e)
        {
            DocumentForm docfrm = new DocumentForm();

            docfrm.ShowDialog();
        }