Beispiel #1
0
        private void Reportes_Miembros_Load(object sender, EventArgs e)
        {
            conexion  = new ConnectorSingle();
            adaptador = new SqlDataAdapter();

            List <string> lista_columna = new List <string>();

            lista_columna.Add("ID");
            lista_columna.Add("NOMBRE Y APELLIDO");
            lista_columna.Add("TODOS");
            cmb_columna.DataSource    = lista_columna;
            cmb_columna.SelectedIndex = 2;

            string sql1 = "Select u.id, (u.name+' '+lastname) as 'Nombres_Apellidos', username, phone, cellphone, address, emailEspol, emailPersonal, birthDate "
                          + "From Users as u inner join Usertreatment as t on u.UserTreatmentId=t.Id where isMember='true'";

            adaptador.SelectCommand = new SqlCommand(sql1, conexion.getConnection());

            DataTable table2 = new DataTable();
            DataSet   set    = new DataSet();

            adaptador.Fill(table2);
            set.Tables.Add(table2);

            List <string> atributo = new List <string>(new string[] { "Cédula", "Nombres y Apellidos", "User", "Teléfono", "Celular",
                                                                      "Dirección", "Email Espol", "Email Personal", "Fecha de Nacimiento" });

            Reportes Report = new Reportes(set, atributo, "Nomina de Miembros");

            ShowReport(set, Report.GetMemoryStream());
        }
Beispiel #2
0
        private void Reporte_Actividad_Rama_Anual_Load(object sender, EventArgs e)
        {
            conexion  = new ConnectorSingle();
            adaptador = new SqlDataAdapter();

            List <string> lista_columna = new List <string>();

            lista_columna.Add("ACTIVA");
            lista_columna.Add("INACTIVA");
            lista_columna.Add("TODOS");
            cmb_columna.DataSource    = lista_columna;
            cmb_columna.SelectedIndex = 2;


            string sql1 = "Select e.id, e.name, description, (Select u.name+' '+u.lastname From users u where u.id = e.createdBy) as  createdBy, e.start, b.name, u.Id, (Select u.name+' '+u.lastname From users u where u.id = e.responsible) as 'responsible', username "
                          + "From event as e inner join branch as b on b.Id=e.branchId inner join Users as u on u.Id=e.responsible";

            adaptador.SelectCommand = new SqlCommand(sql1, conexion.getConnection());

            DataTable table2 = new DataTable();
            DataSet   set    = new DataSet();

            adaptador.Fill(table2);
            set.Tables.Add(table2);

            List <string> atributo = new List <string>(new string[] { "ID Actividad", "Nombre de Actividad", "Descripción",
                                                                      "Actividad Creada", "Fecha de Inicio", "Nombre de Rama", "Cédula", "Responsable de la Actividad", "User" });

            Reportes Report = new Reportes(set, atributo, "Actividad de la Rama Anual");

            ShowReport(set, Report.GetMemoryStream());
        }
        private void button1_Click(object sender, EventArgs e)
        {
            char[]   delimiterChars = { ' ' };
            string[] name;

            //Valida si es nulo o vacio
            if (!String.IsNullOrEmpty(text_campo.Text))
            {
                campo = text_campo.Text;
                name  = campo.Split(delimiterChars);
            }
            else
            {
                campo = "0";
                name  = campo.Split(delimiterChars);
            }

            if (cmb_columna.Text.Equals("ID"))
            {
                sql = "Select u.id, (u.name+' '+lastname) as 'Nombres_Apellidos', username, phone, cellphone, address, emailEspol, emailPersonal, birthDate "
                      + "From Users as u inner join Usertreatment as t on u.UserTreatmentId=t.Id where isCandidate='true' AND  u.Id='" + campo + "'";
            }
            else if (cmb_columna.Text.Equals("NOMBRE Y APELLIDO") && name.Length > 1)
            {
                sql = "Select u.id, (u.name+' '+lastname) as 'Nombres_Apellidos', username, phone, cellphone, address, emailEspol, emailPersonal, birthDate "
                      + "From Users as u inner join Usertreatment as t on u.UserTreatmentId=t.Id where isCandidate='true' AND  u.name like '" + name[0] + "%' AND u.lastname like '" + name[1] + "%'";
            }
            else if (cmb_columna.Text.Equals("NOMBRE Y APELLIDO") && name.Length < 2)
            {
                sql = "Select u.id, (u.name+' '+lastname) as 'Nombres_Apellidos', username, phone, cellphone, address, emailEspol, emailPersonal, birthDate "
                      + "From Users as u inner join Usertreatment as t on u.UserTreatmentId=t.Id where isCandidate='true' AND  u.name like '" + name[0] + "%'";
            }
            else if (cmb_columna.Text.Equals("TODOS"))
            {
                sql = "Select u.id, (u.name+' '+lastname) as 'Nombres_Apellidos', username, phone, cellphone, address, emailEspol, emailPersonal, birthDate "
                      + "From Users as u inner join Usertreatment as t on u.UserTreatmentId=t.Id where isCandidate='true'";
            }
            else
            {
                sql = "Select u.id, (u.name+' '+lastname) as 'Nombres_Apellidos', username, phone, cellphone, address, emailEspol, emailPersonal, birthDate "
                      + "From Users as u inner join Usertreatment as t on u.UserTreatmentId=t.Id where u.Id='NULL'";
            }

            adaptador.SelectCommand = new SqlCommand(sql, conexion.getConnection());

            DataTable table2 = new DataTable();
            DataSet   set    = new DataSet();

            adaptador.Fill(table2);
            set.Tables.Add(table2);

            List <string> atributo = new List <string>(new string[] { "Cédula", "Nombres y Apellidos", "User", "Teléfono", "Celular",
                                                                      "Dirección", "Email Espol", "Email Personal", "Fecha de Nacimiento" });

            Reportes Report = new Reportes(set, atributo, "Nomina de Postulante");

            ShowReport(set, Report.GetMemoryStream());
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            //Valida si es nulo o vacio
            if (!String.IsNullOrEmpty(text_campo.Text))
            {
                rama = text_campo.Text;
            }
            else
            {
                rama = "MES";
            }

            mes = Convert.ToString(Convert.ToInt32(cmb_columna.SelectedIndex.ToString()) + 1);

            if (cmb_columna.Text.Equals("TODOS"))
            {
                sql = "Select e.id, e.name, description, (Select u.name+' '+u.lastname From users u where u.id = e.createdBy) as  createdBy, e.start, b.name, u.Id, (Select u.name+' '+u.lastname From users u where u.id = e.responsible) as 'responsible', username "
                      + "From event as e inner join branch as b on b.Id=e.branchId inner join Users as u on u.Id=e.responsible where b.isEnable='true'";
            }
            else if (rama.Equals("MES"))
            {
                sql = "Select e.id, e.name, description, (Select u.name+' '+u.lastname From users u where u.id = e.createdBy) as  createdBy, e.start, b.name, u.Id, (Select u.name+' '+u.lastname From users u where u.id = e.responsible) as 'responsible', username "
                      + "From event as e inner join branch as b on b.Id=e.branchId inner join Users as u on u.Id=e.responsible where month(e.start)='" + mes + "' and b.isEnable='true'";
            }
            else
            {
                sql = "Select e.id, e.name, description, (Select u.name+' '+u.lastname From users u where u.id = e.createdBy) as  createdBy, e.start, b.name, u.Id, (Select u.name+' '+u.lastname From users u where u.id = e.responsible) as 'responsible', username "
                      + "From event as e inner join branch as b on b.Id=e.branchId inner join Users as u on u.Id=e.responsible where month(e.start)='" + mes + "' and b.name='" + rama + "' and b.isEnable='true'";
            }


            adaptador.SelectCommand = new SqlCommand(sql, conexion.getConnection());

            DataTable table2 = new DataTable();
            DataSet   set    = new DataSet();

            adaptador.Fill(table2);
            set.Tables.Add(table2);

            List <string> atributo = new List <string>(new string[] { "ID Actividad", "Nombre de Actividad", "Descripción",
                                                                      "Actividad Creada", "Fecha de Inicio", "Nombre de Rama", "Cédula", "Responsable de la Actividad", "User" });

            Reportes Report = new Reportes(set, atributo, "Actividad Rama Activa Mensual");

            ShowReport(set, Report.GetMemoryStream());
        }
Beispiel #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (cmb_columna.Text.Equals("MIEMBROS"))
            {
                sql = "Select e.id, e.name, description, duration, (Select u.name+' '+u.lastname From users u where u.id = e.createdBy) as  createdBy, "
                      + "start, u.Id, (Select u.name+' '+u.lastname From users u where u.id = e.responsible) as 'responsible', username "
                      + "From event as e inner join Users as u on u.Id=e.responsible inner join Usertreatment as t on u.UsertreatmentId=t.Id where isMember='true'";
            }
            else if (cmb_columna.Text.Equals("POSTULANTES"))
            {
                sql = "Select e.id, e.name, description, duration, (Select u.name+' '+u.lastname From users u where u.id = e.createdBy) as  createdBy, "
                      + "start, u.Id, (Select u.name+' '+u.lastname From users u where u.id = e.responsible) as 'responsible', username "
                      + "From event as e inner join Users as u on u.Id=e.responsible inner join Usertreatment as t on u.UsertreatmentId=t.Id where isCandidate='true'";
            }
            else if (cmb_columna.Text.Equals("TODOS"))
            {
                sql = "Select e.id, e.name, description, duration, (Select u.name+' '+u.lastname From users u where u.id = e.createdBy) as  createdBy, "
                      + "start, u.Id, (Select u.name+' '+u.lastname From users u where u.id = e.responsible) as 'responsible', username "
                      + "From event as e inner join Users as u on u.Id=e.responsible inner join Usertreatment as t on u.UsertreatmentId=t.Id";
            }
            else
            {
                sql = "Select e.id, e.name, description, duration, (Select u.name+' '+u.lastname From users u where u.id = e.createdBy) as  createdBy, "
                      + "start, u.Id, (Select u.name+' '+u.lastname From users u where u.id = e.responsible) as 'responsible', username "
                      + "From event as e inner join Users as u on u.Id=e.responsible inner join Usertreatment as t on u.UsertreatmentId=t.Id where u.Id='NULL'";
            }

            adaptador.SelectCommand = new SqlCommand(sql, conexion.getConnection());

            DataTable table2 = new DataTable();
            DataSet   set    = new DataSet();

            adaptador.Fill(table2);
            set.Tables.Add(table2);

            List <string> atributo = new List <string>(new string[] { "ID Actividad", "Nombre de Actividad", "Descripción",
                                                                      "Duración", "Actividad Creada", "Fecha de Inicio", "Cédula", "Responsable de la Actividad", "User" });

            Reportes Report = new Reportes(set, atributo, "Actividades Realizadas");

            ShowReport(set, Report.GetMemoryStream());
        }
Beispiel #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (cmb_columna.Text.Equals("MIEMBROS"))
            {
                sql = "Select u.id, (u.name+' '+lastname) as 'Nombres_Apellidos', username, phone, cellphone, address, emailEspol, emailPersonal, birthDate "
                      + "From Users as u inner join Usertreatment as t on u.UserTreatmentId=t.Id where isMember='true'";
            }
            else if (cmb_columna.Text.Equals("POSTULANTES"))
            {
                sql = "Select u.id, (u.name+' '+lastname) as 'Nombres_Apellidos', username, phone, cellphone, address, emailEspol, emailPersonal, birthDate "
                      + "From Users as u inner join Usertreatment as t on u.UserTreatmentId=t.Id where isCandidate='true'";
            }
            else if (cmb_columna.Text.Equals("TODOS"))
            {
                sql = "Select u.id, (u.name+' '+lastname) as 'Nombres_Apellidos', username, phone, cellphone, address, emailEspol, emailPersonal, birthDate "
                      + "From Users as u inner join Usertreatment as t on u.UserTreatmentId=t.Id ";
            }
            else
            {
                sql = "Select u.id, (u.name+' '+lastname) as 'Nombres_Apellidos', username, phone, cellphone, address, emailEspol, emailPersonal, birthDate "
                      + "From Users as u inner join Usertreatment as t on u.UserTreatmentId=t.Id where u.Id='NULL'";
            }

            adaptador.SelectCommand = new SqlCommand(sql, conexion.getConnection());

            DataTable table2 = new DataTable();
            DataSet   set    = new DataSet();

            adaptador.Fill(table2);
            set.Tables.Add(table2);

            List <string> atributo = new List <string>(new string[] { "Cédula", "Nombres y Apellidos", "User", "Teléfono", "Celular",
                                                                      "Dirección", "Email Espol", "Email Personal", "Fecha de Nacimiento" });

            Reportes Report = new Reportes(set, atributo, "Nomina General");

            ShowReport(set, Report.GetMemoryStream());
        }