protected void btnaceptar_Click(object sender, EventArgs e) { var carrera = ddlMateria.SelectedValue; DateTime fechact = DateTime.Now; TblNota nota = new TblNota(); nota.strTitulo = txtTitulo.Text.ToUpper(); nota.strDescripcion = txtDescripcion.Text.ToUpper(); nota.fecha = fechact; nota.idMateria = int.Parse(carrera); nota.idProfesor = int.Parse(lbProfe.Text); ControllerMaestro ctrlGrupo = new ControllerMaestro(); ctrlGrupo.InsertarNota(nota); this.Response.Redirect("./NotaInfo.aspx", true); }
protected void btnAceptarAgregar_Click(object sender, EventArgs e) { var sex = cmbSexo.SelectedItem.Value; if (FotoMaestro.HasFile) { string path = Server.MapPath("~/images/ProfeRegistrado/" + FotoMaestro.FileName); FotoMaestro.SaveAs(path); TblProfesor prof = new TblProfesor(); prof.strNombre = txtNombreAgregar.Text.ToUpper(); prof.strApellidoP = txtPaternoAgregar.Text.ToUpper(); prof.strApellidoM = txtMaternoAgregar.Text.ToUpper(); prof.intEdad = Int32.Parse(txtEdadAgregar.Text); prof.strSexo = sex; prof.strCorreo = txtCorreoAgregar.Text; prof.strCedula = txtCedulaAgregar.Text; prof.strEspecialidad = txtEspecialidadAgregar.Text.ToUpper(); prof.bitFoto = path; ControllerMaestro ctrlProfe = new ControllerMaestro(); ctrlProfe.InsertarProfe(GetDatosVista(prof)); } this.Response.Redirect("./Maestrosadmin.aspx", true); }
protected void BtnEditar_Click(object sender, EventArgs e) { TblProfesor prof = new TblProfesor(); prof.id = Convert.ToInt32(Session["id"]); if (TxtCorreo.Text.Length > 1) { prof.strCorreo = TxtCorreo.Text; } else { prof.strCorreo = lbcorreo.Text; } TblTelefono tel = new TblTelefono(); tel.id = Convert.ToInt32(Session["forTel"]); if (TxtCelular.Text.Length > 1) { tel.strcelular = TxtCelular.Text; } else { tel.strcelular = lbCelular.Text; } if (TxtTelefono.Text.Length > 1) { tel.strtelCasa = TxtTelefono.Text; } else { tel.strtelCasa = lbTelefono.Text; } if (TxtOtro.Text.Length > 1) { tel.strotro = TxtOtro.Text; } else { tel.strotro = lbOtro.Text; } TblDireccion dom = new TblDireccion(); dom.id = Convert.ToInt32(Session["forDom"]); if (TxtCalle.Text.Length > 1) { dom.strcalle = TxtCalle.Text; } else { dom.strcalle = lbCalle.Text; } if (TxtColonia.Text.Length > 1) { dom.strcolonia = TxtColonia.Text; } else { dom.strcolonia = lbColonia.Text; } if (TxtMunicipio.Text.Length > 1) { dom.strmunicipio = TxtMunicipio.Text; } else { dom.strmunicipio = lbMunicipio.Text; } ControllerMaestro ctrlProfe = new ControllerMaestro(); ctrlProfe.Editar(prof, tel, dom); this.Response.Redirect("./DatosPersonales.aspx", true); }