Exemplo n.º 1
0
 /*Metodo para actualizar el fin de caja dentro de la tabla control, por medio de la instancia del metodo
  * de la clase Control de Caja*/
 private void btn_Aceptar_Click(object sender, EventArgs e)
 {
     try
     {
         objcontrol.M5        = Convert.ToInt32(txt_Monedas5.Text);
         objcontrol.M10       = Convert.ToInt32(txt_Monedas10.Text);
         objcontrol.M25       = Convert.ToInt32(txt_Monedas25.Text);
         objcontrol.M50       = Convert.ToInt32(txt_Monedas50.Text);
         objcontrol.M100      = Convert.ToInt32(txt_Monedas100.Text);
         objcontrol.M500      = Convert.ToInt32(txt_Monedas500.Text);
         objcontrol.B1000     = Convert.ToInt32(txt_Billetes1000.Text);
         objcontrol.B2000     = Convert.ToInt32(txt_Billetes2000.Text);
         objcontrol.B5000     = Convert.ToInt32(txt_Billetes5000.Text);
         objcontrol.B10000    = Convert.ToInt32(txt_Billetes10000.Text);
         objcontrol.B20000    = Convert.ToInt32(txt_Billetes20000.Text);
         objcontrol.B50000    = Convert.ToInt32(txt_Billetes50000.Text);
         objcontrol.Ubicacion = txt_Ubicacion.Text;
         objcontrol.Usuario   = txt_Usuario.Text;
         objcontrol.FinCaja   = txt_TotalenCaja.Text;
         objcontrol.Total     = (Convert.ToDecimal(txt_TotalenCaja.Text) - Convert.ToDecimal(txt_Total.Text)).ToString();
         objcontrol.UPDATE_FIN_CAJA();
         if (objcontrol.Validacion == "Actualizado")
         {
             frm_Mensaje objmensaje = new frm_Mensaje();
             objmensaje.lbl_Mensaje.Text  = "Caja Finalizada";
             objmensaje.pic_Check.Visible = true;
             objmensaje.Show();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + "btn_Aceptar_Click");
     }
 }
Exemplo n.º 2
0
 private void btn_Agregar_Click_1(object sender, EventArgs e)
 {
     try
     {
         #region Validaciones
         if (txt_TipoSaco.Text == string.Empty)
         {
             MessageBox.Show("Favor Ingresar el Tipo de Saco", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txt_TipoSaco.Focus();
             return;
         }
         #endregion
         objotros.Descripcion = txt_TipoSaco.Text;
         objotros.INSERT_TIPO_SACO();
         if (objotros.Validacion == "Insertado")
         {
             frm_Mensaje objmensaje = new frm_Mensaje();
             objmensaje.lbl_Mensaje.Text  = "Insertado";
             objmensaje.pic_Check.Visible = true;
             objmensaje.Show();
             CARGA_LISTA_SACO();
             txt_TipoSaco.Text = string.Empty;
         }
         else
         {
             MessageBox.Show("Ocurrio un Error", "Validacion Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + "btn_Agregar_Click");
     }
 }
Exemplo n.º 3
0
        private void btn_Agregar_Click_1(object sender, EventArgs e)
        {
            try
            {
                #region Validaciones
                if (txt_Nombre.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar Nombre de la Sucursal", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txt_Nombre.Focus();
                    return;
                }
                else if (txt_Prefijo.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar un Prefijo para la Sucursal", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txt_Prefijo.Focus();
                    return;
                }
                #endregion

                objotros.Descripcion = txt_Nombre.Text;
                objotros.Prefijo     = txt_Prefijo.Text;
                objotros.Provincia   = Convert.ToInt32(cbo_Provincia.SelectedValue);
                objotros.Canton      = Convert.ToInt32(cbo_Canton.SelectedValue);
                objotros.Distrito    = Convert.ToInt32(cbo_Distrito.SelectedValue);
                objotros.Barrio      = Convert.ToInt32(cbo_Barrio.SelectedValue);
                objotros.Telefono    = Convert.ToInt32(msk_Telefono.Text.Replace("-", string.Empty));
                objotros.SELECT_CODIGO_DE_UBICACION();
                objotros.DescripciondeUbicacion = txt_UbicacionExacta.Text;
                objotros.Identificacion         = Convert.ToInt32(cbo_dueño.SelectedValue);
                objotros.SELECT_CONSECUTIVO();
                objotros.INSERT_UBICACION();
                if (objotros.Validacion == "Insertado")
                {
                    frm_Mensaje objmensaje = new frm_Mensaje();
                    objmensaje.lbl_Mensaje.Text  = "Insertado";
                    objmensaje.pic_Check.Visible = true;
                    objmensaje.Show();
                    CARGA_LISTA_UBICACIONES();
                    txt_Nombre.Text          = string.Empty;
                    txt_Prefijo.Text         = string.Empty;
                    txt_UbicacionExacta.Text = string.Empty;
                    cbo_Barrio.Enabled       = false;
                    cbo_Canton.Enabled       = false;
                    cbo_Distrito.Enabled     = false;
                    CARGA_LISTA_UBICACIONES();
                }
                else
                {
                    MessageBox.Show("Ocurrio un Error", "Validacion Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "btn_Agregar_Click");
            }
        }
Exemplo n.º 4
0
        /*Metodo para realizar la actualizacion de informacion dentron de la tabla Sacos, por medio de una
         * instancia al metodo de la clase Inventario*/
        private void txt_aceptar_Click(object sender, EventArgs e)
        {
            try
            {
                if (cbo_Ubicacion.Text == string.Empty)
                {
                    MessageBox.Show("Favor Seleccionar la Ubicacion", "Validacion Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    cbo_Ubicacion.Focus();
                    return;
                }
                else if (cbo_TipoSaco.Text == string.Empty)
                {
                    MessageBox.Show("Favor Seleccionar el Tipo de Saco", "Validacion Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    cbo_TipoSaco.Focus();
                    return;
                }

                else if (lbl_Codigo.Text == string.Empty)
                {
                    MessageBox.Show("Favor Seleccionar el Saco a Modificar", "Validacion Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    objinventario.Codigo          = Convert.ToInt32(lbl_Codigo.Text);
                    objinventario.UbicacionUpdate = Convert.ToInt32(cbo_Ubicacion.SelectedValue);
                    objinventario.TipoSaco        = Convert.ToInt32(cbo_TipoSaco.SelectedValue);
                    objinventario.UPDATE_SACOS();
                    if (objinventario.Validacion == "Actualizado")
                    {
                        objBitacora.Usuario     = lbl_Usuario.Text;
                        objBitacora.Accion      = "Actualización";
                        objBitacora.Formulario  = "Inventario";
                        objBitacora.Descripcion = "Saco Actualizado " + lbl_Codigo.Text + " por " + lbl_Usuario.Text;
                        objBitacora.INSERT_BITACORA();
                        frm_Mensaje objmensaje = new frm_Mensaje();
                        objmensaje.lbl_Mensaje.Text  = "Actualizado";
                        objmensaje.pic_Check.Visible = true;
                        objmensaje.Show();
                        LIMPIAR_DATOS();
                        CARGA_SACOS();
                        CARGA_TIPO_SACOS();
                        CARGA_UBICACIONES();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "Aceptar_Click");
            }
        }
Exemplo n.º 5
0
        /*Metodo para eliminar informacion de la tabla Sacos, por medio de la instancia al metodo dentro de la
         * clase Inventario*/
        private void btn_Eliminar_Click(object sender, EventArgs e)
        {
            try
            {
                if (lbl_Codigo.Text == string.Empty)
                {
                    MessageBox.Show("Favor Seleccionar el Dato a Eliminar", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                else
                {
                    DialogResult dr = MessageBox.Show("Desea Eliminar el Saco: " + cbo_TipoSaco.Text + " ?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question);


                    switch (dr)
                    {
                    case DialogResult.Yes:
                        objinventario.Codigo = Convert.ToInt32(lbl_Codigo.Text);
                        objinventario.DELETE_SACOS();
                        if (objinventario.Validacion == "Eliminado")
                        {
                            objBitacora.Usuario     = lbl_Usuario.Text;
                            objBitacora.Accion      = "Elimnado";
                            objBitacora.Formulario  = "Inventario";
                            objBitacora.Descripcion = "Saco Eliminado " + lbl_Codigo.Text + " por " + lbl_Usuario.Text;
                            objBitacora.INSERT_BITACORA();
                            frm_Mensaje objmensaje = new frm_Mensaje();
                            objmensaje.lbl_Mensaje.Text  = "Insertado";
                            objmensaje.pic_Check.Visible = true;
                            objmensaje.Show();
                            LIMPIAR_DATOS();
                            CARGA_SACOS();
                            CARGA_TIPO_SACOS();
                            CARGA_UBICACIONES();
                        }

                        break;

                    case DialogResult.No:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "btn_Eliminar_Click");
            }
        }
Exemplo n.º 6
0
        /*Metodo para el inicio de session, por medio de instancia a la clase Login*/
        private void btn_Aceptar_Click_1(object sender, EventArgs e)
        {
            try
            {
                frm_Menu_Principal objmenuprincipal = new frm_Menu_Principal();

                if (txt_Login.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar su Login", "Validación", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txt_Login.Focus();
                }
                else if (txt_Contraseña.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar su Contraseña", "Validación", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txt_Contraseña.Focus();
                }
                else
                {
                    objlogin.LoginU = txt_Login.Text;
                    objlogin.Contra = txt_Contraseña.Text;
                    objlogin.LOGIN();
                    if (objlogin.LoginSalida == txt_Login.Text)
                    {
                        frm_Mensaje objmensaje = new frm_Mensaje();
                        objmensaje.pic_Lock.Visible = true;
                        objmensaje.lbl_Mensaje.Text = "Bienvenido: " + txt_Login.Text;
                        objmensaje.Show();
                        objmenuprincipal.tsl_Usuario.Text   = objlogin.LoginSalida;
                        objmenuprincipal.tsl_Ubicacion.Text = objlogin.Ubicacion;
                        objmenuprincipal.tsl_Rol.Text       = objlogin.Rol;
                        objmenuprincipal.Show();
                        this.Hide();
                    }
                    else
                    {
                        txt_Login.Focus();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "btn_Aceptar_Click_1");
            }
        }
Exemplo n.º 7
0
        /*Metodo que permite Agregar informacion a la tabla Sacos, por medio de una instancia al metodo de la
         * clase Inventario*/
        private void btn_Agregar_Click(object sender, EventArgs e)
        {
            try
            {
                #region Validacion
                if (cbo_TipoSaco.Text == string.Empty)
                {
                    MessageBox.Show("Favor Seleccionar un Tipo de Saco", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    cbo_TipoSaco.Focus();
                    return;
                }
                else
                {
                    objinvetario.TipoSaco  = Convert.ToInt32(cbo_TipoSaco.SelectedValue);
                    objinvetario.Ubicacion = txt_Ubicacion.Text;
                    objinvetario.Usuario   = txt_Usuario.Text;
                    objinvetario.INSERT_SACOS();
                    if (objinvetario.Validacion == "Insertado")
                    {
                        objBitacora.Usuario     = txt_Usuario.Text;
                        objBitacora.Accion      = "Inserción";
                        objBitacora.Formulario  = "Inventario";
                        objBitacora.Descripcion = "Nuevo Saco: " + cbo_TipoSaco.Text + " en: " + txt_Ubicacion.Text;
                        objBitacora.INSERT_BITACORA();
                        frm_Mensaje objmensaje = new frm_Mensaje();
                        objmensaje.lbl_Mensaje.Text  = "Insertado";
                        objmensaje.pic_Check.Visible = true;
                        objmensaje.Show();
                    }
                    else
                    {
                        MessageBox.Show("Error al Insertar el Saco", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }

                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "btn_Agregar_Click");
            }
        }
Exemplo n.º 8
0
        /*Se eliminar informacion de la tabla Usuarios por medio de instancia a metodo de la clase Usuarios*/
        private void btn_Eliminar_Click(object sender, EventArgs e)
        {
            try
            {
                if (lbl_CodigoUsuario.Text != string.Empty)
                {
                    objusuarios.Codigo = Convert.ToInt32(lbl_CodigoUsuario.Text);
                    DialogResult dr = MessageBox.Show("Desea Eliminar el Usuario " + txt_Login.Text + " ?", "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    switch (dr)
                    {
                    case DialogResult.Yes:
                        objusuarios.Codigo = Convert.ToInt32(lbl_CodigoUsuario.Text);
                        objusuarios.DELETE_USUARIOS();
                        if (objusuarios.Validacion == "Eliminado")
                        {
                            this.LIMPIAR();
                            this.CARGA_ROL();
                            this.CARGA_UBICACION();
                            frm_Mensaje objmensaje = new frm_Mensaje();
                            objmensaje.lbl_Mensaje.Text  = "Usuario Eliminado";
                            objmensaje.pic_Check.Visible = true;
                            objmensaje.Show();
                        }
                        break;

                    case DialogResult.No:
                        break;
                    }
                }
                else
                {
                    MessageBox.Show("No se ha seleccionado el Usuario a Eliminar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "btn_Eliminar_Click");
            }
        }
Exemplo n.º 9
0
 /*Metodo para agregar la informacion a la tabla Control, por medio de la instancia del metodo de la clase
  * Contol de Caja*/
 private void btn_Aceptar_Click(object sender, EventArgs e)
 {
     try
     {
         objcontrol.M5         = Convert.ToInt32(txt_Monedas5.Text);
         objcontrol.M10        = Convert.ToInt32(txt_Monedas10.Text);
         objcontrol.M25        = Convert.ToInt32(txt_Monedas25.Text);
         objcontrol.M50        = Convert.ToInt32(txt_Monedas50.Text);
         objcontrol.M100       = Convert.ToInt32(txt_Monedas100.Text);
         objcontrol.M500       = Convert.ToInt32(txt_Monedas500.Text);
         objcontrol.B1000      = Convert.ToInt32(txt_Billetes1000.Text);
         objcontrol.B2000      = Convert.ToInt32(txt_Billetes2000.Text);
         objcontrol.B5000      = Convert.ToInt32(txt_Billetes5000.Text);
         objcontrol.B10000     = Convert.ToInt32(txt_Billetes10000.Text);
         objcontrol.B20000     = Convert.ToInt32(txt_Billetes20000.Text);
         objcontrol.B50000     = Convert.ToInt32(txt_Billetes50000.Text);
         objcontrol.InicioCaja = Convert.ToInt32(txt_SaldoFinal.Text);
         objcontrol.Ubicacion  = cbo_Ubicacion.Text;
         objcontrol.Usuario    = txt_Usuario.Text;
         objcontrol.INSERT_INICIO_CAJA();
         if (objcontrol.Validacion == "Insertado")
         {
             frm_Mensaje objmensaje = new frm_Mensaje();
             objmensaje.lbl_Mensaje.Text  = "Caja Nueva";
             objmensaje.pic_Check.Visible = true;
             objmensaje.Show();
         }
         else
         {
             MessageBox.Show("Se Encontro un Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + "btn_Aceptar_Click");
     }
 }
Exemplo n.º 10
0
 /*Se agrega informacion en tabla Usuarios por medio de instancia a metodo de la clase Usuarios*/
 private void btn_Aceptar_Click(object sender, EventArgs e)
 {
     try
     {
         #region Validaciones
         if (txt_Login.Text == string.Empty)
         {
             MessageBox.Show("Favor Ingresar un Login", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txt_Login.Focus();
             return;
         }
         else if (txt_Apellidos.Text == string.Empty)
         {
             MessageBox.Show("Favor Ingresar los Apellidos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txt_Apellidos.Focus();
             return;
         }
         else if (txt_Correo.Text == string.Empty)
         {
             MessageBox.Show("Favor Ingresar un Correo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txt_Correo.Focus();
             return;
         }
         else if (txt_Nombre.Text == string.Empty)
         {
             MessageBox.Show("Favor Ingresar un Nombre", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             txt_Nombre.Focus();
             return;
         }
         else if (msk_Telefono.Text == string.Empty)
         {
             MessageBox.Show("Favor Ingresar un Telefono", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             msk_Telefono.Focus();
             return;
         }
         else if (cbo_Ubicacion.Text == string.Empty)
         {
             MessageBox.Show("Favor Ingresar una Ubicacion Correcta", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             cbo_Ubicacion.Focus();
             return;
         }
         #endregion
         //Actualizacion del Usuario
         if (lbl_Dato.Text == "1")
         {
             objusuarios.Nombre    = txt_Nombre.Text;
             objusuarios.Apellidos = txt_Apellidos.Text;
             objusuarios.Codigo    = Convert.ToInt32(lbl_CodigoUsuario.Text);
             objusuarios.Telefono  = msk_Telefono.Text;
             objusuarios.Correo    = txt_Correo.Text;
             objusuarios.Login     = txt_Login.Text;
             objusuarios.Ubicacion = Convert.ToInt32(cbo_Ubicacion.SelectedValue);
             objusuarios.Rol       = Convert.ToInt32(cbo_Rol.SelectedValue);
             objusuarios.UPDATE_USUARIOS_NOPASSWORD();
             if (objusuarios.Validacion == "Actualizado")
             {
                 frm_Mensaje objmensaje = new frm_Mensaje();
                 objmensaje.lbl_Mensaje.Text  = "Usuario Actualizado";
                 objmensaje.pic_Check.Visible = true;
                 objmensaje.Show();
                 LIMPIAR();
                 this.CARGA_UBICACION();
                 this.CARGA_ROL();
             }
         }
         //Insertar el Usuario
         else
         {
             objusuarios.Correo = txt_Correo.Text;
             objusuarios.RANDOM_CONTRASEÑA();
             objusuarios.ENVIO_DE_CONTRASEÑA();
             objusuarios.Nombre    = txt_Nombre.Text;
             objusuarios.Apellidos = txt_Apellidos.Text;
             objusuarios.Telefono  = msk_Telefono.Text;
             objusuarios.Login     = txt_Login.Text;
             objusuarios.Ubicacion = Convert.ToInt32(cbo_Ubicacion.SelectedValue);
             objusuarios.Rol       = Convert.ToInt32(cbo_Rol.SelectedValue);
             objusuarios.INSERT_USUARIOS();
             if (objusuarios.Validacion == "Insertado")
             {
                 frm_Mensaje objmensaje = new frm_Mensaje();
                 objmensaje.lbl_Mensaje.Text  = "Usuario Insertado";
                 objmensaje.pic_Check.Visible = true;
                 objmensaje.Show();
                 LIMPIAR();
                 this.CARGA_UBICACION();
                 this.CARGA_ROL();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + "btn_Aceptar_Click");
     }
 }
Exemplo n.º 11
0
        private void btn_Pagar_Click_1(object sender, EventArgs e)
        {
            try
            {
                #region Validaciones
                if (txt_DineroPagadoFinal.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar Monto a Cancelar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txt_DineroPagadoFinal.Focus();
                    return;
                }
                else if (rb_Efectivo.Checked == false && rb_Tarjeta.Checked == false)
                {
                    MessageBox.Show("Favor Ingresar Tipo de pago", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    return;
                }
                #endregion

                double montoInicial = Convert.ToDouble(txt_CantidadPagado.Text);
                double precio       = Convert.ToDouble(txt_PrecioProducto.Text);
                double montoFinal   = Convert.ToDouble(txt_DineroPagadoFinal.Text);
                double montoSave    = montoInicial + montoFinal;

                if (precio < montoSave)
                {
                    MessageBox.Show("El monto ingresado supera la deuda", "Validacion Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (precio > montoSave)
                {
                    ap.CantidadPagado = Convert.ToString(montoSave);
                    ap.Codigo         = Convert.ToInt32(txt_IdApartado.Text);
                    ap.UPDATE_APARTADO();

                    if (ap.Validacion == "Actualizado")
                    {
                        frm_Mensaje objmensaje = new frm_Mensaje();
                        objmensaje.lbl_Mensaje.Text  = "Apartado Actualizado";
                        objmensaje.pic_Check.Visible = true;
                        objmensaje.Show();
                    }
                    //gi.Ingresos = txt_DineroPagadoFinal.Text;
                    //gi.Ubicacion = lbl_Ubicacion.Text;
                    //gi.Descripcion = lb_Descripcion.Text;
                    //gi.INSERT_INGRESO();

                    if (rb_Efectivo.Checked)
                    {
                        cj.TipoPago      = rb_Efectivo.Text;
                        cj.DineroTotal   = txt_DineroPagadoFinal.Text;
                        cj.Ubicacion     = lbl_Ubicacion.Text;
                        cj.CodigoFactura = "Apartado";
                        cj.Login         = lbl_Usuario.Text;
                        cj.Descripcion   = lb_Descripcion.Text;
                    }
                    else if (rb_Tarjeta.Checked)
                    {
                        cj.TipoPago      = rb_Tarjeta.Text;
                        cj.DineroTotal   = txt_DineroPagadoFinal.Text;
                        cj.Ubicacion     = lbl_Ubicacion.Text;
                        cj.CodigoFactura = "Apartado";
                        cj.Login         = lbl_Usuario.Text;
                        cj.Descripcion   = lb_Descripcion.Text;
                    }

                    cj.INSERT_VENTASTOTALES();
                    objBitacora.Usuario     = lbl_Usuario.Text;
                    objBitacora.Accion      = "Actualización";
                    objBitacora.Formulario  = "Apartados";
                    objBitacora.Descripcion = "Monto Actualizado del Apartado: " + txt_IdApartado.Text;
                    objBitacora.INSERT_BITACORA();
                    Limpiar();
                    LISTA_APARTADOS();
                }
                else if (precio == montoSave)
                {
                    MessageBox.Show("Monto de Apartado Cancelado, Apartado Eliminado", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    //gi.Ingresos = txt_DineroPagadoFinal.Text;
                    //gi.Ubicacion = lbl_Ubicacion.Text;
                    //gi.Descripcion = lb_Descripcion.Text;
                    //gi.INSERT_INGRESO();

                    if (rb_Efectivo.Checked)
                    {
                        cj.TipoPago      = rb_Efectivo.Text;
                        cj.DineroTotal   = txt_DineroPagadoFinal.Text;
                        cj.Ubicacion     = lbl_Ubicacion.Text;
                        cj.CodigoFactura = "Apartado";
                        cj.Login         = lbl_Usuario.Text;
                        cj.Descripcion   = lb_Descripcion.Text;
                    }
                    else if (rb_Tarjeta.Checked)
                    {
                        cj.TipoPago      = rb_Tarjeta.Text;
                        cj.DineroTotal   = txt_DineroPagadoFinal.Text;
                        cj.Ubicacion     = lbl_Ubicacion.Text;
                        cj.CodigoFactura = "Apartado";
                        cj.Login         = lbl_Usuario.Text;
                        cj.Descripcion   = lb_Descripcion.Text;
                    }

                    cj.INSERT_VENTASTOTALES();
                    objBitacora.Usuario     = lbl_Usuario.Text;
                    objBitacora.Accion      = "Actualización";
                    objBitacora.Formulario  = "Apartados";
                    objBitacora.Descripcion = "Finalizado el Apartado: " + txt_IdApartado.Text;
                    objBitacora.INSERT_BITACORA();
                    ap.Codigo = Convert.ToInt32(txt_IdApartado.Text);
                    ap.DELETE_APARTADO();

                    Limpiar();
                    LISTA_APARTADOS();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "btn_Pagar_Click");
            }
        }
Exemplo n.º 12
0
        private void btn_Agregar_Click_1(object sender, EventArgs e)
        {
            try
            {
                #region Validaciones
                if (txt_Nombre.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar Nombre", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txt_Nombre.Focus();
                    return;
                }
                else if (mtxt_Cedula.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar Cedula", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    mtxt_Cedula.Focus();
                    return;
                }
                else if (mtxt_Telefono.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar Numero de Telefono", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    mtxt_Telefono.Focus();
                    return;
                }
                else if (txt_CantidadPagado.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar la cantidad pagada por el Cliente", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txt_CantidadPagado.Focus();
                    return;
                }

                else if (txt_Decripcion.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar una Descripcion del Apartado", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txt_Decripcion.Focus();
                    return;
                }
                else if (txt_PrecioProducto.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar el Precio del Producto Apartado", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txt_PrecioProducto.Focus();
                    return;
                }
                else if (rb_Juguete.Checked == false && rb_Ropa.Checked == false)
                {
                    MessageBox.Show("Favor Seleccionar tipo de apartado", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    return;
                }
                else if (rb_15Dias.Checked == false && rb_Mes.Checked == false)
                {
                    MessageBox.Show("Favor Seleccionar tiempo para cancelación", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    return;
                }
                else if (rb_Efectivo.Checked == false && rb_Tarjeta.Checked == false)
                {
                    MessageBox.Show("Favor Seleccionar tipo de pago", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    return;
                }
                #endregion

                if (rb_Mes.Checked)
                {
                    if (rb_Juguete.Checked)
                    {
                        ap.Cedula         = mtxt_Cedula.Text;
                        ap.Nombre         = txt_Nombre.Text;
                        ap.Telefono       = mtxt_Telefono.Text;
                        ap.TipoApartado   = rb_Juguete.Text;
                        ap.CantidadPagado = txt_CantidadPagado.Text;
                        ap.PrecioProducto = txt_PrecioProducto.Text;
                        ap.Descripcion    = txt_Decripcion.Text;
                        ap.TiempoApartado = 30;
                        ap.Usuario        = lbl_Usuario.Text;
                    }
                    else if (rb_Ropa.Checked)
                    {
                        ap.Cedula         = mtxt_Cedula.Text;
                        ap.Nombre         = txt_Nombre.Text;
                        ap.Telefono       = mtxt_Telefono.Text;
                        ap.TipoApartado   = rb_Ropa.Text;
                        ap.CantidadPagado = txt_CantidadPagado.Text;
                        ap.PrecioProducto = txt_PrecioProducto.Text;
                        ap.Descripcion    = txt_Decripcion.Text;
                        ap.TiempoApartado = 30;
                        ap.Usuario        = lbl_Usuario.Text;
                    }
                }
                else if (rb_15Dias.Checked)
                {
                    if (rb_Juguete.Checked)
                    {
                        ap.Cedula         = mtxt_Cedula.Text;
                        ap.Nombre         = txt_Nombre.Text;
                        ap.Telefono       = mtxt_Telefono.Text;
                        ap.TipoApartado   = rb_Juguete.Text;
                        ap.CantidadPagado = txt_CantidadPagado.Text;
                        ap.PrecioProducto = txt_PrecioProducto.Text;
                        ap.Descripcion    = txt_Decripcion.Text;
                        ap.TiempoApartado = 15;
                        ap.Usuario        = lbl_Usuario.Text;
                    }
                    else if (rb_Ropa.Checked)
                    {
                        ap.Cedula         = mtxt_Cedula.Text;
                        ap.Nombre         = txt_Nombre.Text;
                        ap.Telefono       = mtxt_Telefono.Text;
                        ap.TipoApartado   = rb_Ropa.Text;
                        ap.CantidadPagado = txt_CantidadPagado.Text;
                        ap.PrecioProducto = txt_PrecioProducto.Text;
                        ap.Descripcion    = txt_Decripcion.Text;
                        ap.TiempoApartado = 15;
                        ap.Usuario        = lbl_Usuario.Text;
                    }
                }

                ap.INSERT_APARTADO();

                if (ap.Validacion == "Insertado")
                {
                    //gi.Ingresos = txt_CantidadPagado.Text;
                    //gi.Ubicacion = lbl_Ubicacion.Text;
                    //gi.Descripcion = txt_Decripcion.Text;
                    //gi.INSERT_INGRESO();

                    if (rb_Efectivo.Checked)
                    {
                        cj.TipoPago      = rb_Efectivo.Text;
                        cj.DineroTotal   = txt_CantidadPagado.Text;
                        cj.Ubicacion     = lbl_Ubicacion.Text;
                        cj.CodigoFactura = "Apartado";
                        cj.Login         = lbl_Usuario.Text;
                        cj.Descripcion   = txt_Decripcion.Text;
                    }
                    else if (rb_Tarjeta.Checked)
                    {
                        cj.TipoPago      = rb_Tarjeta.Text;
                        cj.DineroTotal   = txt_CantidadPagado.Text;
                        cj.Ubicacion     = lbl_Ubicacion.Text;
                        cj.CodigoFactura = "Apartado";
                        cj.Login         = lbl_Usuario.Text;
                        cj.Descripcion   = txt_Decripcion.Text;
                    }
                    cj.INSERT_VENTASTOTALES();
                    objBitacora.Usuario     = lbl_Usuario.Text;
                    objBitacora.Accion      = "Inserción";
                    objBitacora.Formulario  = "Apartado";
                    objBitacora.Descripcion = "Nuevo Apartado de: " + mtxt_Cedula;
                    objBitacora.INSERT_BITACORA();
                    frm_Mensaje objmensaje = new frm_Mensaje();
                    objmensaje.lbl_Mensaje.Text  = "Nuevo Apartado";
                    objmensaje.pic_Check.Visible = true;
                    objmensaje.Show();
                    Limpiar();
                }
                else
                {
                    MessageBox.Show("Ocurrio un Error", "Validacion Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "Problemas en btn_Agregar_Click");
            }
        }
Exemplo n.º 13
0
        private void btn_Agregar_Click_1(object sender, EventArgs e)
        {
            try
            {
                #region Validaciones
                if (txt_Rol.Text == string.Empty)
                {
                    MessageBox.Show("Favor Ingresar el Rol", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txt_Rol.Focus();
                    return;
                }
                else if (chk_Admin.Checked == false && chk_Ajustes.Checked == false && chk_Caja.Checked == false && chk_Control.Checked == false &&
                         chk_IngresosyGastos.Checked == false && chk_Inventario.Checked == false && chk_Usuarios.Checked == false)
                {
                    MessageBox.Show("Favor Seleccionar los Permisos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    chk_Admin.Focus();
                    return;
                }
                #endregion

                #region Checkbox
                if (chk_Admin.Checked == true)
                {
                    Objotros.Admin = true;
                }
                else
                {
                    Objotros.Admin = false;
                }

                if (chk_Ajustes.Checked == true)
                {
                    Objotros.Ajustes = true;
                }
                else
                {
                    Objotros.Ajustes = false;
                }


                if (chk_Caja.Checked == true)
                {
                    Objotros.Caja = true;
                }
                else
                {
                    Objotros.Caja = false;
                }

                if (chk_Control.Checked == true)
                {
                    Objotros.Control = true;
                }
                else
                {
                    Objotros.Control = false;
                }

                if (chk_IngresosyGastos.Checked == true)
                {
                    Objotros.IngresosyGastos = true;
                }
                else
                {
                    Objotros.IngresosyGastos = false;
                }

                if (chk_Inventario.Checked == true)
                {
                    Objotros.Inventario = true;
                }
                else
                {
                    Objotros.Inventario = false;
                }

                if (chk_Usuarios.Checked == true)
                {
                    Objotros.Usuarios = true;
                }
                else
                {
                    Objotros.Usuarios = false;
                }

                if (chk_Traslados.Checked == true)
                {
                    Objotros.Traslados = true;
                }
                else
                {
                    Objotros.Traslados = false;
                }

                #endregion
                Objotros.Descripcion = txt_Rol.Text;
                Objotros.INSERT_ROLES();
                if (Objotros.Validacion == "Insertado")
                {
                    frm_Mensaje objmensaje = new frm_Mensaje();
                    objmensaje.lbl_Mensaje.Text  = "Insertado";
                    objmensaje.pic_Check.Visible = true;
                    objmensaje.Show();
                    CARGA_LISTA_ROLES();
                    txt_Rol.Text                = string.Empty;
                    chk_Admin.Checked           = true;
                    chk_Ajustes.Checked         = true;
                    chk_Caja.Checked            = true;
                    chk_Control.Checked         = true;
                    chk_IngresosyGastos.Checked = true;
                    chk_Inventario.Checked      = true;
                    chk_Usuarios.Checked        = true;
                    chk_Traslados.Checked       = true;
                }
                else
                {
                    MessageBox.Show("Ocurrio un Error", "Validacion Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "btn_Agregar_Click");
            }
        }