示例#1
0
        //GET CREATE DATATABLE
        public string CreateDataTable(int show, int pg, string search, string orderby, string sort, SessionDB sesion)
        {
            if (sesion == null)
            {
                sesion = SessionDB.start(Request, Response, false, db);
            }

            Factory.DataTable table     = new Factory.DataTable();
            string            CheckIcon = "<i class=\"fa fa-check\"></i>";

            table.TABLE    = sesion.vdata["TABLE_PERSONAS"];
            table.COLUMNAS = new string[] { "Reg", "ID", "Nombre", "Apellidos", "RFC", "CURP",
                                            "Pais", "Estado", "Ciudad", "Del/Mun", "Colonia", "Calle",
                                            "CP", "Escuela sede", "Cve. Título", "Título profesional",
                                            "Licenciatura", "Maestría", "Cve. Profesión",
                                            "Profesión", "Cédula profesional", "Fec. Cédula", "NSS" };
            table.CAMPOS = new string[] { "REGISTRADO", "IDSIU", "NOMBRES", "APELLIDOS", "RFC", "CURP",
                                          "DIRECCION_PAIS", "DIRECCION_ESTADO", "DIRECCION_CIUDAD", "DIRECCION_ENTIDAD",
                                          "DIRECCION_COLONIA", "DIRECCION_CALLE", "DIRECCION_CP", "AREAASIGNACION", "CVE_TITULOPROFESIONAL",
                                          "TITULOPROFESIONAL", "TITULO_LICENCIATURA", "TITULO_MAESTRIA", "CVE_PROFESION", "PROFESION", "CEDULAPROFESIONAL",
                                          "FECHACEDULA", "SEGUROSOCIAL" };
            table.CAMPOSSEARCH = new string[] { "IDSIU", "NOMBRES", "APELLIDOS" };
            table.dictColumnFormat["REGISTRADO"] = delegate(string str, ResultSet res) { return(str == "True" ? CheckIcon : ""); };

            table.orderby           = orderby;
            table.sort              = sort;
            table.show              = show;
            table.pg                = pg;
            table.search            = search;
            table.field_id          = "IDSIU";
            table.TABLECONDICIONSQL = "USUARIO = '" + sesion.pkUser + "'";

            table.enabledCheckbox       = true;
            table.enabledButtonControls = false;

            return(table.CreateDataTable(sesion));
        }
示例#2
0
        //GET CREATE DATATABLE
        public string CreateDataTable(int show, int pg, string search, string orderby, string sort, SessionDB sesion)
        {
            if (sesion == null)
            {
                sesion = SessionDB.start(Request, Response, false, db);
            }

            Factory.DataTable table     = new Factory.DataTable();
            string            CheckIcon = "<i class=\"fa fa-check\"></i>";

            table.TABLE = sesion.vdata["TABLE_PA_UPDATE"];


            /*
             * string[] columnas = {"", "ID SIU", "Docente(NOMBRE)","Docente(Apellido)","Campus", "Escuela", "NRC", "Materia", "Curso"
             *      ,"Nombre de Materia","Fecha Inicio","Fecha Fin","Tipo de Curso","Metodo de Instrucción"
             *      ,"Status","Inscritos","Parte del periodo","Descripción de parte del periodo"
             *      ,"Tipo de Docente","Máximo Grado Académico","Horas Semanales","Horas Programadas"
             *      ,"% de Responsabilidad","Horas a Pagar","Opción de Pago","Tabulador","Indicador de sesión","Periodo" };
             *
             *
             * string[] campos = {"CASO", "IDSIU","NOMBRE","APELLIDOS","CAMPUS_INB", "ESCUELA", "NRC",  "MATERIA", "CURSO"
             *     ,"NOMBREMATERIA","FECHAINICIAL", "FECHAFINAL","TIPODECURSO","METODODEINSTRUCCION"
             *     ,"STATUS","INSCRITOS","PARTEDELPERIODO","PARTEDELPERIODODESC", "TIPODEDOCENTE"
             *     ,"MAXIMOGRADOACADEMICO","HORASSEMANALES","HORASPROGRAMADAS","RESPONSABILIDAD","HORASAPAGAR"
             *     ,"OPCIONDEPAGO","TABULADOR","INDICADORDESESION","PERIODO","USUARIO"
             *     ,"CVE_ESCUELA","CVE_TIPODEDOCENTE","CVE_OPCIONDEPAGO", "INDICADOR",  "ID_PA" };
             *
             *
             */


            string[] columnas = { "", "ID SIU",               "Docente(NOMBRE)", "Docente(Apellido)", "Periodo",   "NRC",                 "Materia", "Nombre de Materia"
                                  ,   "% de Responsabilidad", "Horas a Pagar",   "Fecha Inicio",      "Fecha Fin", "Indicador de sesión", "Campus" };


            string[] campos = { "CASO", "IDSIU",        "NOMBRE",            "APELLIDOS",         "PERIODO",    "NRC",   "MATERIA", "NOMBREMATERIA", "RESPONSABILIDAD", "HORASAPAGAR"
                                ,       "FECHAINICIAL", "FECHAFINAL",        "INDICADORDESESION", "CAMPUS_INB", "USUARIO"
                                ,       "CVE_ESCUELA",  "CVE_TIPODEDOCENTE", "CVE_OPCIONDEPAGO",  "INDICADOR",  "ID_PA", "CAMPOFI", "CAMPOFF",       "CAMPOHRS",        "CAMPORESPONS", "CAMPOINDS" };

            string[] campossearch = { "CAMPUS_INB",      "MATERIA",           "NRC"
                                      ,                  "NOMBREMATERIA",     "FECHAINICIAL","FECHAFINAL"
                                      ,                  "IDSIU",             "APELLIDOS", "NOMBRE",
                                      "RESPONSABILIDAD", "HORASAPAGAR"
                                      ,                  "INDICADORDESESION", "PERIODO" };

            string[] camposhidden = { "USUARIO", "CVE_ESCUELA", "CVE_TIPODEDOCENTE", "CVE_OPCIONDEPAGO", "INDICADOR", "ID_PA", "CAMPOFI", "CAMPOFF", "CAMPOHRS", "CAMPORESPONS", "CAMPOINDS" };


            table.dictColumnFormat["RESPONSABILIDAD"] = delegate(string value, ResultSet res) {
                char caso = res.Get("CASO").ToCharArray()[0];
                if (caso == 'A')
                {//Actualización
                    if (res.GetBool("CAMPORESPONS"))
                    {
                        return("<div style=\"width:80px; height: 25px;text-align: center; background-color:yellow;color:;\" >" + value + "</div>");
                    }

                    return("<div style=\"width:80px;text-align: center;\">" + value + "</div>");
                }
                else
                {
                    return("<div style=\"width:80px;text-align: center;\">" + value + "</div>");
                }
            };

            table.dictColumnFormat["HORASAPAGAR"] = delegate(string value, ResultSet res) {
                char caso = res.Get("CASO").ToCharArray()[0];
                if (caso == 'A')
                {//Actualización
                    if (res.GetBool("CAMPOHRS"))
                    {
                        return("<div style=\"width:80px; height: 25px;text-align: center; background-color:yellow;color:;\" >" + value + "</div>");
                    }

                    return("<div style=\"width:80px;text-align: center;\">" + value + "</div>");
                }
                else
                {
                    return("<div style=\"width:80px;text-align: center;\">" + value + "</div>");
                }
            };

            table.dictColumnFormat["FECHAINICIAL"] = delegate(string value, ResultSet res) {
                char caso = res.Get("CASO").ToCharArray()[0];
                if (caso == 'A')
                {//Actualización
                    if (res.GetBool("CAMPOFI"))
                    {
                        return("<div style=\"width:80px; height: 25px;text-align: center; background-color:yellow;color:;\" >" + value + "</div>");
                    }

                    return("<div style=\"width:80px;text-align: center;\">" + value + "</div>");
                }
                else
                {
                    return("<div style=\"width:80px;text-align: center;\">" + value + "</div>");
                }
            };

            table.dictColumnFormat["FECHAFINAL"] = delegate(string value, ResultSet res) {
                char caso = res.Get("CASO").ToCharArray()[0];
                if (caso == 'A')
                {//Actualización
                    if (res.GetBool("CAMPOFF"))
                    {
                        return("<div style=\"width:80px; height: 25px;text-align: center; background-color:yellow;color:;\" >" + value + "</div>");
                    }

                    return("<div style=\"width:80px;text-align: center;\">" + value + "</div>");
                }
                else
                {
                    return("<div style=\"width:80px;text-align: center;\">" + value + "</div>");
                }
            };


            table.dictColumnFormat["INDICADORDESESION"] = delegate(string value, ResultSet res) {
                char caso = res.Get("CASO").ToCharArray()[0];
                if (caso == 'A')
                {//Actualización
                    if (res.GetBool("CAMPOINDS"))
                    {
                        return("<div style=\"width:80px; height: 25px;text-align: center; background-color:yellow;color:;\" >" + value + "</div>");
                    }

                    return("<div style=\"width:80px;text-align: center;\">" + value + "</div>");
                }
                else
                {
                    return("<div style=\"width:80px;text-align: center;\">" + value + "</div>");
                }
            };


            table.dictColumnFormat["CASO"] = delegate(string value, ResultSet res) {
                if (value == "N")
                {                                                                                              //nuevo
                    return("<div style=\"width:80px; height: 40px; background-color:green;color:;\" ></div>"); //#fff
                    //  return "<div style=\"width:120px; background-color:red;color:;\" ></div>";
                }
                if (value == "A")
                {//Actualización
                    return("<div style=\"width:80px; height: 40px; background-color:yellow;color:;\" ></div>");
                }
                else
                {//Baja
                    return("<div style=\"width:80px; height: 40px; background-color:red;color:;\" ></div>");
                }
            };

            table.dictColumnFormat.Add("IDSIU", delegate(string value, ResultSet res)
            {
                if (res.Get("INDICADOR") == "1")
                {
                    return("<div style='width:200px;'>" + value + "&nbsp;<span style='color:#860000'>nomina</span>&nbsp;&nbsp;&nbsp;<span class='fa fa-check-circle'></span></div>");
                }
                else
                {
                    return("<div style=\"width:120px;\">" + value + "</div>");
                }
            });

            table.dictColumnFormat.Add("NOMBRE", delegate(string value, ResultSet res)
            {
                return("<div style=\"width:120px;\">" + value + "</div>");
            });



            table.CAMPOS       = campos;
            table.COLUMNAS     = columnas;
            table.CAMPOSSEARCH = campossearch;

            table.orderby  = orderby;
            table.sort     = sort;
            table.show     = show;
            table.pg       = pg;
            table.search   = search;
            table.field_id = "NRC";

            table.CAMPOSHIDDEN = camposhidden;

            // table.enabledCheckbox = true;
            table.enabledButtonControls = false;

            table.TABLECONDICIONSQL = "USUARIO =" + sesion.pkUser;
            return(table.CreateDataTable(sesion));
        }