Example #1
0
        public ventaCobro(centralVenta source)
        {
            InitializeComponent();
            this.gb.BorderColor = Color.DarkSeaGreen;
            this.Text           = "Confirmar Venta";
            this.ShowInTaskbar  = false;
            this.MinimizeBox    = false;
            behaviorDefinitions.txtPrice(this.txtpagocon);

            this.cbmodopago.KeyPress += (sender, args) =>
            {
                if (args.KeyChar == (char)Keys.Enter)
                {
                    this.txtpagocon.Focus();
                }
            };
            this.db             = new dbop();
            this.source         = source;
            this.txttotal.Text += this.source.ventatmp.total;
            this.total          = this.source.ventatmp.total;

            this.txtpagocon.KeyUp += (sender, args) =>
            {
                if (this.txtpagocon.Text.Trim() == "")
                {
                    this.txtcambio.Text = "$";
                }
                else
                {
                    this.txtcambio.Text = "$" + (Double.Parse(this.txtpagocon.Text, CultureInfo.InvariantCulture) - this.total).ToString("F2");
                }

                if (args.KeyData == Keys.F12)
                {
                    this.executeventa();
                }
            };

            this.cbticket.Checked = true;
        }
 public seleccionarCliente(centralVenta source) //CONSTRUCTOR BASADO EN FORMA VENTAS CENTRAL
 {
     InitializeComponent();
     this.MinimizeBox    = false;
     this.Text           = "Seleccionar Cliente-Venta";
     this.source         = source;
     this.db             = new dbop();
     this.txtname.KeyUp += (sender, args) =>
     {
         this.getGrid();
     };
     this.dgv.CellClick += (sender, args) =>
     {
         if (args.RowIndex > -1 && args.ColumnIndex > -1)
         {
             this.source.txtcliente.Text    = this.dgv.Rows[args.RowIndex].Cells[1].Value + " " + this.dgv.Rows[args.RowIndex].Cells[2].Value;
             this.source.txtid.Text         = this.dgv.Rows[args.RowIndex].Cells[0].Value.ToString();
             this.source.checkboxCP.Checked = false;
             this.Close();
         }
     };
     this.dgv.Cursor = Cursors.Hand;
 }