private void dtgFactura_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn &&
                e.RowIndex >= 0)
            {
                var billTemp = ((List<BillModel>)senderGrid.DataSource)[e.RowIndex];
                ConverseNumberToText numberToTextInstance = new ConverseNumberToText();
                billTemp.TotalInLetters = numberToTextInstance.enletras(billTemp.Total.ToString());
                
                if (System.Configuration.ConfigurationSettings.AppSettings["PrintFormat"].ToString().ToUpper().Equals("CARTA"))
                {
                    VisorFactura visorFactura = new VisorFactura(_billData.GetBillData(billTemp), true);
                    visorFactura.Show();
                }
                else
                {
                    VisorFacturaMediaCarta visorFactura = new VisorFacturaMediaCarta(_billData.GetBillData(billTemp), true);
                    visorFactura.Show();
                }
            }            
        }
Пример #2
0
        private void PrintBill() {
            ConverseNumberToText numberToTextInstance = new ConverseNumberToText();
            _bill.TotalInLetters = numberToTextInstance.enletras(_bill.Total.ToString());
            _billSaveModel.Client = _client;
            _billSaveModel.Bill = _bill;
            _billSaveModel.BillDetail = _billDetail;
            _billSaveModel.BillTaxes = _billTaxes;

            if (System.Configuration.ConfigurationSettings.AppSettings["PrintFormat"].ToString().ToUpper().Equals("CARTA"))
            {
                VisorFactura visorFactura = new VisorFactura(_billSaveModel);
                visorFactura.Show(this);
            }
            else
            {
                VisorFacturaMediaCarta visorFactura = new VisorFacturaMediaCarta(_billSaveModel);
                visorFactura.Show(this);
            }
        }