public static void ProfessoreInsertStudenteLabel(ProfessoreInsertStudenteModel model) { model.Title = "Red system"; model.Text = "<strong>Bold</strong> normal"; model.LabelNome = "Nome"; model.LabelCognome = "Cognome"; model.LabelClasse = "Classe"; model.LabelButtonSend = "Invia"; }
public ActionResult ProfessoreInsertStudente(int id, ProfessoreInsertStudenteModel model) { ProfessoreInsertStudenteLabel(model); model.Classe = DatabaseHelper.GetAllClasse(); model.ListaClassi = Helper.Helper.PrendiClasse(); SelectListItem x = model.ListaClassi.Where(t => t.Value == model.ListaClassiSelectedValue).FirstOrDefault(); model.StudenteClasseId = Convert.ToInt32(x.Value); DatabaseHelper.InsertStudente(model.Studente, model.StudenteClasseId); return(View(model)); }
public ActionResult ProfessoreInsertStudente(int id) { var utenteLoggato = Session["utenteLoggato"]; if (utenteLoggato == null) { return(RedirectToAction("LoginProfessore", "Home")); } var model = new ProfessoreInsertStudenteModel(); model.Professore = (Professore)utenteLoggato; if (model.Professore.ID != id) { return(RedirectToAction("HomeProfessore", "Reserved", new { model.Professore.ID })); } ProfessoreInsertStudenteLabel(model); model.Classe = DatabaseHelper.GetAllClasse(); model.ListaClassi = Helper.Helper.PrendiClasse(); return(View(model)); }