示例#1
0
        private void actualizar()
        {
            string sql = "update DBVMembre set fechainicial = '" + lbltimeini.Text + "', fechaexpe = '" + lbldias.Text + "' where ClienteDBVenta = '" + lblcliente.Text + "'";

            select.consultadata(sql);
            MessageBox.Show("Datos Actualizados");
        }
示例#2
0
 private void btnguardar1_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtcosto.Text != "" && txtdias.Text != "" && txtnombre.Text != "")
         {
             if (lblidplan.Text != "")
             {
                 sql = "update DBPlanes set NombreDBPlanes = '" + txtnombre.Text + "', CostoDBPlanes = '" + txtcosto.Text + "', diasDBPlanes = '" + txtdias.Text + "' where IDDBPlanes = '" + lblidplan.Text + "'";
                 consultas.consultadata(sql);
                 MessageBox.Show("Plan Actualizado");
                 borratodo();
                 Close();
             }
             else
             {
                 string sql = "insert into DBPlanes (NombreDBPlanes, CostoDBPlanes, diasDBPlanes) values ('" + txtnombre.Text + "', '" + txtcosto.Text + "', '" + txtdias.Text + "')";
                 consultas.consultadata(sql);
                 MessageBox.Show("Datos Guardados");
                 borratodo();
                 Close();
             }
         }
         else
         {
             MessageBox.Show("Datos Faltantes");
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Error", "Aviso Importante", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
     }
 }
示例#3
0
 private void guardardatos()
 {
     try
     {
         if (txtnombre.Text != "" && txtApellido.Text != "" && txtDireccion.Text != "" && txttelefono.Text != "" && txtnombreconta.Text != "" && txtDireccion.Text != "" && txtelefonconta.Text != "" && lblclientedeotroform.Text == "")
         {
             generarCliente();
             sql = "insert into DBClientes (IDDBClientes, NombreDBClientes, ApellidoDBClientes, DireccionDBClientes, TelefonoDBClientes, NombreDBClienteContacto, TelefonoDBClienteContacto, EmpleadpDBCliente) values ('" + txtidClientegene.Text + "','" + txtnombre.Text + "', '" + txtApellido.Text + "', '" + txtDireccion.Text + "', '" + txttelefono.Text + "', '" + txtnombreconta.Text + "', '" + txtelefonconta.Text + "', '" + lblidempleado.Text + "')";
             consultas.consultadata(sql);
             sql = "select * from DBClientes where NombreDBClientes = '" + txtnombre.Text + "' and TelefonoDBClienteContacto = '" + txtelefonconta.Text + "' and EmpleadpDBCliente = '" + lblidempleado.Text + "'";
             consultas.Select(sql);
             if (consultas.reader.Read())
             {
                 insertmembresias(Convert.ToDouble(consultas.reader["IDDBClientes"].ToString()));
                 consultas.con.Close();
             }
         }
         else if (txtnombre.Text != "" && txtApellido.Text != "" && txtDireccion.Text != "" && txttelefono.Text != "" && txtnombreconta.Text != "" && txtDireccion.Text != "" && txtelefonconta.Text != "" && lblclientedeotroform.Text != "")
         {
             insertmembresias(Convert.ToDouble(lblclientedeotroform.Text));
         }
         else
         {
             MessageBox.Show("Datos Faltantes, Intente de nuevo", "Aviso Importante", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Error al guardar los datos", "Aviso Importante", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
     }
 }
示例#4
0
 private void btnguardar_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtidpro.Text != "" && txtnombrepro.Text != "" && txtstockpro.Text != "" && txtcostpro.Text != "")
         {
             if (lblidprod.Text != "")
             {
                 sql = "update DBProductos set NombreDBProductos = '" + txtnombrepro.Text + "', PrecioDBProductos = '" + txtcostpro.Text + "', stock = '" + txtstockpro.Text + "', IDProductoDBProductos = '" + txtidpro.Text + "' where IDProductoDBProductos = '" + lblidprod.Text + "'";
                 util.consultadata(sql);
                 borrartodo();
                 MessageBox.Show("Datos Actualizados");
                 Close();
             }
             else
             {
                 sql = "insert into DBProductos (IDProductoDBProductos, NombreDBProductos, PrecioDBProductos, stock) values ('" + txtidpro.Text + "', '" + txtnombrepro.Text + "', '" + txtcostpro.Text + "','" + txtstockpro.Text + "')";
                 util.consultadata(sql);
                 borrartodo();
                 MessageBox.Show("Producto Guardado");
                 Close();
             }
         }
         else
         {
             MessageBox.Show("Campos Faltantes");
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Error");
     }
 }
示例#5
0
 private void descontarpro(Int64 id)
 {
     try
     {
         sql = "update DBProductos set stock = stock - 1 where IDProductoDBProductos = '" + id + "'";
         util.consultadata(sql);
     }
     catch (Exception)
     {
         MessageBox.Show("Erro al descontar al producto");
     }
 }
 private void Inserinicio()
 {
     try
     {
         consultas.con.Close();
         sql = "insert into DBRgistrosclientes (IDClienteDBRgistrosclientes, FechaInicialDBRgistrosclientes) values ('" + txtidmembresias.Text + "', '" + lblfecha.Text + "')";
         consultas.consultadata(sql);
         bunifuPictureBox1.Visible = true;
     }
     catch (Exception)
     {
         MessageBox.Show("Error");
     }
 }
示例#7
0
 private void btnguardar_Click(object sender, EventArgs e)
 {
     try
     {
         if (lblidempleado.Text != "")
         {
             selectplan();
             if (rd1mujer.Checked == false && rd1hombre.Checked == true)
             {
                 sql = "update DBEmpleados set NombreDBEmpleados = '" + txtnombre.Text + "', ApellidoDBEmpleados = '" + txtapellido.Text + "', TelefonoDBEmpleados = '" + txtelefono.Text + "', DireccionDBEmpleados = '" + txtdireccion.Text + "', SexoDBEmpleados = '1', moduloDBEmpleados= '" + lblpuesto.Text + "', ContraseDBEmpleados = '" + txtpassword.Text + "' where IDDBEmpleados = '" + lblidempleado.Text + "'";
                 util.consultadata(sql);
                 MessageBox.Show("Datos Actualizados");
                 Close();
             }
             else if (rd1hombre.Checked == false && rd1mujer.Checked == true)
             {
                 sql = "update DBEmpleados set NombreDBEmpleados = '" + txtnombre.Text + "', ApellidoDBEmpleados = '" + txtapellido.Text + "', TelefonoDBEmpleados = '" + txtelefono.Text + "', DireccionDBEmpleados = '" + txtdireccion.Text + "', SexoDBEmpleados = '2' , moduloDBEmpleados= '" + lblpuesto.Text + "', ContraseDBEmpleados = '" + txtpassword.Text + "' where IDDBEmpleados = '" + lblidempleado.Text + "'";
                 util.consultadata(sql);
                 MessageBox.Show("Datos Actualizados");
                 Close();
             }
         }
         else
         {
             selectplan();
             if (rd1mujer.Checked == false && rd1hombre.Checked == true)
             {
                 sql = "insert into DBEmpleados(NombreDBEmpleados, ApellidoDBEmpleados, TelefonoDBEmpleados, DireccionDBEmpleados, moduloDBEmpleados, SexoDBEmpleados, EmpresaDBEmpleado) values ('" + txtnombre.Text + "', '" + txtapellido.Text + "', '" + txtelefono.Text + "', '" + txtdireccion.Text + "','" + lblpuesto.Text + "', '1', '" + lblidempresa.Text + "')";
                 util.consultadata(sql);
                 MessageBox.Show("Datos Guardados");
                 Close();
             }
             else if (rd1hombre.Checked == false && rd1mujer.Checked == true)
             {
                 sql = "insert into DBEmpleados(NombreDBEmpleados, ApellidoDBEmpleados, TelefonoDBEmpleados, DireccionDBEmpleados, moduloDBEmpleados, SexoDBEmpleados, EmpresaDBEmpleado) values ('" + txtnombre.Text + "', '" + txtapellido.Text + "', '" + txtelefono.Text + "', '" + txtdireccion.Text + "','" + lblpuesto.Text + "', '2', '" + lblidempresa.Text + "')";
                 util.consultadata(sql);
                 MessageBox.Show("Datos Guardados");
                 Close();
             }
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Error");
     }
 }
示例#8
0
 private void btnguardar_Click(object sender, EventArgs e)
 {
     try
     {
         if (lbldatos.Text != "")
         {
             if (txtnombre.Text != "" && txtapellido.Text != "" && txtdireccion.Text != "" && txtelefono.Text != "" && txtnombreconta.Text != "" && txtteleonocone.Text != "")
             {
                 sql = "Update DBClientes set NombreDBClientes = '" + txtnombre.Text + "', ApellidoDBClientes = '" + txtapellido.Text + "', DireccionDBClientes = '" + txtdireccion.Text + "', TelefonoDBClientes = '" + txtelefono.Text + "', NombreDBClienteContacto = '" + txtnombreconta.Text + "', TelefonoDBClienteContacto = '" + txtteleonocone.Text + "' where IDDBClientes ='" + lbldatos.Text + "'";
                 consultas.consultadata(sql);
                 MessageBox.Show("Datos Actualizados", "Completado", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                 lbldatos.Text = null;
                 borratodo();
                 Close();
             }
             else
             {
                 MessageBox.Show("Rellene todos los datos", "Datos", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
             }
         }
         else if (lbldatos.Text == "")
         {
             generarCliente();
             if (txtnombre.Text != "" && txtapellido.Text != "" && txtdireccion.Text != "" && txtelefono.Text != "" && txtnombreconta.Text != "" && txtteleonocone.Text != "")
             {
                 sql = "insert into DBClientes (IDDBClientes, NombreDBClientes, ApellidoDBClientes, DireccionDBClientes, TelefonoDBClientes, NombreDBClienteContacto, TelefonoDBClienteContacto, EmpleadpDBCliente) values ('" + txtidcliente.Text + "','" + txtnombre.Text + "', '" + txtapellido.Text + "', '" + txtdireccion.Text + "', '" + txtelefono.Text + "', '" + txtnombreconta.Text + "', '" + txtteleonocone.Text + "', '" + lblidempleado.Text + "')";
                 consultas.consultadata(sql);
                 MessageBox.Show("Datos Guardados", "Completado", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                 lbldatos.Text = null;
                 borratodo();
                 Close();
             }
             else
             {
                 MessageBox.Show("Rellene todos los datos", "Datos", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
             }
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Error al guardar los datos");
     }
 }
示例#9
0
 private void btnguardar_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtnombremepresa.Text != "" && txttelegonoempresa.Text != "" && txtdireccionEmpresa.Text != "")
         {
             sql = "insert into DBEmpresa(NombreDBEmpresa, DireccionDBEmpresa, TelefonoDBEmpresa) values ('" + txtnombremepresa.Text + "', '" + txtdireccionEmpresa.Text + "', '" + txttelegonoempresa.Text + "')";
             consultas.consultadata(sql);
             MessageBox.Show("Empresa Creada", "Reiniciar", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Error al crear una nueva empresa");
     }
 }