コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Response.ContentType = "application/json;";
            Page.Response.Charset     = "utf-8";
            Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);


            if (Request.Params["tipo"] == "deleteAsesor")
            {
                int iduser = Convert.ToInt32(Request.Params["iduser"]);
                LogicaNegocio.Asesor      Asesor      = new LogicaNegocio.Asesor();
                LogicaNegocio.UserSchool  userSchool  = new LogicaNegocio.UserSchool();
                LogicaNegocio.UserTeacher userTeacher = new LogicaNegocio.UserTeacher();
                //Response.Write("{success:1}");
                if (Asesor.deleteAsesor(iduser))
                {
                    ModeloNegocio.Asesor AsesorMN = new ModeloNegocio.Asesor();
                    foreach (ModeloNegocio.School listSchool in AsesorMN.Schools)
                    {
                        userSchool.updateSelectSchoolForIduser(listSchool.id, 0);
                    }
                    // userSchool.updateSelectSchoolForIduser(iduser);
                    userSchool.deleteSchoolsForUserId(iduser);
                    userTeacher.deleteTeachersForUserId(iduser);
                    Response.Write("{success:1}");
                }
            }

            if (Request.Params["tipo"] == "deleteDocente")
            {
                int iduser = Convert.ToInt32(Request.Params["iduser"]);
                LogicaNegocio.Docente Docente = new LogicaNegocio.Docente();
                //Response.Write("{success:1}");
                if (Docente.deleteDocente(iduser))
                {
                    Response.Write("{success:1}");
                }
            }

            if (Request.Params["tipo"] == "deleteSchool")
            {
                int idSchool = Convert.ToInt32(Request.Params["idSchool"]);
                LogicaNegocio.School School = new LogicaNegocio.School();
                //Response.Write("{success:1}");
                if (School.deleteSchool(idSchool))
                {
                    Response.Write("{success:1}");
                }
            }


            if (Request.Params["tipo"] == "deleteMicrored")
            {
                int idMicrored = Convert.ToInt32(Request.Params["idmicrored"]);
                LogicaNegocio.Microred microred = new LogicaNegocio.Microred();
                //Response.Write("{success:1}");
                if (microred.deleteMicrored(idMicrored))
                {
                    Response.Write("{success:1}");
                }
            }


            if (Request.Params["tipo"] == "deleteAconpanaClase")
            {
                int idMicrored = Convert.ToInt32(Request.Params["idAconpanaClase"]);
                LogicaNegocio.AconpanaClase aconpanaClase = new LogicaNegocio.AconpanaClase();
                //Response.Write("{success:1}");
                if (aconpanaClase.deleteMicrored(idMicrored))
                {
                    Response.Write("{success:1}");
                }
            }

            if (Request.Params["tipo"] == "deleteVisitasIE")
            {
                int idVisita = Convert.ToInt32(Request.Params["idVisita"]);
                LogicaNegocio.VisitaIE visita = new LogicaNegocio.VisitaIE();
                //Response.Write("{success:1}");
                if (visita.deleteVisitaIE(idVisita))
                {
                    Response.Write("{success:1}");
                }
            }


            if (Request.Params["tipo"] == "allSchoolAsesor")
            {
                int idMicrored = Convert.ToInt32(Request.Params["idAconpanaClase"]);
                LogicaNegocio.UserSchool shool = new LogicaNegocio.UserSchool();
                //Response.Write("{success:1}");
                int idAsesor = Convert.ToInt32(Request.Params["idAsesor"]);



                List <ModeloNegocio.Docente> listUsuario = new List <ModeloNegocio.Docente>();



                //listUsuario = shool.getAllDocenteSchool(idSchool);
                //foreach (ModeloNegocio.Docente Docentes in listUsuario)
                //{
                //    Response.Write("{success:1}");
                //}

                var json = new JavaScriptSerializer().Serialize(shool.getAllSchoolForUser(idAsesor));
                Response.Write(json);
                //if (aconpanaClase.deleteMicrored(idMicrored))
                //{

                //    Response.Write("{success:1}");
                //}
            }

            if (Request.Params["tipo"] == "allDocenteSchool")
            {
                int idMicrored             = Convert.ToInt32(Request.Params["idAconpanaClase"]);
                LogicaNegocio.School shool = new LogicaNegocio.School();
                //Response.Write("{success:1}");
                int idSchool = Convert.ToInt32(Request.Params["idSchool"]);



                List <ModeloNegocio.Docente> listUsuario = new List <ModeloNegocio.Docente>();



                //listUsuario = shool.getAllDocenteSchool(idSchool);
                //foreach (ModeloNegocio.Docente Docentes in listUsuario)
                //{
                //    Response.Write("{success:1}");
                //}

                var json = new JavaScriptSerializer().Serialize(shool.getAllDocenteSchool(idSchool));
                Response.Write(json);
                //if (aconpanaClase.deleteMicrored(idMicrored))
                //{

                //    Response.Write("{success:1}");
                //}
            }

            if (Request.Params["tipo"] == "allGradeSectionForTeacher")
            {
                int idDocente = Convert.ToInt32(Request.Params["idDocente"]);
                List <ModeloNegocio.TeacherGrade> lista1       = new List <ModeloNegocio.TeacherGrade>();
                LogicaNegocio.TeacherGrade        teacherGrade = new LogicaNegocio.TeacherGrade();
                lista1 = teacherGrade.getAllTeacherGradeForUser(idDocente);
                var json = new JavaScriptSerializer().Serialize(lista1);
                Response.Write(json);
            }

            if (Request.Params["tipo"] == "allDirectorSchool")
            {
                int idMicrored             = Convert.ToInt32(Request.Params["idAconpanaClase"]);
                LogicaNegocio.School shool = new LogicaNegocio.School();

                int idSchool = Convert.ToInt32(Request.Params["idSchool"]);

                var json = new JavaScriptSerializer().Serialize(shool.getDirectorSchool(idSchool));
                Response.Write(json);
            }

            //Franco allTemForGrade
            if (Request.Params["tipo"] == "allTemForGrade")
            {
                LogicaNegocio.Tema tema = new LogicaNegocio.Tema();
                //Response.Write("{success:1}");
                string grade = Convert.ToString(Request.Params["grade"]);

                List <ModeloNegocio.Tema> listTemas = new List <ModeloNegocio.Tema>();
                var json = new JavaScriptSerializer().Serialize(tema.getAllTemaForGrade(grade));
                Response.Write(json);
            }

            if (Request.Params["tipo"] == "allNumSesionForTem")
            {
                LogicaNegocio.Sesion sesion = new LogicaNegocio.Sesion();
                //Response.Write("{success:1}");
                int tema_id = Convert.ToInt32(Request.Params["tema_id"]);
                var json    = new JavaScriptSerializer().Serialize(sesion.getAllSesionsForTem(tema_id));
                Response.Write(json);
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                aconpanaClaseMN = new ModeloNegocio.AconpanaClase();
                aconpanaClaseLN = new LogicaNegocio.AconpanaClase();
                int aconpana_id = Convert.ToInt32(Request.Params["aconpana_id"]);

                aconpanaClaseMN = aconpanaClaseLN.getAconpanaClaseId(aconpana_id);

                txtFecha.Text = aconpanaClaseMN.Fecha.ToString("yyyy-MM-dd");

                asesorLN       = new LogicaNegocio.Asesor();
                asesorMN       = new ModeloNegocio.Asesor();
                asesorMN       = asesorLN.getAsesorId(aconpanaClaseMN.Asesor_id);
                txtAsesor.Text = asesorMN.FullName;


                docenteLN       = new LogicaNegocio.Docente();
                docenteMN       = new ModeloNegocio.Docente();
                docenteMN       = docenteLN.getDocenteId(aconpanaClaseMN.Docente_id);
                txtDocente.Text = docenteMN.FullName;


                schoolLN = new LogicaNegocio.School();
                schoolMN = new ModeloNegocio.School();

                //schoolMN = schoolLN.getDocenteId(visitaMN.Docente_id);
                schoolMN = schoolLN.getSchool(aconpanaClaseMN.School_id);

                txtSchool.Text = schoolMN.Nombre.ToString();


                teacherGradeLN = new LogicaNegocio.TeacherGrade();
                teacherGradeMN = new ModeloNegocio.TeacherGrade();

                teacherGradeMN = teacherGradeLN.getTeacherGradeId(Convert.ToInt32(aconpanaClaseMN.Id_Grado_seccion));
                if (teacherGradeMN.Grade == null)
                {
                    teacherGradeMN.Grade = "";
                }
                if (teacherGradeMN.Seccion == null)
                {
                    teacherGradeMN.Seccion = "";
                }


                txtGradoSeccion.Text = "Grado: " + teacherGradeMN.Grade.ToString() + " Seccion: " + teacherGradeMN.Seccion.ToString();



                temaLN = new LogicaNegocio.Tema();
                temaMN = new ModeloNegocio.Tema();

                temaMN = temaLN.getTemaId(Convert.ToInt32(aconpanaClaseMN.Id_Tema_Nombre_sesion));

                txtNombSesion.Text = temaMN.Name;



                sesionLN = new LogicaNegocio.Sesion();
                sesionMN = new ModeloNegocio.Sesion();

                sesionMN = sesionLN.getSesionId(Convert.ToInt32(aconpanaClaseMN.Id_sesion));

                txtNumSesion.Text = sesionMN.NumSesion;


                txtEstidianteAsistentes.Text = aconpanaClaseMN.Num_estudiante.ToString();

                if (aconpanaClaseMN.Sesion_planificado == 0)
                {
                    txtSesionPlanificado.Text = "No";
                    txtMotivo.Text            = aconpanaClaseMN.Motivo;
                }
                else if (aconpanaClaseMN.Sesion_planificado == 1)
                {
                    txtSesionPlanificado.Text = "Si";
                }

                if (aconpanaClaseMN.Desarrollo_innovacion == 0)
                {
                    txtInnovacion.Text = "No";
                }
                else if (aconpanaClaseMN.Desarrollo_innovacion == 1)
                {
                    txtInnovacion.Text = "Si";
                }



                txtRecursosInformáticos.Text = aconpanaClaseMN.Recursos_informaticos;

                txtRecursosAudiovisuales.Text = aconpanaClaseMN.Recursos_audiovisuales;

                txtMaterialesDidactico.Text = aconpanaClaseMN.Materiales_didacticos;

                txtDinamicasUsadas.Text = aconpanaClaseMN.Dinamicas_utilizadas;

                TxtOtros.Text = aconpanaClaseMN.Otros;

                if (aconpanaClaseMN.Asesor_intervino == 0)
                {
                    txtIntervino.Text = "No";
                }
                else if (aconpanaClaseMN.Desarrollo_innovacion == 1)
                {
                    txtIntervino.Text = "Si";
                }

                txtComoIntervinoSesion.Text = aconpanaClaseMN.Como_intervino;

                if (aconpanaClaseMN.Intervencion_colaboradores == 0)
                {
                    txtOtrosColaboradores.Text = "No";
                }
                else if (aconpanaClaseMN.Intervencion_colaboradores == 1)
                {
                    txtOtrosColaboradores.Text = "Si";
                }

                txtQuien.Text = aconpanaClaseMN.Colaborador;

                txtComoIntervino.Text = aconpanaClaseMN.Como_intervino;


                if (aconpanaClaseMN.Participa_juego == 0)
                {
                    txtParticipaJuego.Text = "No";
                }
                else if (aconpanaClaseMN.Participa_juego == 1)
                {
                    txtParticipaJuego.Text = "Si";
                }


                txtEtapa.Text      = aconpanaClaseMN.Etapa;
                txtRazon.Text      = aconpanaClaseMN.Razon;
                txtIncidencia.Text = aconpanaClaseMN.Incidencia;

                //txtMotivoVisita.Text = visitaMN.MotivoVisita;

                //txtObservacion.Text = visitaMN.Observacion;
                //TxtPendientes.Text = visitaMN.Pendientes;
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Response.ContentType = "application/json;";
            Page.Response.Charset = "utf-8";
            Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);

            if (Request.Params["tipo"] == "deleteAsesor")
            {
                int iduser = Convert.ToInt32(Request.Params["iduser"]);
                LogicaNegocio.Asesor Asesor = new LogicaNegocio.Asesor();
                LogicaNegocio.UserSchool userSchool = new LogicaNegocio.UserSchool();
                LogicaNegocio.UserTeacher userTeacher = new LogicaNegocio.UserTeacher();
                //Response.Write("{success:1}");
                if (Asesor.deleteAsesor(iduser))
                {
                    ModeloNegocio.Asesor AsesorMN = new ModeloNegocio.Asesor();
                    foreach (ModeloNegocio.School listSchool in AsesorMN.Schools)
                    {
                        userSchool.updateSelectSchoolForIduser(listSchool.id, 0);
                    }
                   // userSchool.updateSelectSchoolForIduser(iduser);
                    userSchool.deleteSchoolsForUserId(iduser);
                    userTeacher.deleteTeachersForUserId(iduser);
                    Response.Write("{success:1}");
                }
            }

            if (Request.Params["tipo"] == "deleteDocente")
            {
                int iduser = Convert.ToInt32(Request.Params["iduser"]);
                LogicaNegocio.Docente Docente = new LogicaNegocio.Docente();
                //Response.Write("{success:1}");
                if (Docente.deleteDocente(iduser))
                {
                    Response.Write("{success:1}");

                }
            }

            if (Request.Params["tipo"] == "deleteSchool")
            {
                int idSchool = Convert.ToInt32(Request.Params["idSchool"]);
                LogicaNegocio.School School = new LogicaNegocio.School();
                //Response.Write("{success:1}");
                if (School.deleteSchool(idSchool))
                {
                    Response.Write("{success:1}");
                }
            }

            if (Request.Params["tipo"] == "deleteMicrored")
            {
                int idMicrored = Convert.ToInt32(Request.Params["idmicrored"]);
                LogicaNegocio.Microred microred = new LogicaNegocio.Microred();
                //Response.Write("{success:1}");
                if (microred.deleteMicrored(idMicrored))
                {
                    Response.Write("{success:1}");
                }
            }

            if (Request.Params["tipo"] == "deleteAconpanaClase")
            {
                int idMicrored = Convert.ToInt32(Request.Params["idAconpanaClase"]);
                LogicaNegocio.AconpanaClase aconpanaClase = new LogicaNegocio.AconpanaClase();
                //Response.Write("{success:1}");
                if (aconpanaClase.deleteMicrored(idMicrored))
                {
                    Response.Write("{success:1}");
                }
            }

            if (Request.Params["tipo"] == "deleteVisitasIE")
            {
                int idVisita = Convert.ToInt32(Request.Params["idVisita"]);
                LogicaNegocio.VisitaIE visita = new LogicaNegocio.VisitaIE();
                //Response.Write("{success:1}");
                if (visita.deleteVisitaIE(idVisita))
                {
                    Response.Write("{success:1}");
                }
            }

            if (Request.Params["tipo"] == "allSchoolAsesor")
            {
                int idMicrored = Convert.ToInt32(Request.Params["idAconpanaClase"]);
                LogicaNegocio.UserSchool shool = new LogicaNegocio.UserSchool();
                //Response.Write("{success:1}");
                int idAsesor = Convert.ToInt32(Request.Params["idAsesor"]);

                List<ModeloNegocio.Docente> listUsuario = new List<ModeloNegocio.Docente>();

                //listUsuario = shool.getAllDocenteSchool(idSchool);
                //foreach (ModeloNegocio.Docente Docentes in listUsuario)
                //{
                //    Response.Write("{success:1}");
                //}

                var json = new JavaScriptSerializer().Serialize(shool.getAllSchoolForUser(idAsesor));
                Response.Write(json);
                //if (aconpanaClase.deleteMicrored(idMicrored))
                //{

                //    Response.Write("{success:1}");
                //}
            }

            if (Request.Params["tipo"] == "allDocenteSchool")
            {
                int idMicrored = Convert.ToInt32(Request.Params["idAconpanaClase"]);
                LogicaNegocio.School shool = new LogicaNegocio.School();
                //Response.Write("{success:1}");
                int idSchool = Convert.ToInt32(Request.Params["idSchool"]);

                List<ModeloNegocio.Docente> listUsuario = new List<ModeloNegocio.Docente>();

                //listUsuario = shool.getAllDocenteSchool(idSchool);
                //foreach (ModeloNegocio.Docente Docentes in listUsuario)
                //{
                //    Response.Write("{success:1}");
                //}

                var json = new JavaScriptSerializer().Serialize(shool.getAllDocenteSchool(idSchool));
                Response.Write(json);
                //if (aconpanaClase.deleteMicrored(idMicrored))
                //{

                //    Response.Write("{success:1}");
                //}
            }

            if (Request.Params["tipo"] == "allGradeSectionForTeacher")
            {
                int idDocente = Convert.ToInt32(Request.Params["idDocente"]);
                List<ModeloNegocio.TeacherGrade> lista1 = new List<ModeloNegocio.TeacherGrade>();
                LogicaNegocio.TeacherGrade teacherGrade = new LogicaNegocio.TeacherGrade();
                lista1 = teacherGrade.getAllTeacherGradeForUser(idDocente);
                var json = new JavaScriptSerializer().Serialize(lista1);
                Response.Write(json);
            }

            if (Request.Params["tipo"] == "allDirectorSchool")
            {
                int idMicrored = Convert.ToInt32(Request.Params["idAconpanaClase"]);
                LogicaNegocio.School shool = new LogicaNegocio.School();

                int idSchool = Convert.ToInt32(Request.Params["idSchool"]);

                var json = new JavaScriptSerializer().Serialize(shool.getDirectorSchool(idSchool));
                Response.Write(json);

            }

            //Franco allTemForGrade
            if (Request.Params["tipo"] == "allTemForGrade")
            {
                LogicaNegocio.Tema tema = new LogicaNegocio.Tema();
                //Response.Write("{success:1}");
                string grade = Convert.ToString(Request.Params["grade"]);

                List<ModeloNegocio.Tema> listTemas = new List<ModeloNegocio.Tema>();
                var json = new JavaScriptSerializer().Serialize(tema.getAllTemaForGrade(grade));
                Response.Write(json);

            }

            if (Request.Params["tipo"] == "allNumSesionForTem")
            {
                LogicaNegocio.Sesion sesion = new LogicaNegocio.Sesion();
                //Response.Write("{success:1}");
                int tema_id = Convert.ToInt32(Request.Params["tema_id"]);
                var json = new JavaScriptSerializer().Serialize(sesion.getAllSesionsForTem(tema_id));
                Response.Write(json);

            }
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                aconpanaClaseMN = new ModeloNegocio.AconpanaClase();
                aconpanaClaseLN = new LogicaNegocio.AconpanaClase();
                int aconpana_id = Convert.ToInt32(Request.Params["aconpana_id"]);

                aconpanaClaseMN = aconpanaClaseLN.getAconpanaClaseId(aconpana_id);

                txtFecha.Text = aconpanaClaseMN.Fecha.ToString("yyyy-MM-dd");

                asesorLN = new LogicaNegocio.Asesor();
                asesorMN = new ModeloNegocio.Asesor();
                asesorMN = asesorLN.getAsesorId(aconpanaClaseMN.Asesor_id);
                txtAsesor.Text = asesorMN.FullName;

                docenteLN = new LogicaNegocio.Docente();
                docenteMN = new ModeloNegocio.Docente();
                docenteMN = docenteLN.getDocenteId(aconpanaClaseMN.Docente_id);
                txtDocente.Text = docenteMN.FullName;

                schoolLN = new LogicaNegocio.School();
                schoolMN = new ModeloNegocio.School();

                //schoolMN = schoolLN.getDocenteId(visitaMN.Docente_id);
                schoolMN = schoolLN.getSchool(aconpanaClaseMN.School_id);

                txtSchool.Text = schoolMN.Nombre.ToString();

                teacherGradeLN = new LogicaNegocio.TeacherGrade();
                teacherGradeMN = new ModeloNegocio.TeacherGrade();

                teacherGradeMN = teacherGradeLN.getTeacherGradeId(Convert.ToInt32(aconpanaClaseMN.Id_Grado_seccion));
                if (teacherGradeMN.Grade == null)
                    teacherGradeMN.Grade = "";
                if (teacherGradeMN.Seccion == null)
                    teacherGradeMN.Seccion = "";

                txtGradoSeccion.Text = "Grado: " +  teacherGradeMN.Grade.ToString() + " Seccion: " + teacherGradeMN.Seccion.ToString();

                temaLN = new LogicaNegocio.Tema();
                temaMN = new ModeloNegocio.Tema();

                temaMN = temaLN.getTemaId(Convert.ToInt32(aconpanaClaseMN.Id_Tema_Nombre_sesion));

                txtNombSesion.Text = temaMN.Name;

                sesionLN = new LogicaNegocio.Sesion();
                sesionMN = new ModeloNegocio.Sesion();

                sesionMN = sesionLN.getSesionId(Convert.ToInt32(aconpanaClaseMN.Id_sesion));

                txtNumSesion.Text = sesionMN.NumSesion;

                txtEstidianteAsistentes.Text = aconpanaClaseMN.Num_estudiante.ToString();

                if(aconpanaClaseMN.Sesion_planificado == 0) {
                    txtSesionPlanificado.Text = "No";
                    txtMotivo.Text = aconpanaClaseMN.Motivo;
                } else if(aconpanaClaseMN.Sesion_planificado == 1) {
                     txtSesionPlanificado.Text = "Si";
                }

                if (aconpanaClaseMN.Desarrollo_innovacion == 0)
                {
                    txtInnovacion.Text = "No";
                }
                else if (aconpanaClaseMN.Desarrollo_innovacion == 1)
                {
                    txtInnovacion.Text = "Si";
                }

                txtRecursosInformáticos.Text = aconpanaClaseMN.Recursos_informaticos;

                txtRecursosAudiovisuales.Text = aconpanaClaseMN.Recursos_audiovisuales;

                txtMaterialesDidactico.Text = aconpanaClaseMN.Materiales_didacticos;

                txtDinamicasUsadas.Text = aconpanaClaseMN.Dinamicas_utilizadas;

                TxtOtros.Text = aconpanaClaseMN.Otros;

                if (aconpanaClaseMN.Asesor_intervino == 0)
                {
                    txtIntervino.Text = "No";
                }
                else if (aconpanaClaseMN.Desarrollo_innovacion == 1)
                {
                    txtIntervino.Text = "Si";
                }

                txtComoIntervinoSesion.Text = aconpanaClaseMN.Como_intervino;

                if (aconpanaClaseMN.Intervencion_colaboradores == 0)
                {
                    txtOtrosColaboradores.Text = "No";
                }
                else if (aconpanaClaseMN.Intervencion_colaboradores == 1)
                {
                    txtOtrosColaboradores.Text = "Si";
                }

                txtQuien.Text = aconpanaClaseMN.Colaborador;

                txtComoIntervino.Text = aconpanaClaseMN.Como_intervino;

                if (aconpanaClaseMN.Participa_juego == 0)
                {
                    txtParticipaJuego.Text = "No";
                }
                else if (aconpanaClaseMN.Participa_juego == 1)
                {
                    txtParticipaJuego.Text = "Si";
                }

                txtEtapa.Text = aconpanaClaseMN.Etapa;
                txtRazon.Text = aconpanaClaseMN.Razon;
                txtIncidencia.Text = aconpanaClaseMN.Incidencia;

                //txtMotivoVisita.Text = visitaMN.MotivoVisita;

                //txtObservacion.Text = visitaMN.Observacion;
                //TxtPendientes.Text = visitaMN.Pendientes;

            }
        }