public FormularioProgramarPago(Trabajos tra, List <int> IDEmpleado, int con, int Trab, int op, Conexion co)
        {
            InitializeComponent();
            Region   = Funciones.redondear(Width, Height);
            this.tra = tra;
            //Inicia la transaccioin
            co.Comando("START TRANSACTION;");
            comboBox2.Enabled = false;
            frm2    = Application.OpenForms.OfType <VisuaTrabajos>().FirstOrDefault();
            opcion  = op;
            this.co = co;
            estado  = false;
            //Plazos de pago
            int[] plazos = new int[50];
            for (int j = 1; j < 51; j++)
            {
                plazos[j - 1] = j + 1;
            }
            comboBox2.DataSource = plazos;


            conta  = con;
            IDs    = IDEmpleado;
            IDTrab = Trab;
            Iniciar();
            this.StartPosition = FormStartPosition.CenterScreen;
        }
Esempio n. 2
0
 public Login()
 {
     InitializeComponent();
     Region             = Funciones.redondear(Width, Height);
     co                 = new Conexion(connection);
     AcceptButton       = this.button1;
     this.StartPosition = FormStartPosition.CenterScreen;
 }
Esempio n. 3
0
        //1 --- Crear pago --- 2 --- EditarPago
        public ingresos(Conexion co, int opcion, int id, activos form)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
            Region             = Funciones.redondear(Width, Height);
            this.form          = form;
            this.id            = id;
            this.opcion        = opcion;
            this.co            = co;
            //Metodos de pago
            metodosID  = new List <int>();
            metodosNom = new List <string>();
            co.Comando("SELECT ID FROM Metodo;");
            while (co.LeerRead)
            {
                metodosID.Add(co.Leer.GetInt32(0));
            }
            for (int i = 0; i < metodosID.Count; i++)
            {
                co.Comando("SELECT Metodo FROM Metodo WHERE ID = " + metodosID[i] + ";");
                if (co.LeerRead)
                {
                    metodosNom.Add(co.Leer.GetString(0));
                }
            }
            metodoPago.DataSource = metodosNom;
            if (opcion == 1)
            {
                guardar.Visible = false;
                aceptar.Visible = true;
            }
            else
            {
                guardar.Visible = true;
                aceptar.Visible = false;

                int metodoID = 0;
                co.Comando("SELECT i.Concepto, p.monto, p.metodoID FROM Ingresos as i INNER JOIN Pagos as p ON (i.ID = p.ingresoID)" +
                           "WHERE p.ID = " + id + ";");
                if (co.LeerRead)
                {
                    textConcepto.Text = co.Leer.GetString(0);
                    monto.Text        = co.Leer.GetInt32(1).ToString();
                    metodoID          = co.Leer.GetInt32(2);
                }

                int i = 0;
                while (i < metodosID.Count)
                {
                    if (metodosID[i] == metodoID)
                    {
                        metodoPago.SelectedIndex = i;
                    }
                    i++;
                }
            }
        }
Esempio n. 4
0
        public Reportes(Conexion co)
        {
            InitializeComponent();
            this.co            = co;
            this.StartPosition = FormStartPosition.CenterScreen;
            Region             = Funciones.redondear(Width, Height);


            indices = new List <int>();

            // Es necesario?
            PPP = new List <bool>();
            PPP.Add(false);
            PPP.Add(false);
            PPP.Add(false);
            PPP.Add(false);
            PPP.Add(false);

            PPC = new List <bool>();
            PPC.Add(false);
            PPC.Add(false);
            PPC.Add(false);
            PPC.Add(false);

            PR = new List <bool>();
            PR.Add(false);
            PR.Add(false);
            PR.Add(false);
            PR.Add(false);
            PR.Add(false);
            PR.Add(false);

            GR = new List <bool>();
            GR.Add(false);
            GR.Add(false);
            GR.Add(false);
            GR.Add(false);
            GR.Add(false);
            GR.Add(false);

            I = new List <bool>();
            I.Add(false);
            I.Add(false);
            I.Add(false);
            I.Add(false);
            I.Add(false);
            I.Add(false);

            fechaA = "";
            fechaB = "";
        }
Esempio n. 5
0
        /*
         * 1 - Advertencia: Generalmente usada para confirmar la eliminacion de un elemento
         * 2 - Aviso: Se usa para avisar que una accion no se puede llevar a cabo
         * 3 - Error: Indica los errores
         */
        public MessageBox(String texto, int opc)
        {
            InitializeComponent();
            Region          = Funciones.redondear(Width, Height);
            button2.Visible = false;

            switch (opc)
            {
            case 1:
                label1.Text     = "ADVERTENCIA";
                button2.Visible = true;
                break;

            case 2:
                label1.Text = "AVISO";
                break;

            case 3:
                label1.Text = "ERROR";
                break;

            default:
                label1.Text = "AVISO";
                break;
            }
            int x = panel7.Width / 2;

            label1.Location = new Point(x - label1.Width / 2, label1.Location.Y);

            label2.Text = texto;
            //Se adapta el tamaño del texto del label dependiendo del tamaño de la palabara
            while (label2.Width > this.Width)
            {
                label2.Font = new Font("Gothic A1", label2.Font.Size - 0.5f, label2.Font.Style);
            }
            //Se ajusta su posicion para que se centre
            int c = this.Width / 2;
            int y = this.Height / 2;

            label2.Location    = new Point(c - label2.Width / 2, y - label2.Height / 2);
            instanciaAbierta   = false;
            this.StartPosition = FormStartPosition.CenterScreen;
        }
Esempio n. 6
0
        public AgregarRedesSociales(Conexion co, int id, bool editar)
        {
            InitializeComponent();
            Region = Funciones.redondear(Width, Height);

            this.co            = co;
            this.StartPosition = FormStartPosition.CenterScreen;
            this.editar        = editar;
            //Si esta en modo edicion se carga el elemento seleccionado en el frame Utilidades
            if (editar)
            {
                this.ID = id;
                co.Comando("SELECT NombreRedSocial FROM TipoDeRedSocial WHERE ID = " + ID);
                if (co.LeerRead)
                {
                    nombre.Text = co.Leer.GetString(0);
                }
            }
        }
Esempio n. 7
0
 public Form1(int idUsr, int idSesion, Conexion co)
 {
     InitializeComponent();
     Region        = Funciones.redondear(Width, Height);
     this.idUsr    = idUsr;
     this.idSesion = idSesion;
     this.co       = co;
     inic          = true;
     emp           = false;
     trab          = false;
     pag           = false;
     act           = false;
     estado        = false;
     utilidades    = false;
     //Coloca el frame en el centro
     this.StartPosition = FormStartPosition.CenterScreen;
     //Mando llamar el panel de inicio
     AbrirForm(new VentanaPrincipal(co));
 }
        int opc;                              // 1 - Tipo de trabajo | 2 - Tipo de empleado
        public AgregarTipoTrabajoEmpleado(Conexion co, int id, bool editar, int opc)
        {
            InitializeComponent();
            Region = Funciones.redondear(Width, Height);

            this.co            = co;
            this.StartPosition = FormStartPosition.CenterScreen;
            this.editar        = editar;
            this.opc           = opc;
            this.ID            = id;
            //Si esta en modo edicion se carga el elemento seleccionado en el frame Utilidades
            if (editar)
            {
                //Si es opcion 1 quiere decir que es un Tipo de trabajo
                if (opc == 1)
                {
                    co.Comando("SELECT NombreTipoTrab, DescripcionTrab FROM TipoTrabajos WHERE ID = " + ID);
                    if (co.LeerRead)
                    {
                        nombre.Text      = co.Leer.GetString(0);
                        descripcion.Text = co.Leer.GetString(1);
                    }
                    label1.Text = "TIPO DE TRABAJO";
                }
                //Si no, quiere decir que es un Tipo de empleado
                else
                {
                    nombre.Enabled = false;
                    co.Comando("SELECT NombreTipo, IFNULL(Descripcion,'') FROM TipoEmpleado WHERE ID = " + ID);
                    if (co.LeerRead)
                    {
                        nombre.Text      = co.Leer.GetString(0);
                        descripcion.Text = co.Leer.GetString(1);
                    }
                    label1.Text = "TIPO DE EMPLEADO";
                }
            }
        }
Esempio n. 9
0
        public VisuaProyecto(Proyectos pro, Conexion co, int id, int elem)
        {
            InitializeComponent();
            Region   = Funciones.redondear(Width, Height);
            this.pro = pro;
            this.co  = co;
            //Ajusto el formato de los datetimePicker
            dateTimePicker1.Format       = DateTimePickerFormat.Custom;
            dateTimePicker1.CustomFormat = "dd/MM/yyyy";
            dateTimePicker2.Format       = DateTimePickerFormat.Custom;
            dateTimePicker2.CustomFormat = "dd/MM/yyyy";
            this.StartPosition           = FormStartPosition.CenterScreen;
            //Opcion seleccionada
            sel = elem;
            //Proyecto seleccionado
            IDPro = id;
            //Incializo la confirmacion de eliminacion
            confirmacion = false;
            //Habilito botones dependiendo de la opcion de la ventana
            //Si se esta visualizando un proyecto
            if (elem == 1)
            {
                butGuardar.Visible      = false;
                butEliminar.Visible     = true;
                butCancelar.Visible     = false;
                butCerrar.Visible       = true;
                nombre.Enabled          = false;
                dateTimePicker1.Enabled = false;
                dateTimePicker2.Enabled = false;
                comboBox1.Enabled       = false;
                richTextBox1.Enabled    = false;

                //----------------------Muestro la info del proyecto seleccionado--------------------------
                co.Comando("SELECT * FROM Proyectos WHERE ID =" + id);
                if (co.LeerRead)
                {
                    nombre.Text           = co.Leer.GetString(1);
                    richTextBox1.Text     = co.Leer.GetString(2);
                    dateTimePicker1.Value = co.Leer.GetDateTime(3);
                    dateTimePicker2.Value = co.Leer.GetDateTime(4);
                }
                //----------------------- REVISAR EN LA COMPUTADORA DE JOSUE ----------------------------------------


                List <String> Nombre = new List <String>();
                Nombre.Add(co.Leer.GetString(5));
                comboBox1.DataSource = Nombre;
            }
            //Si se dese agregar un nuevo proyecto
            else
            {
                butGuardar.Visible      = true;
                butEliminar.Visible     = false;
                butCancelar.Visible     = true;
                butEditar.Visible       = false;
                butCerrar.Visible       = false;
                nombre.Enabled          = true;
                dateTimePicker1.Enabled = true;
                dateTimePicker2.Enabled = true;
                comboBox1.Enabled       = true;
                richTextBox1.Enabled    = true;

                //----------------------Mostrar empleados en comboBox--------------------------
                co.Comando("SELECT Nombre FROM Empleado");

                List <String> Nombres = new List <String>();
                while (co.LeerRead)
                {
                    String Nombre = co.Leer.GetString(0);
                    Nombres.Add(Nombre);
                }
                comboBox1.DataSource = Nombres;
            }
        }
Esempio n. 10
0
        //1 - Visualizar 2 - Crear un trabajo nuevo
        public VisuaTrabajos(Trabajos tra, Conexion co, int x, int elem)
        {
            InitializeComponent();
            Region   = Funciones.redondear(Width, Height);
            this.tra = tra;
            this.co  = co;
            editando = false;
            aceptar  = false;
            checar   = false;

            this.StartPosition = FormStartPosition.CenterParent;

            //Arrego para guardar los empleados extras en el modo edicion
            EmpleadosModoEdicion = new List <int>();

            //Opcion seleccionada en el frame anterior
            sel = elem;

            //Renglones usados en el dataGridView
            if (editando)
            {
                rows = dataGridView1.RowCount;
            }
            else
            {
                rows = 0;
            }

            //Arreglos para guardar los IDs de los Proyectos y empleados totales
            ProyectosID = new List <int>();
            EmpleadosID = new List <int>();

            //Arreglos para guardar los IDs y nombres de los empleados del trabajo seleccionado
            EmpleadosVisua = new List <int>();
            EmpleadosNom   = new List <string>();

            //---------- El id del trabajo seleccionado --- Su proyecto ---- su TipoTrabjo ---------------
            IDTrab   = x;
            ProID    = 0;
            TipoTrab = 0;

            //----------------------Desplegar opciones en combobox--------------------------
            //Tipo de Trabajo
            co.Comando("SELECT NombreTipoTrab FROM TipoTrabajos;");
            List <String> Tipos = new List <String>();

            while (co.LeerRead)
            {
                String tipoTrb = co.Leer.GetString(0);
                Tipos.Add(tipoTrb);
            }
            //Proyecto del trabajo
            int           numProSel = 0;
            List <String> Proyectos = new List <String>();

            co.Comando("SELECT IFNULL(ProyectosID,0) FROM Trabajos WHERE ID =" + IDTrab + ";");
            if (co.LeerRead)
            {
                numProSel = co.Leer.GetInt32(0);
            }
            //Coloco el nombre del proyecto del trabajo, si no tiene se coloca 0 y "sin proyecto"
            co.Comando("SELECT ID, Nombre FROM Proyectos WHERE ID =" + numProSel + ";");
            if (co.LeerRead)
            {
                ProyectosID.Add(co.Leer.GetInt32(0));
                Proyectos.Add(co.Leer.GetString(1));
                ProyectosID.Add(0);
                Proyectos.Add("Sin proyecto");
            }
            else
            {
                ProyectosID.Add(0);
                Proyectos.Add("Sin proyecto");
            }
            //Proyectos
            co.Comando("SELECT ID,Nombre FROM Proyectos WHERE ID !=" + numProSel + ";");

            while (co.LeerRead)
            {
                int id = co.Leer.GetInt32(0);
                ProyectosID.Add(id);
                String Pro = co.Leer.GetString(1);
                Proyectos.Add(Pro);
            }

            //Empleados
            co.Comando("SELECT ID,Nombre FROM Empleado;");
            List <String> Nombres = new List <String>();

            while (co.LeerRead)
            {
                int id = co.Leer.GetInt32(0);
                EmpleadosID.Add(id);
                String Nom = co.Leer.GetString(1);
                Nombres.Add(Nom);
            }

            comboBox1.DataSource = Tipos;
            comboBox2.DataSource = Proyectos;
            comboBox3.DataSource = Nombres;
            ProyectoOriginal     = ProyectosID[comboBox2.SelectedIndex];
            //------------------------------------------------------------------------------
            //Se esta visualizando un Trabajo
            if (elem == 1)
            {
                //Botones
                butEditar.Visible        = true;
                butGuardar.Visible       = false;
                butEliminar.Visible      = true;
                butCerrar.Visible        = true;
                editarEncargados.Visible = true;
                //butCancelar.Visible = false;
                AgreEmpleado.Visible = false;
                EliEmpleado.Visible  = false;
                PrograPago.Visible   = false;
                //TextBox
                textNombre.Enabled      = false;
                richTextBox1.Enabled    = false;
                comboBox1.Enabled       = false;
                comboBox2.Enabled       = false;
                dateTimePicker1.Enabled = false;
                dateTimePicker2.Enabled = false;
                comboBox3.Enabled       = false;
                dataGridView1.Enabled   = false;

                //*------------------Editar trabajo---------------------------------------------
                co.Comando("SELECT Descripcion, Nombre,FechaInicio,FechaFin,TipoTrabajosID, IFNULL(ProyectosID,0) FROM Trabajos WHERE ID = " + IDTrab + ";");

                if (co.LeerRead)
                {
                    richTextBox1.Text = co.Leer.GetString(0);
                    textNombre.Text   = co.Leer.GetString(1);
                    //Tentrega.Text = co.Leer.GetInt32(2).ToString();
                    dateTimePicker1.Value = co.Leer.GetDateTime(2);
                    dateTimePicker2.Value = co.Leer.GetDateTime(3);
                    TipoTrab = co.Leer.GetInt32(4);
                    ProID    = co.Leer.GetInt32(5);
                }
                else
                {
                    MessageBox mensaje = new MessageBox("No se encuentra", 3);
                    mensaje.ShowDialog();
                }

                //Cargo los empleados asignados al proyecto
                cargarEmpleados();
            }
            //Crear nuevo trabajo
            else
            {
                //Botones
                butEditar.Visible        = false;
                butGuardar.Visible       = false;
                butEliminar.Visible      = false;
                butCerrar.Visible        = true;
                editarEncargados.Visible = false;
                //butCancelar.Visible = false;
                cancelar.Visible     = false;
                AgreEmpleado.Visible = true;
                EliEmpleado.Visible  = true;
                PrograPago.Visible   = true;
                //TextBox
                textNombre.Enabled      = true;
                richTextBox1.Enabled    = true;
                comboBox1.Enabled       = true;
                comboBox2.Enabled       = true;
                dateTimePicker1.Enabled = true;
                dateTimePicker2.Enabled = true;
                comboBox3.Enabled       = true;
                dataGridView1.Enabled   = true;
            }
        }
Esempio n. 11
0
        // 0 - Pagar | 2 - Ver un gasto | 1 - Ver un pago hecho
        public FormularioPago(pagos pa, int PagPro, int opcion, Conexion co)
        {
            InitializeComponent();
            Region = Funciones.redondear(Width, Height);

            this.pa     = pa;
            this.co     = co;
            this.opcion = opcion;
            IDPP        = PagPro;


            //Metodos de pago
            metodosID  = new List <int>();
            metodosNom = new List <string>();
            co.Comando("SELECT ID FROM Metodo;");
            while (co.LeerRead)
            {
                metodosID.Add(co.Leer.GetInt32(0));
            }
            for (int i = 0; i < metodosID.Count; i++)
            {
                co.Comando("SELECT Metodo FROM Metodo WHERE ID = " + metodosID[i] + ";");
                if (co.LeerRead)
                {
                    metodosNom.Add(co.Leer.GetString(0));
                }
            }
            metodoPago.DataSource = metodosNom;

            this.StartPosition = FormStartPosition.CenterScreen;
            //Pago nuevo
            if (opcion == 0)
            {
                //TextsEdit
                PagoGasto.Enabled    = true;
                empleado.Enabled     = false;
                trabajo.Enabled      = false;
                textConcepto.Enabled = true;
                metodoPago.Enabled   = true;
                monto.Enabled        = true;
                //Labels
                pagosrestantes.Visible = true;
                //Botones
                cerrar.Visible   = true;
                eliminar.Visible = false;
                editar.Visible   = false;
                guardar.Visible  = false;
                aceptar.Visible  = true;

                //PagoProgrado
                PagoGasto.SelectedIndex = 0;
            }
            //Visualizar pago
            else if (opcion == 1)
            {
                //TextsEdit
                PagoGasto.Enabled    = false;
                empleado.Enabled     = false;
                trabajo.Enabled      = false;
                textConcepto.Enabled = false;
                metodoPago.Enabled   = false;
                monto.Enabled        = false;
                //Labels
                pagosrestantes.Visible = false;
                //Botones
                cerrar.Visible   = true;
                eliminar.Visible = true;
                editar.Visible   = true;
                guardar.Visible  = false;
                aceptar.Visible  = false;

                pago();
            }
            //Visuallizar gasto
            else if (opcion == 2)
            {
                int metID = 0;
                PagoGasto.SelectedIndex = 1;
                co.Comando("SELECT p.monto, p.MetodoID, g.Concepto FROM Pagos as p INNER JOIN Gasto as g on(g.ID = p.GastoID);");
                if (co.LeerRead)
                {
                    monto.Text        = co.Leer.GetInt32(0).ToString();
                    metID             = co.Leer.GetInt32(1);
                    textConcepto.Text = co.Leer.GetString(2);
                }
                int i = 0;
                while (i < metodosID.Count)
                {
                    if (metodosID[i] == metID)
                    {
                        metodoPago.SelectedIndex = i;
                    }
                    i++;
                }


                //TextsEdit
                PagoGasto.Enabled    = false;
                empleado.Enabled     = false;
                trabajo.Enabled      = false;
                textConcepto.Enabled = false;
                metodoPago.Enabled   = false;
                monto.Enabled        = false;
                //Labels
                pagosrestantes.Visible = false;
                //Botones
                cerrar.Visible   = true;
                eliminar.Visible = true;
                editar.Visible   = true;
                guardar.Visible  = false;
                aceptar.Visible  = false;
            }
            else if (opcion == 3)
            {
                //TextsEdit
                PagoGasto.SelectedIndex = 1;
                PagoGasto.Enabled       = false;
                empleado.Enabled        = false;
                trabajo.Enabled         = false;
                textConcepto.Enabled    = true;
                metodoPago.Enabled      = true;
                monto.Enabled           = true;
                //Labels
                pagosrestantes.Visible = false;
                //Botones
                cerrar.Visible   = true;
                eliminar.Visible = false;
                editar.Visible   = false;
                guardar.Visible  = false;
                aceptar.Visible  = true;


                trabajo.Text        = "";
                empleado.Text       = "";
                pagosrestantes.Text = "";
            }
        }