Esempio n. 1
0
        private void tbtnGoTo_ItemClick(object sender, TileItemEventArgs e)
        {
            ExceptionHandler.HandleException(() =>
            {
                invoiceId                    = Convert.ToInt32(vwBillList.GetFocusedRowCellValue("InvoiceId"));
                var getBill                  = _invoiceService.Get(invoiceId);
                var getSaleDetails           = _saleInvoiceService.Get(invoiceId);
                tabPanel.SelectedPage        = tabNewBill;
                tabNewBill.Caption           = "Fatura";
                cmbInvoiceType.SelectedIndex = getBill.InvoiceType;
                cmbInvoiceType.Enabled       = false;
                if (getBill.InvoiceType == 0)
                {
                    tbtnPrint.Enabled      = true;
                    txtRefNo.Text          = getSaleDetails.RefNumber;
                    txtOrderedBy.Text      = getSaleDetails.OrderedBy;
                    txtOrderNo.Text        = getSaleDetails.OrderNo;
                    txtRequest.Text        = getSaleDetails.RequestedBy;
                    dtpOrderDate.EditValue = getSaleDetails.OrderDate;
                }
                dtpExpiry.Text           = getBill.ExpiryPeriod.ToString();
                txtNo.Text               = getBill.Number.ToString();
                txtSerie.Text            = getBill.Serie;
                txtWaybillNo.Text        = getBill.WaybillNumber.ToString();
                txtTaxRate.Text          = getBill.TaxRate.ToString();
                cmbWithholding.EditValue = getBill.WithholdingRate;
                cmbCustomers.EditValue   = getBill.CustomerId;
                dtpDate.EditValue        = getBill.InvoiceDate;

                invoiceLines       = new BindingList <InvoiceLine>(_invoiceLineService.GetLines(invoiceId));
                grdBill.DataSource = invoiceLines;
                vwBill.OptionsBehavior.ReadOnly       = true;
                colProduct.OptionsColumn.AllowFocus   = false;
                colQuantity.OptionsColumn.AllowFocus  = false;
                colUnitPrice.OptionsColumn.AllowFocus = false;
                tbtnSave.Enabled        = false;
                tbtnAttachments.Visible = true;
            });
        }