Esempio n. 1
0
        private void ClearControls()
        {
            _billData = new BillData();
            _inventoryData = new InventoryData();
            _client = null;
            _billDetail = new List<BillDetailModel>();
            _bill = new BillModel();
            _billTaxes = new List<BillTaxesModel>();
            _billSaveModel = new BillSaveModel();

            _bill = new BillModel
            {
                Id = Guid.NewGuid(),
                BillNumber = _billData.GetBillNumber(),
                DateEvent = DateTime.Now
            };
            lblNumeroFactura.Text = _bill.BillNumber.ToString().PadLeft(8, '0');
            _billTaxes = _billData.GetBillTaxes();
            _billTaxes.ForEach(x => x.IdBill = _bill.Id);
            dtgImpuestos.DataSource = _billTaxes;
            lblGranTotal.Text = "$0,00";
            txtSubTotal.Text = string.Format("{0:0.00}", 0.00);
            txtDescuentoFinal.Text = string.Format("{0:0.00}", 0.00);
            txtDescuentoCliente.Text = string.Format("{0:0.00}", 0.00);
            dtgDetalleFactura.DataSource = new List<BillDetailModel>();
            txtIdentificacionCliente.Text = string.Empty;
            txtNombreCliente.Text = string.Empty;
            txtDireccion.Text = string.Empty;
            txtTelefono.Text = string.Empty;
            txtEmail.Text = string.Empty;
            txtCodigoBarras.Text = string.Empty;
            txtNombreProducto.Text = string.Empty;
            lstProducto.DataSource = new List<InventoryModel>();
            btnBuscarProducto.Enabled = false;
            btnFacturar.Enabled = false;
        }