コード例 #1
0
 private void btnbuscarcliente_KeyPress(object sender, KeyPressEventArgs e)
 {
     try
     {
         Clsutil.Sololetras(e);
         bunifuCustomDataGrid1.DataSource = consultas.tabla("select IDDBClientes as ID, NombreDBClientes as Nombre, ApellidoDBClientes as Apellido, TelefonoDBClientes as Telefono from DBClientes inner join DBEmpleados on DBClientes.EmpleadpDBCliente = DBEmpleados.IDDBEmpleados inner join DBEmpresa on DBEmpleados.EmpresaDBEmpleado = DBEmpresa.IDDBEmpresa where IDDBEmpresa = '" + lblidempresa.Text + "' and NombreDBClientes like  '" + btnbuscarcliente.Text + "%'");
         consultas.con.Close();
     }
     catch (Exception)
     {
         MessageBox.Show("Error en la consulta");
     }
 }
コード例 #2
0
 private void txtidmembresias_KeyPress(object sender, KeyPressEventArgs e)
 {
     Clsutil.Solonumeros(e);
     try
     {
         if ((int)e.KeyChar == (int)Keys.Enter)
         {
             if (txtidmembresias.Text != "")
             {
                 consultas.con.Close();
                 sql = "select  NombreDBClientes as Nombre ,fechainicial as  Inicial, fechaexpe as Final from DBVMembre inner join DBClientes on DBVMembre.ClienteDBVenta = DBClientes.IDDBClientes where ClienteDBVenta = '" + txtidmembresias.Text + "'";
                 consultas.Select(sql);
                 if (consultas.reader.Read())
                 {
                     if (Convert.ToDateTime(consultas.reader["Final"].ToString()) > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")))
                     {
                         lblnombre.Text = consultas.reader["Nombre"].ToString();
                         DateTime fehcfinal = Convert.ToDateTime(consultas.reader["Final"].ToString());
                         lblfechafinal.Text = fehcfinal.ToString("yyyy-MM-dd");
                         consultas.con.Close();
                         realizarbusuqeda();
                         txtidmembresias.Text = "";
                         parar();
                         iniciar();
                     }
                     else
                     {
                         bunifuPictureBox2.Visible = true;
                         txtidmembresias.Text      = "";
                         parar();
                         iniciar();
                     }
                 }
                 else
                 {
                     txtidmembresias.Text = "";
                 }
             }
         }
     }
     catch (Exception)
     {
         txtidmembresias.Text = "";
     }
 }
コード例 #3
0
 private void txtidprod_KeyPress(object sender, KeyPressEventArgs e)
 {
     Clsutil.Solonumeros(e);
     if (e.KeyChar == (char)13)
     {
         if (txtidprod.Text != "")
         {
             sql = "select * from DBProductos where IDProductoDBProductos = '" + txtidprod.Text + "'";
             util.Select(sql);
             if (Convert.ToDouble(util.reader.Read()) > 0)
             {
                 if (Convert.ToInt64(util.reader["stock"].ToString()) > 0)
                 {
                     double numero = Convert.ToDouble(util.reader["IDProductoDBProductos"].ToString());
                     descontarpro(Convert.ToInt64(numero));
                     foreach (DataGridViewRow item in bunifuCustomDataGrid1.Rows)
                     {
                         if (numero == Convert.ToDouble(item.Cells["lblid"].Value))
                         {
                             item.Cells["lblCantidad"].Value = Convert.ToInt32(item.Cells["lblCantidad"].Value) + 1;
                             item.Cells["lblTotal"].Value    = Convert.ToDouble(item.Cells["lblCantidad"].Value) * Convert.ToDouble(util.reader["PrecioDBProductos"].ToString());
                             util.con.Close();
                             sumasprod();
                             txtidprod.Text = "";
                             return;
                         }
                     }
                     bunifuCustomDataGrid1.Rows.Add(util.reader["IDProductoDBProductos"].ToString(), util.reader["NombreDBProductos"].ToString(), "1", util.reader["PrecioDBProductos"].ToString(), util.reader["PrecioDBProductos"].ToString());
                     sumasprod();
                     txtidprod.Text = "";
                 }
                 else
                 {
                     MessageBox.Show("Articulo no disponible :')");
                 }
             }
             else
             {
                 MessageBox.Show("Articulo no disponible :')");
                 txtidprod.Text = "";
             }
             util.con.Close();
         }
     }
 }
コード例 #4
0
ファイル: Frmaddplan.cs プロジェクト: carlosnagomi/Proyec
 private void txtdias_KeyPress(object sender, KeyPressEventArgs e)
 {
     Clsutil.Solonumeros(e);
 }
コード例 #5
0
ファイル: Frmaddplan.cs プロジェクト: carlosnagomi/Proyec
 private void txtnombre_KeyPress(object sender, KeyPressEventArgs e)
 {
     Clsutil.Sololetras(e);
 }
コード例 #6
0
ファイル: Frmaddmembre.cs プロジェクト: carlosnagomi/Proyec
 private void txtApellido_KeyPress(object sender, KeyPressEventArgs e)
 {
     Clsutil.Sololetras(e);
 }
コード例 #7
0
ファイル: Frmaddmembre.cs プロジェクト: carlosnagomi/Proyec
 private void txtelefonconta_KeyPress(object sender, KeyPressEventArgs e)
 {
     Clsutil.Solonumeros(e);
 }
コード例 #8
0
ファイル: Frmaddcliente.cs プロジェクト: carlosnagomi/Proyec
 private void txtteleonocone_KeyPress(object sender, KeyPressEventArgs e)
 {
     Clsutil.Solonumeros(e);
 }