Exemplo n.º 1
0
        public List <ModeloNegocio.TeacherGrade> getAllTeacherGradeForUser(int iduser)
        {
            List <ModeloNegocio.TeacherGrade> lista = new List <ModeloNegocio.TeacherGrade>();

            AccesoDatos.TeacherGrade teacherGradeAD = new AccesoDatos.TeacherGrade();
            TeachersGrades = teacherGradeAD.getAllTeacherGradeForIdUser(iduser);

            foreach (DataRow fila in TeachersGrades.Rows)
            {
                ModeloNegocio.TeacherGrade teacherGradeMN = new ModeloNegocio.TeacherGrade();
                teacherGradeMN.Id      = int.Parse(fila["id"].ToString());
                teacherGradeMN.Grade   = fila["grade"].ToString();
                teacherGradeMN.Seccion = fila["seccion"].ToString();


                if (DBNull.Value.Equals(fila["num_alumnos"]))
                {
                    teacherGradeMN.Num_alumnos = 0;
                }
                else
                {
                    teacherGradeMN.Num_alumnos = Convert.ToInt32(fila["num_alumnos"]);
                }

                lista.Add(teacherGradeMN);
            }
            return(lista);
        }
Exemplo n.º 2
0
        public List<ModeloNegocio.TeacherGrade> getAllTeacherGradeForUser(int iduser)
        {
            List<ModeloNegocio.TeacherGrade> lista = new List<ModeloNegocio.TeacherGrade>();
            AccesoDatos.TeacherGrade teacherGradeAD = new AccesoDatos.TeacherGrade();
            TeachersGrades = teacherGradeAD.getAllTeacherGradeForIdUser(iduser);

            foreach (DataRow fila in TeachersGrades.Rows)
            {
                ModeloNegocio.TeacherGrade teacherGradeMN = new ModeloNegocio.TeacherGrade();
                teacherGradeMN.Id = int.Parse(fila["id"].ToString());
                teacherGradeMN.Grade = fila["grade"].ToString();
                teacherGradeMN.Seccion = fila["seccion"].ToString();

                if (DBNull.Value.Equals(fila["num_alumnos"]))
                {
                    teacherGradeMN.Num_alumnos = 0;
                }
                else
                {

                    teacherGradeMN.Num_alumnos = Convert.ToInt32(fila["num_alumnos"]);
                }

                lista.Add(teacherGradeMN);
            }
            return lista;
        }
Exemplo n.º 3
0
        public List <ModeloNegocio.TeacherGrade> getAllTeacherGradeSeccionForIdUser(int iduser)
        {
            List <ModeloNegocio.TeacherGrade> lista = new List <ModeloNegocio.TeacherGrade>();

            Cmd            = new SqlCommand();
            Cmd.Connection = Conn;
            try
            {
                Cmd.CommandType = CommandType.StoredProcedure;
                Cmd.CommandText = "PA_GET_TEACHER_GRADE_FOR_USER_ID";
                Cmd.Parameters.Add("@iduser", SqlDbType.Int).Value = iduser;
                Dtr = Cmd.ExecuteReader();

                while (Dtr.Read())
                {
                    ModeloNegocio.TeacherGrade users = new ModeloNegocio.TeacherGrade();
                    users.Id      = Convert.ToInt32(Dtr["id"]);
                    users.Grade   = Dtr["grade"].ToString();
                    users.Seccion = Dtr["seccion"].ToString();
                    //users.Type = Dtr["type"].ToString();
                    users.Num_alumnos = Convert.ToInt32(Dtr["num_alumnos"]);
                    lista.Add(users);
                }
                Conn.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine("{0} Exception caught.", e);
            }
            return(lista);
        }
Exemplo n.º 4
0
        public int insertTeacherGrade(ModeloNegocio.TeacherGrade ObjTeacherGrade)
        {
            try
            {
                Cmd            = new SqlCommand();
                Cmd.Connection = Conn;
                Cmd.Parameters.Clear();
                Cmd.CommandType = CommandType.StoredProcedure;
                Cmd.CommandText = "PA_ING_TEACHER_GRADE";
                Cmd.Parameters.Add("@user_teacher_id", SqlDbType.Int).Value = ObjTeacherGrade.UserTeacheId;
                Cmd.Parameters.Add("@grade", SqlDbType.VarChar).Value       = ObjTeacherGrade.Grade;
                Cmd.Parameters.Add("@seccion", SqlDbType.VarChar).Value     = ObjTeacherGrade.Seccion;
                Cmd.Parameters.Add("@num_alumnos", SqlDbType.VarChar).Value = ObjTeacherGrade.Num_alumnos;


                Cmd.Parameters.Add("@id", SqlDbType.Int).Direction = ParameterDirection.Output;

                Cmd.ExecuteNonQuery();

                ObjTeacherGrade.Id = Convert.ToInt32(Cmd.Parameters["@id"].Value);

                Conn.Close();
                return(ObjTeacherGrade.Id);
            }
            catch (Exception e)
            {
                // Console.WriteLine("{0} Problem insert.", e);
                //throw new Exception("Error en Acceso a Datos: InsertarMonto.", e);
                return(0);
            }
            //throw new NotImplementedException();
        }
Exemplo n.º 5
0
        protected void cmdGuardar_Click(object sender, EventArgs e)
        {
            ObjDocenteMN = new ModeloNegocio.Docente();
            ObjDocenteLN = new LogicaNegocio.Docente();

            ObjDocenteMN.Codigo       = txtCodigo.Text;
            ObjDocenteMN.FullName     = txtNombreApellido.Text;
            ObjDocenteMN.Email        = txtCorreo.Text;
            ObjDocenteMN.Type         = 4;
            ObjDocenteMN.Telefono     = txtTelefono.Text;
            ObjDocenteMN.TypeContract = Convert.ToString(ddlContrato.SelectedItem);

            ObjDocenteMN.School_id = ObjDocenteLN.insertDocente(ObjDocenteMN);

            ObjUserSchoolMN = new ModeloNegocio.UserSchool();
            ObjUserSchoolLN = new LogicaNegocio.UserSchool();

            ObjUserSchoolMN.UserAsesorId = ObjDocenteMN.School_id;
            ObjUserSchoolMN.UserSchoolId = Convert.ToInt32(ddlEscuela.SelectedValue);

            ObjUserSchoolLN.insertUserSchool(ObjUserSchoolMN);

            //foreach (ListItem item in lblGradosaCargo.Items)
            //{
            //    if (item.Selected == true)
            //    {
            //        ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
            //        ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();

            //        ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
            //        ObjTeacherGradeMN.Grade= item.Text;
            //        ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);

            //    }

            //}


            if (chk1.Checked == true)
            {
                if (chk1A.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1A.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1A.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk1B.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1B.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1B.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1C.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1C.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1C.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1D.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1D.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1D.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1E.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1E.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1E.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1F.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1F.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1F.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1G.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1G.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1G.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1H.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1H.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1H.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1I.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1I.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1I.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1J.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1J.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1J.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk1K.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1K.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1K.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk1L.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk1.Text;
                    ObjTeacherGradeMN.Seccion      = chk1L.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt1L.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
            }


            if (chk2.Checked == true)
            {
                if (chk2A.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2A.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2A.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk2B.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2B.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2B.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2C.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2C.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2C.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2D.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2D.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2D.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2E.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2E.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2E.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2F.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2F.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2F.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2G.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2G.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2G.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2H.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2H.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2H.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2I.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2I.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2I.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2J.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2J.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2J.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk2K.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2K.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2K.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk2L.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk2.Text;
                    ObjTeacherGradeMN.Seccion      = chk2L.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt2L.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
            }

            if (chk3.Checked == true)
            {
                if (chk3A.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3A.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3A.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk3B.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3B.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3B.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3C.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3C.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3C.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3D.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3D.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3D.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3E.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3E.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3E.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3F.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3F.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3F.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3G.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3G.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3G.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3H.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3H.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3H.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3I.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3I.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3I.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3J.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3J.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3J.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk3K.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3K.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3K.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk3L.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk3.Text;
                    ObjTeacherGradeMN.Seccion      = chk3L.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt3L.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
            }


            if (chk4.Checked == true)
            {
                if (chk4A.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4A.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4A.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk4B.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4B.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4B.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4C.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4C.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4C.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4D.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4D.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4D.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4E.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4E.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4E.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4F.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4F.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4F.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4G.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4G.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4G.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4H.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4H.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4H.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4I.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4I.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4I.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4J.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4J.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4J.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk4K.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4K.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4K.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk4L.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk4.Text;
                    ObjTeacherGradeMN.Seccion      = chk4L.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt4L.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
            }


            if (chk5.Checked == true)
            {
                if (chk5A.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5A.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5A.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk5B.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5B.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5B.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5C.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5C.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5C.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5D.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5D.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5D.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5E.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5E.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5E.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5F.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5F.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5F.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5G.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5G.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5G.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5H.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5H.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5H.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5I.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5I.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5I.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5J.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5J.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5J.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk5K.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5K.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5K.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk5L.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherGradeMN.Grade        = chk5.Text;
                    ObjTeacherGradeMN.Seccion      = chk5L.Text;
                    ObjTeacherGradeMN.Num_alumnos  = Convert.ToInt32(txt5L.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
            }

            foreach (ListItem item in lblCursos.Items)
            {
                if (item.Selected == true)
                {
                    ObjTeacherCourseMN = new ModeloNegocio.TeacherCourse();
                    ObjTeacherCourseLN = new LogicaNegocio.TeacherCourse();

                    ObjTeacherCourseMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherCourseMN.Course       = item.Text;

                    ObjTeacherCourseLN.insertTeacherCourse(ObjTeacherCourseMN);
                }
            }

            foreach (ListItem item in lblTurnos.Items)
            {
                if (item.Selected == true)
                {
                    ObjTeacherTurnMN = new ModeloNegocio.TeacherTurn();
                    ObjTeacherTurnLN = new LogicaNegocio.TeacherTurn();

                    ObjTeacherTurnMN.UserTeacheId = ObjDocenteMN.School_id;
                    ObjTeacherTurnMN.Turn         = item.Text;

                    ObjTeacherTurnLN.insertTeacherTurn(ObjTeacherTurnMN);
                }
            }

            string strRedirect;

            strRedirect = "Admin-ListDocente.aspx?id=2";
            Response.Redirect(strRedirect, true);
        }
Exemplo n.º 6
0
        public List<ModeloNegocio.TeacherGrade> getAllTeacherGradeSeccionForIdUser(int iduser)
        {
            List<ModeloNegocio.TeacherGrade> lista = new List<ModeloNegocio.TeacherGrade>();
            Cmd = new SqlCommand();
            Cmd.Connection = Conn;
            try
            {
                Cmd.CommandType = CommandType.StoredProcedure;
                Cmd.CommandText = "PA_GET_TEACHER_GRADE_FOR_USER_ID";
                Cmd.Parameters.Add("@iduser", SqlDbType.Int).Value = iduser;
                Dtr = Cmd.ExecuteReader();

                while (Dtr.Read())
                {
                    ModeloNegocio.TeacherGrade users = new ModeloNegocio.TeacherGrade();
                    users.Id = Convert.ToInt32(Dtr["id"]);
                    users.Grade = Dtr["grade"].ToString();
                    users.Seccion = Dtr["seccion"].ToString();
                    //users.Type = Dtr["type"].ToString();
                    users.Num_alumnos = Convert.ToInt32(Dtr["num_alumnos"]);
                    lista.Add(users);
                }
                Conn.Close();

            }
            catch (Exception e)
            {
                Console.WriteLine("{0} Exception caught.", e);
            }
            return lista;
        }
Exemplo n.º 7
0
        public ModeloNegocio.TeacherGrade getTeacherGradeId(int TeacherGrade_id)
        {
            Cmd = new SqlCommand();
            Cmd.Connection = Conn;
            ModeloNegocio.TeacherGrade teacherGrade = new ModeloNegocio.TeacherGrade();
            try
            {

                Cmd.CommandType = CommandType.StoredProcedure;
                Cmd.CommandText = "PA_GET_TEACHER_GRADE_ID";
                Cmd.Parameters.Add("@teacher_grade_id", SqlDbType.Int).Value = TeacherGrade_id;

                Dtr = Cmd.ExecuteReader();

                while (Dtr.Read())
                {

                    teacherGrade.Id = Convert.ToInt32(Dtr["id"]);
                    if (DBNull.Value.Equals(Dtr["grade"]))
                        teacherGrade.Grade = "";
                    else
                        teacherGrade.Grade =  Dtr["grade"].ToString();

                    if (DBNull.Value.Equals(Dtr["num_alumnos"])) teacherGrade.Num_alumnos = 0 ; else teacherGrade.Num_alumnos = Convert.ToInt32(Dtr["num_alumnos"]);
                    if (DBNull.Value.Equals(Dtr["seccion"])) teacherGrade.Seccion = "";
                    else teacherGrade.Seccion = Dtr["seccion"].ToString();
                    teacherGrade.UserTeacheId =Convert.ToInt32(Dtr["user_teacher_id"].ToString());
                    if (DBNull.Value.Equals(Dtr["created_at"])) teacherGrade.Created_at = DateTime.Now; else teacherGrade.Created_at = DateTime.Parse(Dtr["created_at"].ToString());
                    if (DBNull.Value.Equals(Dtr["updated_at"])) teacherGrade.Updated_at = DateTime.Now; else teacherGrade.Updated_at = DateTime.Parse(Dtr["updated_at"].ToString());

                }
                Conn.Close();

                return teacherGrade;
            }
            catch (Exception e)
            {
                Console.WriteLine("{0} Exception caught.", e);
                return teacherGrade;
            }
        }
Exemplo n.º 8
0
 public int insertTeacherGrade(ModeloNegocio.TeacherGrade ObjTeacherGrade)
 {
     AccesoDatos.TeacherGrade TeacherGrade = new AccesoDatos.TeacherGrade();
     return(TeacherGrade.insertTeacherGrade(ObjTeacherGrade));
 }
Exemplo n.º 9
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;
            }
        }
        protected void cmdGuardar_Click(object sender, EventArgs e)
        {
            ModeloNegocio.Docente ObjDocenteMN;
            LogicaNegocio.Docente ObjDocenteLN;

            ObjDocenteMN = new ModeloNegocio.Docente();
            ObjDocenteLN = new LogicaNegocio.Docente();

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

            ObjDocenteMN.id = idDocente;
            ObjDocenteMN.Codigo = txtCodigo.Text;
            ObjDocenteMN.FullName = txtNombreApellido.Text;
            ObjDocenteMN.Email = txtCorreo.Text;
            ObjDocenteMN.Type = 4;
            ObjDocenteMN.Telefono = txtTelefono.Text;
            ObjDocenteMN.TypeContract = Convert.ToString(ddlContrato.SelectedItem);
            //ObjDocenteMN.School_id = Convert.ToInt32(ddlEscuela.Text);

            ObjDocenteLN.updateDocente(ObjDocenteMN);

            ObjUserSchoolMN = new ModeloNegocio.UserSchool();
            ObjUserSchoolLN = new LogicaNegocio.UserSchool();

            //Eliminamos los datos de Uuser_school
            ObjUserSchoolLN.deleteSchoolsForUserId(idDocente);

            ObjUserSchoolMN.UserAsesorId = idDocente;
            ObjUserSchoolMN.UserSchoolId = Convert.ToInt32(ddlEscuela.SelectedValue);

            ObjUserSchoolLN.insertUserSchool(ObjUserSchoolMN);

            ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
            ObjTeacherGradeLN.deleteTeacherGrade(idDocente) ;

            ObjTeacherCourseLN = new LogicaNegocio.TeacherCourse();
            ObjTeacherCourseLN.deleteTeacherCourse(idDocente);

            ObjTeacherTurnLN = new LogicaNegocio.TeacherTurn();
            ObjTeacherTurnLN.deleteTeacherTurns(idDocente);

            //foreach (ListItem item in lblGradosaCargo.Items)
            //{
            //    if (item.Selected == true)
            //    {
            //        ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
            //        ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();

            //        ObjTeacherGradeMN.UserTeacheId = idDocente;
            //        ObjTeacherGradeMN.Grade= item.Text;

            //        ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);

            //    }

            //}

            if (chk1.Checked == true)
            {

                if (chk1A.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1A.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1A.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk1B.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1B.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1B.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1C.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1C.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1C.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1D.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1D.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1D.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1E.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1E.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1E.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1F.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1F.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1F.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1G.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1G.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1G.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1H.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1H.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1H.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1I.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1I.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1I.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk1J.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1J.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1J.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk1K.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1K.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1K.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk1L.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk1.Text;
                    ObjTeacherGradeMN.Seccion = chk1L.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt1L.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
            }

            if (chk2.Checked == true)
            {

                if (chk2A.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2A.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2A.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk2B.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2B.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2B.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2C.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2C.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2C.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2D.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2D.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2D.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2E.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2E.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2E.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2F.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2F.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2F.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2G.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2G.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2G.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2H.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2H.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2H.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2I.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2I.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2I.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk2J.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2J.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2J.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk2K.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2K.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2K.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk2L.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk2.Text;
                    ObjTeacherGradeMN.Seccion = chk2L.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt2L.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
            }

            if (chk3.Checked == true)
            {

                if (chk3A.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3A.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3A.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk3B.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3B.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3B.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3C.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3C.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3C.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3D.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3D.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3D.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3E.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3E.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3E.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3F.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3F.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3F.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3G.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3G.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3G.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3H.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3H.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3H.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3I.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3I.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3I.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk3J.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3J.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3J.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk3K.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3K.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3K.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk3L.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk3.Text;
                    ObjTeacherGradeMN.Seccion = chk3L.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt3L.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
            }

            if (chk4.Checked == true)
            {

                if (chk4A.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4A.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4A.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk4B.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4B.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4B.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4C.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4C.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4C.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4D.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4D.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4D.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4E.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4E.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4E.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4F.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4F.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4F.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4G.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4G.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4G.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4H.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4H.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4H.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4I.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4I.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4I.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk4J.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4J.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4J.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk4K.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4K.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4K.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk4L.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk4.Text;
                    ObjTeacherGradeMN.Seccion = chk4L.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt4L.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
            }

            if (chk5.Checked == true)
            {

                if (chk5A.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5A.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5A.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk5B.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5B.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5B.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5C.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5C.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5C.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5D.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5D.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5D.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5E.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5E.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5E.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5F.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5F.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5F.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5G.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5G.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5G.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5H.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5H.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5H.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5I.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5I.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5I.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
                if (chk5J.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5J.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5J.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk5K.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5K.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5K.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }

                if (chk5L.Checked == true)
                {
                    ObjTeacherGradeMN = new ModeloNegocio.TeacherGrade();
                    ObjTeacherGradeLN = new LogicaNegocio.TeacherGrade();
                    ObjTeacherGradeMN.UserTeacheId = idDocente;
                    ObjTeacherGradeMN.Grade = chk5.Text;
                    ObjTeacherGradeMN.Seccion = chk5L.Text;
                    ObjTeacherGradeMN.Num_alumnos = Convert.ToInt32(txt5L.Text);
                    ObjTeacherGradeLN.insertTeacherGrade(ObjTeacherGradeMN);
                }
            }

            foreach (ListItem item in lblCursos.Items)
            {
                if (item.Selected == true)
                {
                    ObjTeacherCourseMN = new ModeloNegocio.TeacherCourse();
                    ObjTeacherCourseLN = new LogicaNegocio.TeacherCourse();

                    ObjTeacherCourseMN.UserTeacheId = idDocente;
                    ObjTeacherCourseMN.Course = item.Text;

                    ObjTeacherCourseLN.insertTeacherCourse(ObjTeacherCourseMN);

                }

            }

            foreach (ListItem item in lblTurnos.Items)
            {
                if (item.Selected == true)
                {
                    ObjTeacherTurnMN = new ModeloNegocio.TeacherTurn();
                    ObjTeacherTurnLN = new LogicaNegocio.TeacherTurn();

                    ObjTeacherTurnMN.UserTeacheId = idDocente;
                    ObjTeacherTurnMN.Turn = item.Text;

                    ObjTeacherTurnLN.insertTeacherTurn(ObjTeacherTurnMN);

                }

            }

            string strRedirect;
            strRedirect = "Admin-ListDocente.aspx?id=1";
            Response.Redirect(strRedirect, true);
        }
        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;

            }
        }
Exemplo n.º 12
0
        public ModeloNegocio.TeacherGrade getTeacherGradeId(int TeacherGrade_id)
        {
            Cmd            = new SqlCommand();
            Cmd.Connection = Conn;
            ModeloNegocio.TeacherGrade teacherGrade = new ModeloNegocio.TeacherGrade();
            try
            {
                Cmd.CommandType = CommandType.StoredProcedure;
                Cmd.CommandText = "PA_GET_TEACHER_GRADE_ID";
                Cmd.Parameters.Add("@teacher_grade_id", SqlDbType.Int).Value = TeacherGrade_id;

                Dtr = Cmd.ExecuteReader();

                while (Dtr.Read())
                {
                    teacherGrade.Id = Convert.ToInt32(Dtr["id"]);
                    if (DBNull.Value.Equals(Dtr["grade"]))
                    {
                        teacherGrade.Grade = "";
                    }
                    else
                    {
                        teacherGrade.Grade = Dtr["grade"].ToString();
                    }

                    if (DBNull.Value.Equals(Dtr["num_alumnos"]))
                    {
                        teacherGrade.Num_alumnos = 0;
                    }
                    else
                    {
                        teacherGrade.Num_alumnos = Convert.ToInt32(Dtr["num_alumnos"]);
                    }
                    if (DBNull.Value.Equals(Dtr["seccion"]))
                    {
                        teacherGrade.Seccion = "";
                    }
                    else
                    {
                        teacherGrade.Seccion = Dtr["seccion"].ToString();
                    }
                    teacherGrade.UserTeacheId = Convert.ToInt32(Dtr["user_teacher_id"].ToString());
                    if (DBNull.Value.Equals(Dtr["created_at"]))
                    {
                        teacherGrade.Created_at = DateTime.Now;
                    }
                    else
                    {
                        teacherGrade.Created_at = DateTime.Parse(Dtr["created_at"].ToString());
                    }
                    if (DBNull.Value.Equals(Dtr["updated_at"]))
                    {
                        teacherGrade.Updated_at = DateTime.Now;
                    }
                    else
                    {
                        teacherGrade.Updated_at = DateTime.Parse(Dtr["updated_at"].ToString());
                    }
                }
                Conn.Close();

                return(teacherGrade);
            }
            catch (Exception e)
            {
                Console.WriteLine("{0} Exception caught.", e);
                return(teacherGrade);
            }
        }