private void EGuardar()
 {
     try
     {
         if (fn.Existencia("*", "Condimento", "Condimento='" + txtCategoria.Text.TrimEnd() + "'") == true)
         {
             MessageBox.Show("EL Condimento ya se encuentra Registrada", "San Agustin", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
         }
         if (txtCategoria.Text == "")
         {
             MessageBox.Show("Ingrese el Insumo", "San Agustin", MessageBoxButtons.OK, MessageBoxIcon.Information);
             txtCategoria.Focus(); return;
         }
         if (QuiereGuardar == true)
         {
             fn.Registrar("Condimento", "'" + txtCategoria.Text.TrimEnd() + "','" + cbxCategoria.SelectedValue + "'");
         }
         else
         {
             fn.Modificar("CondimEnto", "Condimento='" + txtCategoria.Text.TrimEnd() + "',IDCategoria='" + cbxCategoria.SelectedValue + "'", "IDCondimento='" + IDCategoria + "'");
         }
         Bloquear(true);
         txtCategoria.Clear();
         MostrarDatosGrid();
         QuiereGuardar = true;
     }
     catch
     {
     }
 }
Example #2
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (Guardar == true)
            {
                fn.Registrar("Productos", "'" + txtnombre.Text + "','" + txtDescripcion.Text.TrimEnd() + "','" + cbTipo.SelectedValue + "'");
                if (dgPresentacion.Rows.Count == 0)
                {
                    return;
                }

                string CodigoProducto = fn.select_one_value("max(IDProducto)", "Productos", "IDProducto!=0", 0);

                foreach (DataGridViewRow row in dgPresentacion.Rows)
                {
                    fn.Registrar("Presentacion", "'" + CodigoProducto + "','" + row.Cells["Nombre"].Value.ToString() + "','" + row.Cells["Costo"].Value.ToString() + "','" + row.Cells["Precio"].Value.ToString() + "'");
                }
            }
            else
            {
                fn.Modificar("Productos", "Nombre='" + txtnombre.Text.TrimEnd() + "',Descripcion='" + txtDescripcion.Text.TrimEnd() + "',IDCondicion='" + cbTipo.SelectedValue + "'", "IDProducto='" + IDProducto + "'");
            }
            CargarGrid();
            Desbloquear(false);
        }
Example #3
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     if (Guardar == true)
     {
         fn.Registrar("Cliente", "'" + txtnombre.Text + "','" + txtnumero.Text + "','" + txttelefono.Text + "','" + txtdireccion.Text + "'");
         Limpiar();
     }
     else
     {
         fn.Modificar("cliente", "nombre = '" + txtnombre.Text + "',numero ='" + txtnumero.Text + "',Telefono ='" + txttelefono.Text + "',Direccion ='" + txtdireccion.Text + "'", "IDCliente ='" + IDCliente + "'");
         Limpiar();
     }
     CargarGrid();
     Guardar = true;
 }
Example #4
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (Validar() != true)
            {
                return;
            }

            if (Guardar)
            {
                fn.Registrar("Proveedor", "'" + txtidentificacion.Text + "','" + txtrazonsocial.Text + "','" + txttelefono.Text + "','" + txtdireccion.Text + "','" + txtcontacto.Text + "'");
            }
            else
            {
                fn.Modificar("Proveedor", "Numero='" + txtidentificacion.Text + "',RazonSocial='" + txtrazonsocial.Text + "',Telefono='" + txttelefono.Text + "',Direccion='" + txtdireccion.Text + "',Contacto='" + txtcontacto.Text + "'", "IDProveedor='" + IDProveedor + "'");
            }
            Limpiar();
            CargarGrid();
            Bloquear(true);
        }
Example #5
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     if (txtnombreAlmacen.Text == "")
     {
         error.SetError(txtnombreAlmacen, "Debe ingresar el nombre de almacén");
         return;
     }
     error.Clear();
     if (Guardar)
     {
         fn.Registrar("Almacen", "'" + txtnombreAlmacen.Text + "','" + Convert.ToBoolean(chVender.CheckState) + "'");
     }
     else
     {
         fn.Modificar("Almacen", "Almacen = '" + txtnombreAlmacen.Text + "',PuedeVender='" + Convert.ToBoolean(chVender.Checked) + "'", "IDAlmacen='" + dgAlmacen.CurrentRow.Cells["IDAlmacen"].Value.ToString() + "'");
     }
     Limpiar();
     Grid();
     Bloquear(true);
 }