示例#1
0
        public FormInputDoc(IInputDocument document, IGlobalValues data)
        {
            InitializeComponent();
            Document = document;
            Data     = data;

            docInfo.Text = "Документ № " + Document.Head.DocumentNumber.ToString() +
                           "\nДата: " + Document.Head.DocumentDate.ToString("dd.MM.yyyy") +
                           "\nФабрика: " + Data.FactoryList[Document.Head.Factory];
            this.Text = Data.PlanDocType[Document.Head.DocType] + " № " + Document.Head.DocumentNumber.ToString();
        }
示例#2
0
 private void btnEditPlan_Click(object sender, EventArgs e)
 {
     if (gridPlanDocuments.SelectedRows.Count > 0)
     {
         try
         {
             IInputDocument doc  = InputDocFactory.LoadDocument((int)gridPlanDocuments.SelectedRows[0].Cells["DocumentID"].Value, GlobalValues.Instance);
             FormInputDoc   edit = new FormInputDoc(doc, GlobalValues.Instance);
             edit.Show();
             edit.Activate();
         }
         catch (Exception exc)
         {
             ErrorMsgBox.Show("Ошибка", "Ошибка редактирования документа\r\n" + exc.Message, exc.ToString());
             return;
         }
     }
 }
        public void AddCompound(IInputDocument document)
        {
            if (document == null)
            {
                throw new ArgumentNullException(nameof(document));
            }

            var id = (ulong)Interlocked.Increment(ref nextId);

            if (document.Metadata != null)
            {
                for (int i = 0; i < document.Fields.Count; ++i)
                {
                    var reader = document.Fields[i].GetTextReader();
                    AddTerms(id, DefaultFieldId + (ulong)i, TokenizeReader(id, DefaultFieldId + (ulong)i, reader));
                }
                AddFields(id, document.Metadata);
            }
        }