protected void Page_Load(object sender, EventArgs e) { CatedraticoLN catedraticoLN = new CatedraticoLN(); if (Session["USER_ID"] != null) { if (Session["ID_ASG"] != null) { if (Session["ID_CURSO"] != null) { if (Session["NOMBRE_CURSO"] != null) { if (Session["ID_GROUP"] != null) { int id = Convert.ToInt32(Session["ID_ASG"].ToString()); catedraticoLN.gridEventoCatedratico(GridEventos, id); } } } } } else { Response.Redirect("Login.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { catedraticoEN = new CatedraticoEN(); catedraticoLN = new CatedraticoLN(); catedraticoEN.Usuario = txtUsuario.Text; catedraticoEN.Password = txtPassword.Text; if (catedraticoLN.Verificar_Catedratico(catedraticoEN) != 0) { catedraticoEN.IdCatedratico = catedraticoLN.Verificar_Catedratico(catedraticoEN); int id = catedraticoEN.IdCatedratico; Session["USER_ID"] = id; Session["USER_NAME"] = txtUsuario.Text; Session["USER_PASS"] = txtPassword.Text; string mensaje = "Ingreso Exitoso"; ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "alert('" + mensaje + "');", true); Response.Redirect("AsignacionesCatedratico.aspx"); } else { Mensaje.Text = "Usuario o password Incorrecta"; txtPassword.Text = String.Empty; txtUsuario.Text = String.Empty; } }
protected void btnAgregar_Click(object sender, EventArgs e) { if (btnAgregar1.Text == "Agregar") { CatedraticoEN catedraticoEN = new CatedraticoEN(); CatedraticoLN catedraticoLN = new CatedraticoLN(); catedraticoEN.Nombres = txtNombres.Text; catedraticoEN.Apellidos = txtApellidos.Text; catedraticoEN.Email = txtEmail.Text; catedraticoEN.Usuario = txtUsuario.Text; catedraticoEN.Password = txtPassword.Text; if (catedraticoLN.crearCatedratico(catedraticoEN) == 1) { string mensaje = "Ingreso Exitoso"; catedraticoLN.gridCatedratico(GridCatedratico); txtNombres.Text = String.Empty; txtApellidos.Text = String.Empty; txtEmail.Text = String.Empty; txtUsuario.Text = String.Empty; txtPassword.Text = String.Empty; ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "alert('" + mensaje + "');", true); ScriptManager.RegisterClientScriptBlock(this, typeof(System.Web.UI.Page), "cerrarModal", "cerrarModal();", true); } } else { CatedraticoEN catedraticoEN = new CatedraticoEN(); CatedraticoLN catedraticoLN = new CatedraticoLN(); catedraticoEN.IdCatedratico = Convert.ToInt32(txtIdCatedratico.Text); catedraticoEN.Nombres = txtNombres.Text; catedraticoEN.Apellidos = txtApellidos.Text; catedraticoEN.Email = txtEmail.Text; catedraticoEN.Usuario = txtUsuario.Text; catedraticoEN.Password = txtPassword.Text; if (catedraticoLN.actualizarCatedratico(catedraticoEN) == 1) { string mensaje = "Modificación Exitosa"; catedraticoLN.gridCatedratico(GridCatedratico); txtNombres.Text = String.Empty; txtApellidos.Text = String.Empty; txtEmail.Text = String.Empty; txtUsuario.Text = String.Empty; txtPassword.Text = String.Empty; ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "alert('" + mensaje + "');", true); ScriptManager.RegisterClientScriptBlock(this, typeof(System.Web.UI.Page), "cerrarModal", "cerrarModal();", true); } } }
protected void EliminarCatedratico(object sender, GridViewDeleteEventArgs e) { CatedraticoLN catedraticoLN = new CatedraticoLN(); CatedraticoEN catedraticoEN = new CatedraticoEN(); catedraticoEN.idCatedratico = Convert.ToInt32(GridCatedratico.Rows[e.RowIndex].Cells[2].Text); if (catedraticoLN.eliminarCatedratico(catedraticoEN.IdCatedratico) == 1) { string mensaje = "Eliminacion Exitosa"; catedraticoLN.gridCatedratico(GridCatedratico); ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "alert('" + mensaje + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { CatedraticoLN catedraticoLN = new CatedraticoLN(); if (Session["USER_ID"] != null) { int id = Convert.ToInt32(Session["USER_ID"].ToString()); catedraticoLN.gridAsignacionCatedratico(GridCatedratico, id); string nombreCatedratico = catedraticoLN.Nombre_Catedratico(Session["USER_NAME"].ToString(), Session["USER_PASS"].ToString()); Session["NOMBRE_CATEDRATICO"] = nombreCatedratico; } else { Response.Redirect("Login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { CatedraticoLN catedraticoLN = new CatedraticoLN(); catedraticoLN.gridCatedratico(GridCatedratico); }