Exemplo n.º 1
0
        public static void Ingreso_Retiro(int retiro, string identidad, int recibo, string numero, string fecha)
        {
            OpenConnection();

            SqlCommand command = new SqlCommand();

            command.CommandText = "SP_Ingreso_Retiro";
            command.Connection  = connection;
            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.Add(new SqlParameter("@Codigo", retiro));
            command.Parameters.Add(new SqlParameter("@Identidad", identidad));
            command.Parameters.Add(new SqlParameter("@Recibo", recibo));
            command.Parameters.Add(new SqlParameter("@Numero", numero));
            command.Parameters.Add(new SqlParameter("@Fecha", fecha));

            try
            {
                command.ExecuteNonQuery();
                CloseConnection();
            }
            catch (SqlException e)
            {
                MessageBoxTemporal.Show(e.Message, "Mensaje Imporante", 3, false);

                CloseConnection();
            }
        }
Exemplo n.º 2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (txtTelefono.MaskFull && txtNombre.Text != "" && txtApellido.Text != "" && Validar_Correo(txtCorreo.Text))
     {
         if (BD.Ingreso_Cliente(txtIDComp.Text, txtNombre.Text, txtApellido.Text, txtTelefono.Text, txtCorreo.Text, 1, "Cliente") == 0)
         {
             MessageBoxTemporal.Show("Identidad encontrada en otro registro, utilice otra o el cliente ya está agregado", "Mensaje Importante", 2, false);
         }
         else
         {
             for (int i = 0; i < Objetos_Globales.articulos.Count; i++)
             {
                 BD.Actualizar_Estado_Articulo(((Articulo)Objetos_Globales.articulos[i]).NumeroSerie, ((Articulo)Objetos_Globales.articulos[i]).NumeroRecibo, 3, "Articulo");
             }
             MessageBoxTemporal.Show("Ingresado correctamente", "Mensaje Importante", 1, false);
             Objetos_Globales.cliente.nombre_Cliente    = txtNombre.Text;
             Objetos_Globales.cliente.apellido_Cliente  = txtApellido.Text;
             Objetos_Globales.cliente.telefono_Cliente  = txtTelefono.Text;
             Objetos_Globales.cliente.correo_Cliente    = txtCorreo.Text;
             Objetos_Globales.cliente.identidad_Cliente = txtIDComp.Text;
             btnAdd.Enabled = false;
         }
     }
     else
     {
         MessageBoxTemporal.Show("Ha ingresado incorrectamente algunos datos!\nPorfavor Reviselos.", "Mensaje Importante", 2, false);
     }
 }
Exemplo n.º 3
0
        public static void Ingreso_Factura(int codigoFactura, string identidad, int codigoUsuario, string fecha)
        {
            OpenConnection();

            SqlCommand command = new SqlCommand();

            command.CommandText = "SP_Ingreso_Facturacion";
            command.Connection  = connection;
            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.Add(new SqlParameter("@CodFact", codigoFactura));
            command.Parameters.Add(new SqlParameter("@ID_Cliente", identidad));
            command.Parameters.Add(new SqlParameter("@Cod_Us", codigoUsuario));
            command.Parameters.Add(new SqlParameter("@Fecha", fecha));

            try
            {
                command.ExecuteNonQuery();

                CloseConnection();
            }
            catch
            {
                MessageBoxTemporal.Show("No pudo realizarse la operación", "Mensaje Imporante", 1, false);
                CloseConnection();
            }
        }
Exemplo n.º 4
0
        public static void Actualizar_Estado_Articulo(string Num_Serie, int Num_Recibo, int Cod_Estado, string Tipo)
        {
            OpenConnection();

            SqlCommand command = new SqlCommand();

            command.CommandText = "SP_Actualizar_Estado_Articulo";
            command.Connection  = connection;
            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.Add(new SqlParameter("@Num_Serie", Num_Serie));
            command.Parameters.Add(new SqlParameter("@Recibo", Num_Recibo));
            command.Parameters.Add(new SqlParameter("@Estado", Cod_Estado));
            command.Parameters.Add(new SqlParameter("@Estado_Tipo", Tipo));

            try
            {
                command.ExecuteNonQuery();
                CloseConnection();
            }
            catch
            {
                MessageBoxTemporal.Show("No se encontro el articulo", "Error", 2, false);
                CloseConnection();
            }
        }
Exemplo n.º 5
0
        public static void Ingreso_Articulo_Vendido(int codigoFactura, string numeroSerie, int recibo, double precio)
        {
            OpenConnection();

            SqlCommand command = new SqlCommand();

            command.CommandText = "SP_Ingreso_Fact_Detalle";
            command.Connection  = connection;
            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.Add(new SqlParameter("@Cod_Fact", codigoFactura));
            command.Parameters.Add(new SqlParameter("@Num_Serie", numeroSerie));
            command.Parameters.Add(new SqlParameter("@Cod_Rec", recibo));
            command.Parameters.Add(new SqlParameter("@Prec_Vent", precio));
            try
            {
                command.ExecuteNonQuery();
                CloseConnection();
            }
            catch
            {
                MessageBoxTemporal.Show("No pudo realizarse la operación", "Mensaje Imporante", 1, false);
                CloseConnection();
            }
        }
Exemplo n.º 6
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (BD.Busqueda_Interes(int.Parse(txtCodigoPago.Text)) == 0)
     {
         if (double.Parse(txtIngresado.Text) < double.Parse(txtMonto.Text))
         {
             MessageBoxTemporal.Show("El monto ingresado no es suficiente para pagar", "Mensaje importante", 1, false);
         }
         else
         {
             if (BD.Modificar_Meses(Objetos_Mantenimiento.articuloMantenimiento.NumeroRecibo, Objetos_Mantenimiento.articuloMantenimiento.NumeroSerie, Objetos_Mantenimiento.articuloMantenimiento.Meses - int.Parse(numMeses.Value.ToString())) > 0)
             {
                 BD.Ingreso_Pago_Interes(Objetos_Mantenimiento.articuloMantenimiento.NumeroRecibo, Objetos_Mantenimiento.articuloMantenimiento.NumeroSerie,
                                         int.Parse(txtCodigoPago.Text), txtCliente.Text, Objetos_Globales.fechaHoyCorta(), double.Parse(txtMonto.Text),
                                         Objetos_Globales.usuario.codigo_Usuario);
                 MessageBoxTemporal.Show("Transaccion Finalizada", "Mensaje importante", 1, false);
                 this.Hide();
                 Menu men = new Sistema_Empenos_Anderson.Menu();
                 men.Show();
             }
             else
             {
                 MessageBoxTemporal.Show("Ha ocurrido un error", "Mensaje importante", 1, false);
             }
         }
     }
     else
     {
         MessageBoxTemporal.Show("Este codigo de pago ya fue utilizado", "Mensaje Importante", 2, false);
     }
 }
Exemplo n.º 7
0
        public static void Ingreso_Pago_Interes(int recibo, string numeroSerie, int codigoCuota, string identidad, string fecha, double pago, int codigoUsuario)
        {
            OpenConnection();

            SqlCommand command = new SqlCommand();

            command.CommandText = "SP_Ingreso_Pago_Interes";
            command.Connection  = connection;
            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.Add(new SqlParameter("@Codigo_Recibo", recibo));
            command.Parameters.Add(new SqlParameter("@Numero_Serie", numeroSerie));
            command.Parameters.Add(new SqlParameter("@Codigo_Cuota", codigoCuota));
            command.Parameters.Add(new SqlParameter("@Identidad", identidad));
            command.Parameters.Add(new SqlParameter("@Fecha", fecha));
            command.Parameters.Add(new SqlParameter("@Pago", pago));
            command.Parameters.Add(new SqlParameter("@Codigo_Usuario", codigoUsuario));

            try
            {
                command.ExecuteNonQuery();
                CloseConnection();
            }
            catch (SqlException e)
            {
                MessageBoxTemporal.Show(e.Message, "Mensaje Imporante", 3, false);

                CloseConnection();
            }
        }
Exemplo n.º 8
0
 private void btnAñadir_Click(object sender, EventArgs e)
 {
     if (txtTelefono.MaskFull && txtNombre.Text != "" && txtApellido.Text != "" && Validar_Correo(txtCorreo.Text))
     {
         if (BD.Ingreso_Cliente(txtIdentidad.Text, txtNombre.Text, txtApellido.Text, txtTelefono.Text, txtCorreo.Text, 1, "Cliente") == 0)
         {
             MessageBoxTemporal.Show("Identidad encontrada en otro registro, utilice otra o el cliente ya está agregado", "Mensaje Importante", 2, false);
         }
         else
         {
             MessageBoxTemporal.Show("Ingresado correctamente", "Mensaje Importante", 1, false);
             Objetos_Globales.cliente.nombre_Cliente    = txtNombre.Text;
             Objetos_Globales.cliente.apellido_Cliente  = txtApellido.Text;
             Objetos_Globales.cliente.telefono_Cliente  = txtTelefono.Text;
             Objetos_Globales.cliente.correo_Cliente    = txtCorreo.Text;
             Objetos_Globales.cliente.identidad_Cliente = txtBusqueda_ID.Text;
             dtgv_Info_Cliente.Rows[0].Cells[0].Value   = Objetos_Globales.cliente.nombre_Cliente;
             dtgv_Info_Cliente.Rows[0].Cells[1].Value   = Objetos_Globales.cliente.apellido_Cliente;
             dtgv_Info_Cliente.Rows[0].Cells[2].Value   = Objetos_Globales.cliente.telefono_Cliente;
             dtgv_Info_Cliente.Rows[0].Cells[3].Value   = Objetos_Globales.cliente.correo_Cliente;
             btnAvanzar.Enabled = true;
         }
     }
     else
     {
         MessageBoxTemporal.Show("Ha ingresado incorrectamente algunos datos!\nPorfavor Reviselos.", "Mensaje Importante", 2, false);
     }
 }
Exemplo n.º 9
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (txtIdentidadMod.MaskFull)
     {
         if (BD.Busqueda_Cliente(txtIdentidadMod.Text) > 0)
         {
             txtNombreMod.Text      = Objetos_Globales.cliente.nombre_Cliente;
             txtApellidoMod.Text    = Objetos_Globales.cliente.apellido_Cliente;
             txtTelefonoMod.Text    = Objetos_Globales.cliente.telefono_Cliente;
             txtCorreoMod.Text      = Objetos_Globales.cliente.correo_Cliente;
             txtNombreMod.Enabled   = true;
             txtApellidoMod.Enabled = true;
             txtTelefonoMod.Enabled = true;
             txtCorreoMod.Enabled   = true;
             btnAceptar.Enabled     = true;
         }
         else
         {
             MessageBoxTemporal.Show("No se encuentra al cliente", "Error", 1, false);
         }
     }
     else
     {
         MessageBoxTemporal.Show("Ingrese bien la identidad", "Error", 1, false);
     }
 }
Exemplo n.º 10
0
 private void bttBuscar_Click(object sender, EventArgs e)
 {
     if (txtID_Cliente.MaskFull)
     {
         if (BD.Busqueda_Cliente(txtID_Cliente.Text) > 0)
         {
             if (Objetos_Globales.cliente.estado == 2)
             {
                 MessageBoxTemporal.Show("Cliente ya eliminado", "Error", 1, false);
             }
             else
             {
                 txtNombre.Text  = Objetos_Globales.cliente.nombre_Cliente + Objetos_Globales.cliente.apellido_Cliente;
                 txtEstado.Text  = "Activo";
                 bttElim.Enabled = true;
             }
         }
         else
         {
             MessageBoxTemporal.Show("No se encuentra al cliente", "Error", 1, false);
         }
     }
     else
     {
         MessageBoxTemporal.Show("Ingrese bien la identidad", "Error", 1, false);
     }
 }
Exemplo n.º 11
0
 private void btnRetirar_Click(object sender, EventArgs e)
 {
     if (txtRetiro.Text == "" || txtMontoPagado.Text == "")
     {
         MessageBoxTemporal.Show("Error no deje los campos vacios", "Error", 2, false);
     }
     else
     if (BD.Busqueda_Retiro(int.Parse(txtRetiro.Text)) == 0)
     {
         if (Double.Parse(txtMontoPagado.Text) < Objetos_Mantenimiento.articuloMantenimiento.PrecioPago(Objetos_Mantenimiento.articuloMantenimiento.Meses) || txtMontoPagado.Text == null)
         {
             MessageBoxTemporal.Show("El valor ingresado no puede ser menor al monto a pagar", "Alerta", 2, false);
         }
         else
         {
             double cambio = 0;
             BD.Actualizar_Estado_Articulo(txtSerie.Text, int.Parse(txtRecibo.Text), 4, "Articulo");
             cambio = double.Parse(txtMontoPagado.Text) - Objetos_Mantenimiento.articuloMantenimiento.PrecioPago(Objetos_Mantenimiento.articuloMantenimiento.Meses);
             MessageBoxTemporal.Show("El articulo fue retirado con exito\nCambio:" + cambio, "Informacion", 2, false);
             try {
                 BD.Ingreso_Retiro(int.Parse(txtRetiro.Text), Objetos_Globales.identidadTemporal, int.Parse(txtRecibo.Text), txtSerie.Text, Objetos_Globales.fechaHoyCorta());
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.ToString());
             }
             this.Close();
         }
     }
     else
     {
         MessageBoxTemporal.Show("Este codigo de retiro ya fue utilizado", "Mensaje Importante", 2, false);
     }
 }
Exemplo n.º 12
0
        public static void Actualizar_Cliente(string identidad, string nombre, string apellido, string telefono, string correo)
        {
            OpenConnection();

            SqlCommand command = new SqlCommand();

            command.CommandText = "SP_Modificar_Cliente";
            command.Connection  = connection;
            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.Add(new SqlParameter("@identidad", identidad));
            command.Parameters.Add(new SqlParameter("@nombre", nombre));
            command.Parameters.Add(new SqlParameter("@apellido", apellido));
            command.Parameters.Add(new SqlParameter("@telefono", telefono));
            command.Parameters.Add(new SqlParameter("@correo", correo));

            try
            {
                command.ExecuteNonQuery();
                CloseConnection();
            }
            catch
            {
                CloseConnection();
                MessageBoxTemporal.Show("Error al encontrar cliente", "Error", 2, false);
            }
        }
Exemplo n.º 13
0
        private void btnAceptarNew_Click(object sender, EventArgs e)
        {
            var hasMinimum8Chars = new Regex(@".{8,}");

            if (BD.Busqueda_Usuario(txtNom_User_Nuevo.Text) == 0)
            {
                if (txtPassNuevo_New.Text.Equals(txtPassConfirmar_New.Text))
                {
                    if (cmbPreguntas1.SelectedIndex != cmbPreguntas2.SelectedIndex)
                    {
                        if (txtRespuesta1.Text == "" || txtRespuesta2.Text == "" || cmbPreguntas1.Text == "" || cmbPreguntas2.Text == "")
                        {
                            MessageBoxTemporal.Show("No deje espacios vacíos", "Error", 1, false);
                        }
                        else
                        {
                            if (txtPassNuevo_New.Text == "" || txtPassConfirmar_New.Text == "")
                            {
                                MessageBoxTemporal.Show("No deje ningun campo de contraseña vacío", "Error", 1, false);
                            }
                            else
                            {
                                if (hasMinimum8Chars.IsMatch(txtPassNuevo_New.Text))
                                {
                                    if (BD.Ingreso_Usuario(txtNom_User_Nuevo.Text, txtPassNuevo_New.Text, cbxTp_User_New.SelectedIndex + 1, 1, "Usuario",
                                                           Objetos_Globales.fechaHoy(), cmbPreguntas1.SelectedItem.ToString(),
                                                           cmbPreguntas2.SelectedItem.ToString(), txtRespuesta1.Text, txtRespuesta2.Text) > 0)
                                    {
                                        MessageBoxTemporal.Show("El usuario se ha ingresado correctamente", "Mensaje", 1, false);
                                        txtNom_User_Tipo.Text        = "";
                                        cbxTp_User_Modificar.Enabled = false;
                                        btnAceptarTipo.Enabled       = false;
                                    }
                                    else
                                    {
                                        MessageBoxTemporal.Show("El usuario no ha podido ser ingresado", "Error", 1, false);
                                    }
                                }
                                else
                                {
                                    MessageBoxTemporal.Show("La contraseña necesita tener mínimo 8 caracteres", "Error", 1, false);
                                }
                            }
                        }
                    }
                    else
                    {
                        MessageBoxTemporal.Show("Las preguntas no pueden ser las mismas", "Error", 1, false);
                    }
                }
                else
                {
                    MessageBoxTemporal.Show("Las contraseñas no coinciden", "Error", 1, false);
                }
            }
            else
            {
                MessageBoxTemporal.Show("El nombre de usuario ya existe", "Error", 1, false);
            }
        }
Exemplo n.º 14
0
 private void txtNom_TpArt_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (!(char.IsLetter(e.KeyChar)) && (e.KeyChar != (char)Keys.Back))
     {
         MessageBoxTemporal.Show("Solo se permiten letras", "Advertencia", 1, false);
         e.Handled = true;
         return;
     }
 }
Exemplo n.º 15
0
 private void txtPrecio_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (!(char.IsNumber(e.KeyChar)) && (e.KeyChar != (char)Keys.Back))
     {
         MessageBoxTemporal.Show("Solo se permiten numeros", "Advertencia", 1, false);
         e.Handled = true;
         return;
     }
 }
Exemplo n.º 16
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (txtNombreMod.Text == "" || txtApellidoMod.Text == "" || txtTelefonoMod.MaskFull == false || Validar_Correo(txtCorreoMod.Text) == false)
     {
         MessageBoxTemporal.Show("Ha ingresado datos de manera incorrecta", "ALERTA", 2, false);
     }
     else
     {
         BD.Actualizar_Cliente(txtIdentidadMod.Text, txtNombreMod.Text, txtApellidoMod.Text, txtTelefonoMod.Text, txtCorreoMod.Text);
         MessageBoxTemporal.Show("Cliente modificado", "Mensaje Importante", 1, false);
     }
 }
Exemplo n.º 17
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (Objetos_Mantenimiento.articuloMantenimiento.Estado.Equals("En Prenda"))
     {
         Pago_de_Cuotas_Detalle cuotas_Detalle = new Pago_de_Cuotas_Detalle();
         cuotas_Detalle.Show();
         this.Hide();
     }
     else
     {
         MessageBoxTemporal.Show("Este articulo ya esta " + txtEstado.Text, "Mensaje Importante", 2, false);
     }
 }
Exemplo n.º 18
0
 private void btnAceptarTipo_Click(object sender, EventArgs e)
 {
     if (BD.Cambio_Tipo_Usuario(txtNom_User_Tipo.Text, cbxTp_User_Modificar.SelectedIndex + 1) > 0)
     {
         MessageBoxTemporal.Show("Cambio realizado correctamente", "Mensaje", 1, false);
         cbxTp_User_Modificar.Enabled = false;
         btnAceptarTipo.Enabled       = false;
     }
     else
     {
         MessageBoxTemporal.Show("No se pudo realizar el cambio", "Error", 1, false);
     }
 }
Exemplo n.º 19
0
        private void bttAgregar_Click(object sender, EventArgs e)
        {
            if (!Objetos_Mantenimiento.articuloMantenimiento.Descripcion.Equals(""))
            {
                if (Objetos_Mantenimiento.articuloMantenimiento.Estado.Equals("Vencido") && string.IsNullOrWhiteSpace(txtPrecio.Text) == false)
                {
                    Objetos_Globales.articulos.Add(new Articulo(Objetos_Mantenimiento.articuloMantenimiento.Meses, Objetos_Mantenimiento.articuloMantenimiento.Prestado, Objetos_Mantenimiento.articuloMantenimiento.Interes, Objetos_Mantenimiento.articuloMantenimiento.Descripcion,
                                                                Objetos_Mantenimiento.articuloMantenimiento.Marca, Objetos_Mantenimiento.articuloMantenimiento.Modelo, Objetos_Mantenimiento.articuloMantenimiento.Estado, Objetos_Mantenimiento.articuloMantenimiento.NumeroSerie, Objetos_Mantenimiento.articuloMantenimiento.Tipo, Objetos_Mantenimiento.articuloMantenimiento.CodigoTipo,
                                                                Objetos_Mantenimiento.articuloMantenimiento.NumeroRecibo));
                    dtgvArticulos.Rows.Add();
                    dtgvArticulos.Rows[row].Cells[0].Value = Objetos_Mantenimiento.articuloMantenimiento.Descripcion;
                    dtgvArticulos.Rows[row].Cells[1].Value = Objetos_Mantenimiento.articuloMantenimiento.Marca;
                    dtgvArticulos.Rows[row].Cells[2].Value = Objetos_Mantenimiento.articuloMantenimiento.Modelo;
                    dtgvArticulos.Rows[row].Cells[3].Value = txtPrecio.Text;
                    ((Articulo)Objetos_Globales.articulos[row]).MontoPago = double.Parse(txtPrecio.Text);

                    ((Articulo)(Objetos_Globales.articulos[row])).MontoPago = double.Parse(txtPrecio.Text);

                    txtNumRecibo.Text = "";
                    txtNumSerie.Text  = "";
                    txtArticulo.Text  = "";
                    txtEstado.Text    = "";
                    txtMonto.Text     = "";
                    txtPrecio.Text    = "";

                    row++;
                    bttAgregar.Enabled = false;
                    btnAvanzar.Enabled = true;
                }
                else if (Objetos_Mantenimiento.articuloMantenimiento.Estado.Equals("Vendido"))
                {
                    MessageBoxTemporal.Show("Este articulo ya fue vendido", "Mensaje importante", 2, false);
                }
                else if (Objetos_Mantenimiento.articuloMantenimiento.Estado.Equals("Retirado"))
                {
                    MessageBoxTemporal.Show("Este articulo ya fue Retirado", "Mensaje importante", 2, false);
                }
                else if (Objetos_Mantenimiento.articuloMantenimiento.Estado.Equals("En Prenda"))
                {
                    MessageBoxTemporal.Show("Este articulo sigue en prenda", "Mensaje importante", 2, false);
                }
                else
                {
                    MessageBoxTemporal.Show("No ingreso Un precio de Venta", "Mensaje importante", 2, false);
                }
            }
            else
            {
                MessageBoxTemporal.Show("Ingrese un articulo", "Mensaje importante", 2, false);
            }
        }
Exemplo n.º 20
0
 private void bttActualizar_Click(object sender, EventArgs e)
 {
     if (Recibotxt.Text == "" || Validar_Recibo(Recibotxt.Text) == 0 || Serietxt.Text == "")
     {
         MessageBoxTemporal.Show("Ingreso incorrectamente algunos datos", "Alerta", 1, false);
     }
     else if (BD.Actualizar_Tipo_Articulo(Serietxt.Text, int.Parse(Recibotxt.Text), cbxTipo_Art.SelectedIndex + 1) == 1)
     {
         MessageBoxTemporal.Show("Informacion Actualizada!", "Informacion", 1, false);
     }
     else
     {
         MessageBoxTemporal.Show("No se actualizo la informacion!", "Alerta", 1, false);
     }
 }
Exemplo n.º 21
0
        private void btnAceptarPassword_Click(object sender, EventArgs e)
        {
            var hasMinimum8Chars = new Regex(@".{8,}");

            if (txtPassNuevo_Change.Text.Equals(txtPassConfirmar_Change.Text))
            {
                if (Objetos_Mantenimiento.usuarioMantenimiento.password_Usuario != (txtPassNuevo_Change.Text))
                {
                    if (txtPassNuevo_Change.Text == "" || txtPassConfirmar_Change.Text == "")
                    {
                        MessageBoxTemporal.Show("No deje ningun campo de contraseña vacío", "Error", 1, false);
                    }
                    else
                    {
                        if (hasMinimum8Chars.IsMatch(txtPassNuevo_Change.Text) && hasMinimum8Chars.IsMatch(txtPassConfirmar_Change.Text))
                        {
                            if (BD.Cambio_Password(txtNom_User_Pass.Text, txtPassNuevo_Change.Text, txtRespuesta1Pass.Text, txtRespuesta2Pass.Text) > 0)
                            {
                                MessageBox.Show("Si se ingreso las 2 respuestas correctamente, la contraseña se ha modificado", "Mensaje");
                                txtNom_User_Pass.Text           = "";
                                txtPassNuevo_Change.Text        = "";
                                txtPassConfirmar_Change.Text    = "";
                                txtPassNuevo_Change.Enabled     = false;
                                txtPassConfirmar_Change.Enabled = false;
                            }
                            else
                            {
                                MessageBox.Show("Hubo un error al ingresar la contraseña", "Error");
                            }
                        }
                        else
                        {
                            MessageBoxTemporal.Show("La contraseña necesita tener mínimo 8 caracteres", "Error", 1, false);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("No se puede cambiar porque la contraseña es la misma", "Error");
                }
            }
            else
            {
                MessageBox.Show("Las contraseñas no coinciden", "Error");
            }
        }
Exemplo n.º 22
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (txtCodigo.Text == null || txtMonto.Text == null || txtIDComp.MaskFull == false)
            {
                MessageBoxTemporal.Show("Ha dejado valores en blanco!", "Advertencia!", 2, false);
            }
            else
            {
                if (BD.Busqueda_Factura(int.Parse(txtCodigo.Text)) == 0)
                {
                    if (double.Parse(txtTotalPagar.Text) > double.Parse(txtMonto.Text))
                    {
                        MessageBoxTemporal.Show("Monto ingresado es menor al de venta", "Mensaje importante", 2, false);
                    }
                    else
                    {
                        if (txtIDComp.MaskFull)
                        {
                            BD.Ingreso_Factura(int.Parse(txtCodigo.Text), txtIDComp.Text, Objetos_Globales.usuario.codigo_Usuario, txtFechaVenta.Text);
                        }
                        else
                        {
                            BD.Ingreso_Factura(int.Parse(txtCodigo.Text), null, Objetos_Globales.usuario.codigo_Usuario, txtFechaVenta.Text);
                        }

                        for (int i = 0; i < Objetos_Globales.articulos.Count; i++)
                        {
                            BD.Ingreso_Articulo_Vendido(int.Parse(txtCodigo.Text), ((Articulo)Objetos_Globales.articulos[i]).NumeroSerie,
                                                        ((Articulo)Objetos_Globales.articulos[i]).NumeroRecibo, ((Articulo)(Objetos_Globales.articulos[i])).MontoPago);
                            BD.Actualizar_Estado_Articulo(((Articulo)Objetos_Globales.articulos[i]).NumeroSerie, ((Articulo)Objetos_Globales.articulos[i]).NumeroRecibo, 3, "Articulo");
                        }
                        MessageBoxTemporal.Show("El cambio para el cliente es: " + (Double.Parse(txtMonto.Text) - Double.Parse(txtTotalPagar.Text)), "Cambio Para el Cliente", 3, false);
                        MessageBoxTemporal.Show("Realizado correctamente", "Mensaje importante", 1, false);
                        this.Hide();
                        Menu men = new Sistema_Empenos_Anderson.Menu();
                        men.Show();
                    }
                }
                else
                {
                    MessageBoxTemporal.Show("Este numero de factura ya existe", "Mensaje Importante", 1, false);
                }
            }
        }
Exemplo n.º 23
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (BD.Busqueda_Usuario(txtUsuarioEliminar.Text) > 0)
     {
         if (Objetos_Mantenimiento.usuarioMantenimiento.estado == 2)
         {
             MessageBoxTemporal.Show("Usuario ya eliminado", "Mensaje Imporante", 1, false);
         }
         else
         {
             MessageBoxTemporal.Show("Usuario Encontrado", "Mensaje Imporante", 1, false);
             btnEliminar.Enabled = true;
         }
     }
     else
     {
         MessageBoxTemporal.Show("No se ha encontrado al usuario", "Advertencia", 1, false);
     }
 }
Exemplo n.º 24
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     if (txtRecibo.Text == "" || txtSerie.Text == "")
     {
         MessageBoxTemporal.Show("Error no deje los campos vacios", "Error", 2, false);
     }
     else
     if (BD.Busqueda_Articulo(int.Parse(txtRecibo.Text), txtSerie.Text) > 0 && Objetos_Mantenimiento.articuloMantenimiento.Estado != "Retirado")
     {
         dtgvInfo.Rows[0].Cells[0].Value = Objetos_Mantenimiento.articuloMantenimiento.Descripcion;
         dtgvInfo.Rows[0].Cells[1].Value = Objetos_Mantenimiento.articuloMantenimiento.Marca;
         dtgvInfo.Rows[0].Cells[2].Value = Objetos_Mantenimiento.articuloMantenimiento.Modelo;
         dtgvInfo.Rows[0].Cells[3].Value = Objetos_Mantenimiento.articuloMantenimiento.PrecioPago(Objetos_Mantenimiento.articuloMantenimiento.Meses).ToString();
         btnRetirar.Enabled = true;
     }
     else
     {
         MessageBoxTemporal.Show("No se encontro el Articulo o ya fue retirado", "Error", 2, false);
     }
 }
Exemplo n.º 25
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     if (Validar_Recibo(txtNum_Recibo.Text) == 0)
     {
         MessageBoxTemporal.Show("Ingreso incorrectamente el numero de Recibo", "Error", 1, false);
     }
     else
     //Probando
     if (BD.Busqueda_Articulo(int.Parse(txtNum_Recibo.Text), txtNum_Serie.Text) != 0)
     {
         txtDescripcion.Text = Objetos_Mantenimiento.articuloMantenimiento.Descripcion;
         txtEstado.Text      = Objetos_Mantenimiento.articuloMantenimiento.Estado;
         txtMarca2.Text      = Objetos_Mantenimiento.articuloMantenimiento.Marca;
         txtModelo2.Text     = Objetos_Mantenimiento.articuloMantenimiento.Modelo;
     }
     else
     {
         MessageBoxTemporal.Show("No se encontro el articulo", "Error", 1, false);
     }
 }
Exemplo n.º 26
0
 private void bttBuscar_Click(object sender, EventArgs e)
 {
     if (Validar_Recibo(Recibotxt.Text) == 0)
     {
         MessageBoxTemporal.Show("Ingreso incorrectamente el codigo de Recibo", "Error", 1, false);
     }
     else
     if (BD.Busqueda_Articulo(int.Parse(Recibotxt.Text), Serietxt.Text) != 0)
     {
         //Probando
         txtArticulo.Text = Objetos_Mantenimiento.articuloMantenimiento.Descripcion;
         txtType.Text     = Objetos_Mantenimiento.articuloMantenimiento.Tipo;
         txtMarca.Text    = Objetos_Mantenimiento.articuloMantenimiento.Marca;
         txtModelo.Text   = Objetos_Mantenimiento.articuloMantenimiento.Modelo;
     }
     else
     {
         MessageBoxTemporal.Show("No se encontro el articulo", "Error", 1, false);
     }
 }
Exemplo n.º 27
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (BD.Login(txtUsuario.Text, txtPassword.Text) > 0)
     {
         if (Objetos_Globales.usuario.estado == 2)
         {
             MessageBoxTemporal.Show("Usuario inactivo", "Mensaje Importante", 1, false);
         }
         else
         {
             BD.Fecha_Inicio_Sesion(txtUsuario.Text, txtPassword.Text, Objetos_Globales.fechaHoy());
             Menu menu = new Menu();
             this.Hide();
             menu.Show();
         }
     }
     else
     {
         MessageBox.Show("Usuario y/o contraseña incorrecta", "Error");
     }
 }
Exemplo n.º 28
0
        public static void EliminarCliente(string identidad)
        {
            OpenConnection();

            SqlCommand command = new SqlCommand();

            command.CommandText = "SP_Eliminar_Cliente";
            command.Connection  = connection;
            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.Add(new SqlParameter("@Identidad", identidad));

            try
            {
                command.ExecuteNonQuery();
                CloseConnection();
            }
            catch
            {
                MessageBoxTemporal.Show("Error al encontrar cliente", "Error", 2, false);
                CloseConnection();
            }
        }
Exemplo n.º 29
0
        public static void EliminarUsuario(string usuario)
        {
            OpenConnection();

            SqlCommand command = new SqlCommand();

            command.CommandText = "SP_Eliminar_Usuario";
            command.Connection  = connection;
            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.Add(new SqlParameter("@Usuario", usuario));

            try
            {
                command.ExecuteNonQuery();
                CloseConnection();
            }
            catch
            {
                MessageBoxTemporal.Show("Error al encontrar usuario", "Error", 2, false);
                CloseConnection();
            }
        }
Exemplo n.º 30
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     if (txtBusqueda_ID.MaskFull)
     {
         if (BD.Busqueda_Cliente(txtBusqueda_ID.Text) > 0)
         {
             Objetos_Globales.cliente.identidad_Cliente = txtBusqueda_ID.Text;
             dtgv_Info_Cliente.Rows[0].Cells[0].Value   = Objetos_Globales.cliente.nombre_Cliente;
             dtgv_Info_Cliente.Rows[0].Cells[1].Value   = Objetos_Globales.cliente.apellido_Cliente;
             dtgv_Info_Cliente.Rows[0].Cells[2].Value   = Objetos_Globales.cliente.telefono_Cliente;
             dtgv_Info_Cliente.Rows[0].Cells[3].Value   = Objetos_Globales.cliente.correo_Cliente;
             btnAvanzar.Enabled            = true;
             grpInfo_Nuevo_Cliente.Enabled = false;
         }
         else
         {
             DialogResult res = MessageBox.Show("No se encontro el cliente en la Base de Datos\nDesea Agregarlo?", "ALERTA", MessageBoxButtons.YesNo);
             if (res.ToString() == "Yes")
             {
                 grpInfo_Nuevo_Cliente.Enabled = true;
                 btnAñadir.Enabled             = true;
                 txtIdentidad.Text             = txtBusqueda_ID.Text;
                 txtNombre.Focus();
                 btnAvanzar.Enabled = false;
             }
             else
             {
                 grpInfo_Nuevo_Cliente.Enabled = false;
                 btnAñadir.Enabled             = false;
             }
         }
     }
     else
     {
         MessageBoxTemporal.Show("Ingrese bien la identidad", "Error", 1, false);
     }
 }