Beispiel #1
0
 public void checkin(PowerPoint.Presentation presentationDocument)
 {
     try
     {
         if (MessageBox.Show(resources.GetString("sure_check_in"), resources.GetString("checkin"), MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
         {
             String localFileName = presentationDocument.FullName;
             presentationDocument.Save();  // save document
             presentationDocument.Close(); // close document
             docXML.refresh();             // Refresh document list
             if (docXML.isOpenKMDocument(localFileName))
             {
                 OKMDocument oKMDocument = docXML.getOpenKMDocument(localFileName);
                 docXML.remove(oKMDocument);
                 DocumentLogic.checkin(oKMDocument, configXML.getHost(), configXML.getUser(), configXML.getPassword());
                 if (File.Exists(localFileName))
                 {
                     File.Delete(localFileName);
                 }
             }
         }
     }
     catch (Exception e)
     {
         String errorMsg = "OpenKMPowerPointAddIn - (checkinButton_Click)\n" + e.Message + "\n\n" + e.StackTrace;
         MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Beispiel #2
0
 public void checkin(Word._Document activeDocument)
 {
     try
     {
         if (MessageBox.Show(resources.GetString("sure_check_in"), resources.GetString("checkin"), MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
         {
             object saveChanges   = Word.WdSaveOptions.wdSaveChanges;
             object missing       = Type.Missing;
             String localFileName = activeDocument.FullName;
             activeDocument.Close(ref saveChanges, ref missing, ref missing); // Always we save document
             docXML.refresh();                                                // Refresh document list
             if (docXML.isOpenKMDocument(localFileName))
             {
                 OKMDocument oKMDocument = docXML.getOpenKMDocument(localFileName);
                 docXML.remove(oKMDocument);
                 DocumentLogic.checkin(oKMDocument, configXML.getHost(), configXML.getUser(), configXML.getPassword());
                 if (File.Exists(localFileName))
                 {
                     File.Delete(localFileName);
                 }
             }
         }
     }
     catch (Exception e)
     {
         String errorMsg = "OpenKMWordAddIn - (checkinButton_Click)\n" + e.Message + "\n\n" + e.StackTrace;
         MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Beispiel #3
0
 public void cancelCheckout(Excel.Workbook activeWorkbook)
 {
     try
     {
         if (MessageBox.Show(resources.GetString("sure_cancel_checkout"), resources.GetString("cancelcheckout"), MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
         {
             object saveChanges   = true;
             object missing       = Type.Missing;
             String localFileName = activeWorkbook.FullName;
             activeWorkbook.Close(saveChanges, missing, missing); // Always we save document
             docXML.refresh();                                    // Refresh document list
             if (docXML.isOpenKMDocument(localFileName))
             {
                 OKMDocument oKMDocument = docXML.getOpenKMDocument(localFileName);
                 docXML.remove(oKMDocument);
                 DocumentLogic.cancelCheckout(oKMDocument, configXML.getHost(), configXML.getUser(), configXML.getPassword());
                 if (File.Exists(localFileName))
                 {
                     File.Delete(localFileName);
                 }
             }
         }
     }
     catch (Exception e)
     {
         String errorMsg = "OpenKMExcelAddIn - (cancelCheckoutButton_Click)\n" + e.Message + "\n\n" + e.StackTrace;
         MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Beispiel #4
0
        public void GetListOfDocumentsByDateRange()
        {
            var documentLogic = new DocumentLogic(_jsonLogic);
            var result        = documentLogic.GetDocumentsByDate(new DateTime(2017, 4, 30), new DateTime(2017, 5, 16));

            Assert.AreEqual(result.Count(), 4);
        }
Beispiel #5
0
        public void GetListOfDocumentsByExactDate()
        {
            var documentLogic = new DocumentLogic(_jsonLogic);
            var result        = documentLogic.GetDocumentsByDate(new DateTime(2017, 4, 19));

            Assert.AreEqual(result.Count(), 3);
        }
Beispiel #6
0
        public void UpdateTTNTest()
        {
            var documentLogic = new DocumentLogic(_jsonLogic);
            var ttn           = "20450037372708";
            var document      = documentLogic.GetDocumentByTTN(ttn);

            var cost        = document.Cost;
            var rnd         = new Random();
            var randomPrice = rnd.Next(1, 1000);

            if (cost == randomPrice)
            {
                randomPrice = rnd.Next(1, 1000);
            }

            document.Cost     = randomPrice;
            document.DateTime = DateTime.Now;
            document.PreferredDeliveryDate = null;
            document.SendersPhone          = "380934602822";
            document.RecipientsPhone       = "380934602823";

            documentLogic.UpdateTTN(document);
            var updatedDocument = documentLogic.GetDocumentByTTN(ttn);

            Assert.AreEqual(updatedDocument.Cost, randomPrice);
        }
Beispiel #7
0
        //Accept button
        private void accept_Click(object sender, EventArgs e)
        {
            String localFileName = "";

            try
            {
                disableAllButtons();
                if (application is Word.Document)
                {
                    Word.Document activeDocument = ((Word.Document)application);
                    activeDocument.Save(); // Saves the document
                    localFileName = activeDocument.FullName;
                }
                else if (application is Excel.Workbook)
                {
                    Excel.Workbook actitiveWorkBook = ((Excel.Workbook)application);
                    actitiveWorkBook.Save(); // Saves the document;
                    localFileName = actitiveWorkBook.FullName;
                }
                else if (application is PowerPoint.Presentation)
                {
                    PowerPoint.Presentation activePresentation = ((PowerPoint.Presentation)application);
                    activePresentation.Save(); // Saves the document
                    localFileName = activePresentation.FullName;
                }
                else if (application is Visio.Document)
                {
                    Visio.Document activeDocument = ((Visio.Document)application);
                    activeDocument.Save(); // Saves the document
                    localFileName = activeDocument.FullName;
                }
                else if (application is String)
                {
                    localFileName = (String)application;
                }

                String docPath = Util.getOpenKMPath(localFileName, (MSOpenKMCore.ws.folder)actualNode.Tag);
                // Must save a temporary file to be uploaded
                File.Copy(localFileName, localFileName + "_TEMP");
                localFileName = localFileName + "_TEMP";
                DocumentLogic.create(localFileName, docPath, configXML.getHost(), configXML.getUser(), configXML.getPassword());
                File.Delete(localFileName); // Deletes temporary file
                MessageBox.Show(resources.GetString("uploaded"));
            }
            catch (Exception ex)
            {
                // Ensure temporary file is deleted
                if (!localFileName.Equals("") && File.Exists(localFileName))
                {
                    File.Delete(localFileName); // Deletes temporary file
                }
                String errorMsg = "TreeForm - (accept_Click)\n" + ex.Message + "\n\n" + ex.StackTrace;
                MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            finally
            {
                Hide();
            }
        }
Beispiel #8
0
        public void CreateNewDocumentTest()
        {
            var documentLogic = new DocumentLogic(_jsonLogic);
            var document      = CreateSimpleDoument();
            var result        = documentLogic.CreateInternetDocument(document);

            Assert.Greater(result.CostOnSite, 1);
        }
Beispiel #9
0
        public void GetDocumentByTTNTest()
        {
            var documentLogic = new DocumentLogic(_jsonLogic);
            var ttn           = "20450037372708";
            var result        = documentLogic.GetDocumentByTTN(ttn);

            Assert.AreEqual(result.IntDocNumber, ttn);
        }
        private void InitNewReceiptsDespatchs()
        {
            _documentLogic           = new DocumentLogic();
            documentTypeDictionary   = new Dictionary <int, string>();
            documentStatusDictionary = new Dictionary <int, string>();
            _clientLogic             = new ClientLogic();
            _warehouseLogic          = new WarehouseLogic();
            documentTypeDictionary.Add(2, "Svi");
            documentTypeDictionary.Add(0, "Prijemnica");
            documentTypeDictionary.Add(1, "Otpremnica");
            cmbDocumentType.DisplayMember = "Value";
            cmbDocumentType.ValueMember   = "Key";
            cmbDocumentType.DropDownStyle = ComboBoxStyle.DropDownList;
            cmbDocumentType.DataSource    = documentTypeDictionary.ToList();


            documentStatusDictionary = new Dictionary <int, string>
            {
                { 3, "Svi" },
                { 0, "Neplaćeni" },
                { 1, "Plaćeni" },
                { 2, "Storno" }
            };
            cmbDocumentStatus.DisplayMember = "Value";
            cmbDocumentStatus.ValueMember   = "Key";
            cmbDocumentStatus.DropDownStyle = ComboBoxStyle.DropDownList;
            dtCreatedDateFrom.Format        = DateTimePickerFormat.Custom;
            dtCreatedDateFrom.Value         = DateTime.Today.AddDays(-30);
            dtCreatedDateTo.Format          = DateTimePickerFormat.Custom;
            dtCreatedDateFrom.CustomFormat  = "MM/dd/yyyy";
            dtCreatedDateTo.CustomFormat    = "MM/dd/yyyy";
            cmbDocumentStatus.DataSource    = documentStatusDictionary.ToList();

            var statuses = new List <Status>()
            {
                new Status()
                {
                    ID = 0, Name = "Neplaćeni"
                }, new Status()
                {
                    ID = 1, Name = "Plaćeni"
                }, new Status()
                {
                    ID = 2, Name = "Storno"
                }
            };

            documentTypeBindingSource.DataSource = statuses.ToList();
            //  documentBindingSource.DataSource = _documentLogic.GetDocumentForLast30Days();
            clientBindingSource.DataSource    = _clientLogic.GetAllClients();
            warehouseBindingSource.DataSource = _warehouseLogic.GetAllWarehouse();

            DGVNewReceiptDespatch.DataError      += DGVNewReceiptDespatch_DataError;
            DGVNewReceiptDespatch.SelectionMode   = DataGridViewSelectionMode.FullRowSelect;
            DGVNewReceiptDespatch.DoubleClick    += SelectedRow_DoubleClick;
            DGVNewReceiptDespatch.CellFormatting += DGVNewReceiptDespatch_CellFormatting;
        }
Beispiel #11
0
        public void TryCreateDocuments()
        {
            DocumentLogic document = new DocumentLogic();
            var           bval     = document.CheckingTheFileName(new DocumentForPrint {
                Name = "Document1"
            });

            Assert.True(bval);
        }
Beispiel #12
0
 public void TestUnreceivedDocuments()
 {
     var      rl     = new Report(_jsonLogic);
     var      dl     = new DocumentLogic(_jsonLogic);
     DateTime start  = new DateTime(2017, 1, 1);
     DateTime end    = new DateTime(2017, 5, 19);
     var      res    = dl.GetDocumentsByDate(start, end);
     var      result = rl.GetUnreceivedDocuments(res);
     int      a      = 0;
 }
Beispiel #13
0
        public ActionResult Index(DocumentViewModel model)
        {
            if (ModelState.IsValid)
            {
                var documentLogic = new DocumentLogic();

                model.Output = documentLogic.ProcessDocument(model);
            }

            return(View(model));
        }
Beispiel #14
0
        public IEnumerable <Document> GetUnreceivedDocuments(IEnumerable <Document> documents)
        {
            var allDocuments = new DocumentLogic(_jsonLogic).GetStatusDocuments(documents);

            foreach (var doc in allDocuments)
            {
                int a = 0;
            }

            //var unReceived = from document in allDocuments
            //                 where document.StateId
            return(allDocuments);
            //}
        }
        public ActionResult Verification(string[] arrValue)
        {
            try
            {
                DocumentLogic.getInstance().Verification(arrValue[0]);
                TempData["Success"] = "Success verification for " + arrValue[0];
            }
            catch (Exception e)
            {
                TempData["Error"] = "Error verification for " + arrValue[0];
                Logging.Log.getInstance().CreateLogError(e);
            }

            return(RedirectToAction("Detail", "Users", new { id = arrValue[1] }));
        }
        private PagedList <DocumentModels> Document(string id)
        {
            List <DocumentModels> list = DocumentLogic.getInstance().getAllDocumentByUser(id);
            var page = new PagedList <DocumentModels>();

            try
            {
                page.Content = list;
            }
            catch (Exception e)
            {
                Logging.Log.getInstance().CreateLogError(e);
            }
            return(page);
        }
        public ActionResult Upload(DocumentModels model)
        {
            try
            {
                if (DocumentLogic.getInstance().CheckExistingDocument(model))
                {
                    DocumentLogic.getInstance().Add(model);
                    TempData["Success"] = "Success saving Data for " + model.NIP;
                }
                else
                {
                    TempData["Error"] = "Document " + model.DocumentNo + " is exist";
                }
            }
            catch (Exception e)
            {
                TempData["Error"] = "Error saving Data for " + model.NIP;
                Logging.Log.getInstance().CreateLogError(e);
            }

            return(RedirectToAction("Detail", "Users", new { id = model.NIP }));
        }
Beispiel #18
0
        public void CreateNewCashOnDeliveryDocumentTest()
        {
            var documentLogic = new DocumentLogic(_jsonLogic);
            var document      = CreateSimpleDoument();


            var record = new BackwardDeliveryData()
            {
                PayerType        = "Recipient",
                CargoType        = "Money",
                RedeliveryString = document.Cost.ToString()
            };


            document.BackwardDeliveryData = new List <BackwardDeliveryData> {
                record
            };

            var result = documentLogic.CreateInternetDocument(document);

            Assert.Greater(result.CostOnSite, 1);
        }
        public ActionResult FileUploadCreate(HttpPostedFileBase file, Document document)
        {
            if (ModelState.IsValid && file != null)
            {
                var filePath = new DocumentLogic().AddNewFile(file);
                //fantasyQuiz.QuestionImageUrl = imageUrl;

                document.DocumentLink     = filePath;
                document.OriginalFileName = file.FileName;

                document.AppUserId    = 1;
                document.DocumentGUID = Guid.NewGuid();
                document.dtCreated    = DateTime.Now;

                db.Documents.Add(document);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AppUserId          = new SelectList(db.AppUsers, "AppUserId", "Email");
            ViewBag.DocumentCategoryId = new SelectList(db.DocumentCategories, "DocumentCategoryId", "DocumentCategoryDesc");
            return(View(document));
        }
Beispiel #20
0
        // edit button
        private void edit_Click(object sender, EventArgs e)
        {
            try
            {
                if (dataGridView.RowCount > 0 && dataGridView.SelectedRows.Count > 0)
                {
                    bool editFile = true;
                    MSOpenKMCore.ws.document doc = (MSOpenKMCore.ws.document)dataGridView.Rows[dataGridView.SelectedRows[0].Index].Tag;

                    // We try to advice user in case selects some document extension that seems not be good to be opened with MS Word
                    if (formType.Equals(OKMDocumentType.TYPE_WORD))
                    {
                        if (!Util.isDocumentValidToOpenWithMSWord(doc))
                        {
                            String msg = String.Format(resources.GetString("word_document_extension_warning"), Util.getDocumentName(doc));
                            editFile = (MessageBox.Show(msg, "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK);
                        }
                    }
                    else if (formType.Equals(OKMDocumentType.TYPE_EXCEL))
                    {
                        if (!Util.isDocumentValidToOpenWithMSExcel(doc))
                        {
                            String msg = String.Format(resources.GetString("excel_document_extension_warning"), Util.getDocumentName(doc));
                            editFile = (MessageBox.Show(msg, "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK);
                        }
                    }
                    else if (formType.Equals(OKMDocumentType.TYPE_POWER_POINT))
                    {
                        if (!Util.isDocumentValidToOpenWithMSPowerPoint(doc))
                        {
                            String msg = String.Format(resources.GetString("powerpoint_document_extension_warning"), Util.getDocumentName(doc));
                            editFile = (MessageBox.Show(msg, "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK);
                        }
                    }
                    else if (formType.Equals(OKMDocumentType.TYPE_VISIO))
                    {
                        if (!Util.isDocumentValidToOpenWithMSVisio(doc))
                        {
                            String msg = String.Format(resources.GetString("visio_document_extension_warning"), Util.getDocumentName(doc));
                            editFile = (MessageBox.Show(msg, "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK);
                        }
                    }

                    if (editFile)
                    {
                        MSOpenKMCore.bean.OKMDocument oKMDocument = DocumentLogic.checkoutDocument(doc, formType, configXML.getHost(), configXML.getUser(), configXML.getPassword());
                        if (oKMDocument != null)
                        {
                            documentXML.add(oKMDocument);
                            object missingValue = Type.Missing;
                            object readOnly     = false;
                            object fileName     = oKMDocument.getLocalFilename();

                            if (application is Word.Documents)
                            {
                                ((Word.Documents)application).Open(ref fileName,
                                                                   ref missingValue, ref readOnly, ref missingValue, ref missingValue, ref missingValue,
                                                                   ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue,
                                                                   ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue);
                            }
                            else if (application is Excel.Workbooks)
                            {
                                ((Excel.Workbooks)application).Open(oKMDocument.getLocalFilename(),
                                                                    missingValue, readOnly, missingValue, missingValue, missingValue,
                                                                    missingValue, missingValue, missingValue, missingValue, missingValue,
                                                                    missingValue, missingValue, missingValue, missingValue);
                            }
                            else if (application is PowerPoint.Presentations)
                            {
                                ((PowerPoint.Presentations)application).Open(oKMDocument.getLocalFilename(), Office.MsoTriState.msoFalse, Office.MsoTriState.msoFalse,
                                                                             Office.MsoTriState.msoTrue);
                            }
                            else if (application is Visio.Documents)
                            {
                                ((Visio.Documents)application).Open(oKMDocument.getLocalFilename());
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                String errorMsg = "ExplorerForm - (edit_Click)\n" + ex.Message + "\n\n" + ex.StackTrace;
                MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            finally
            {
                Hide();
            }
        }
        private void InitDocument()
        {
            _articalLogic   = new ArticalLogic();
            _documentLogic  = new DocumentLogic();
            _warehouseLogic = new WarehouseLogic();
            if (FormMode == FormMode.New)
            {
                _document = new Document();
                _documentLogic.AddDocument(_document);

                // datum
                _document.DocumentDateTime = DateTime.Now;
                _document.PaymentEndDate   = DateTime.Now;
                _document.PaymentDate      = DateTime.Now;
                _document.DocumentType     = DocumentTypeID;
                string documentNumber = "";
                string middle         = _documentLogic.GetLastNoForDoument(_document.DocumentDateTime.Year, DocumentTypeID) + "-" + DateTime.Now.Year;
                string end            = "";
                switch (DocumentTypeID)
                {
                case 0:
                    documentNumber = "P";
                    break;

                case 1:
                    documentNumber = "O";
                    break;

                case 2:
                    _client              = _documentForPayment.Client;
                    _document.ClientID   = _documentForPayment.ClientID;
                    _document.TotalPrice = _documentForPayment.TotalPrice;
                    documentNumber       = "DO";
                    end = " {" + _documentForPayment.DocumentNo + "}";
                    //  _client = _document.Client;
                    _document.LinkDocumentNo = _documentForPayment.DocumentNo;
                    _document.DocumentType   = 2;
                    break;

                default:
                    break;
                }
                documentNumber      += "-" + middle + end;
                _document.DocumentNo = documentNumber;// (DocumentTypeID == 0 ? "P" : "O") + "-" + _documentLogic.GetLastNoForDoument(_document.DocumentDateTime.Year, DocumentTypeID) + "-" + DateTime.Now.Year;
            }
            else if (FormMode == FormMode.Modifying || FormMode == FormMode.ReadOnly)
            {
                _document = _documentLogic.GetDocument(SelectedDocument.ID);
                _client   = _document.Client;
                if (FormMode == FormMode.ReadOnly)
                {
                    SetAllControlsReadOnly();
                }
            }

            if (_client != null)
            {
                BindClientProperties();
            }

            tbTotalWithVAT.DataBindings.Clear();
            tbTotalWithVAT.DataBindings.Add("Text", _document, "TotalPrice");
            tbDocumentNo.DataBindings.Clear();
            tbDocumentNo.DataBindings.Add("Text", _document, "DocumentNo");
            tbSpoljniBroj.DataBindings.Clear();
            tbSpoljniBroj.DataBindings.Add("Text", _document, "LinkDocumentNo");
            dtpCreationDate.DataBindings.Clear();
            dtpCreationDate.DataBindings.Add("Value", _document, "DocumentDateTime");
            dtpEndDateForPayment.DataBindings.Clear();
            dtpEndDateForPayment.DataBindings.Add("Value", _document, "PaymentEndDate");
            dtpPaymentDate.DataBindings.Clear();
            dtpPaymentDate.DataBindings.Add("Value", _document, "PaymentDate");

            // status
            cmbStatus.DisplayMember = "Description";
            cmbStatus.DataSource    = Enum.GetValues(typeof(Classes.Lib.StatusEnum))
                                      .Cast <Enum>()
                                      .Select(value => new
            {
                (Attribute.GetCustomAttribute(value.GetType().GetField(value.ToString()), typeof(DescriptionAttribute)) as DescriptionAttribute).Description,
                v = (int)(Enum.Parse(typeof(Classes.Lib.StatusEnum), value.ToString()))
            })
                                      .OrderBy(item => item.v)
                                      .ToList();
            cmbStatus.SelectedIndex = _document.StatusID;
            // magacini
            cmbWarehouse.DataSource            = _warehouseLogic.GetAllWarehouse();
            cmbWarehouse.DisplayMember         = "Name";
            cmbWarehouse.ValueMember           = "WarehouseTypeID";
            cmbWarehouse.SelectedIndex         = 1;
            cmbWarehouse.SelectedIndexChanged += CmbWarehouse_ValuseChanged;

            // tip dokumenta
            cmbDocumentType.DisplayMember = "Description";
            cmbDocumentType.DataSource    = Enum.GetValues(typeof(Classes.Lib.DocumentType))
                                            .Cast <Enum>()
                                            .Select(value => new
            {
                (Attribute.GetCustomAttribute(value.GetType().GetField(value.ToString()), typeof(DescriptionAttribute)) as DescriptionAttribute).Description,
                v = (int)(Enum.Parse(typeof(Classes.Lib.DocumentType), value.ToString()))
            })
                                            .OrderBy(item => item.v)
                                            .ToList();
            cmbDocumentType.Enabled       = false;
            cmbDocumentType.SelectedIndex = _document.DocumentType;
            this.Text = cmbDocumentType.Text;

            listaArtikla = _articalLogic.GetAllArticlesByWarehouseType(cmbWarehouse.SelectedIndex);
            documentItemBindingSource.DataSource = _document.DocumentItems;


            articleBindingSource.DataSource           = listaArtikla;
            documentItemBindingSource.ListChanged    += DocumentItemBindingSource_ListChanged;
            documentItemBindingSource.CurrentChanged += DocumentItemBindingSource_CurrentChanged;

            DGVReceiptsDespatchsItems.DataError        += DGVReceiptsDespatchsItems_DataError;
            DGVReceiptsDespatchsItems.CellValueChanged += DGVReceiptsDespatchsItems_CellValueChanged;
            DGVReceiptsDespatchsItems.CellContentClick += DGVReceiptsDespatchsItems_CellContentClick;
            DGVReceiptsDespatchsItems.CellFormatting   += DGVReceiptsDespatchsItems_CellFormatting;

            if (_document.DocumentType == (int)DocumentType.Payment)
            {
                DGVReceiptsDespatchsItems.Enabled = false;
                tbTotalWithVAT.Text = _document.TotalPrice.ToString("N2");
            }
            else
            {
                inload = true;
                InitUnboundColumns();
                inload = false;
            }
            DGVReceiptsDespatchsItems.Update();
            DGVReceiptsDespatchsItems.Refresh();
        }