public ActionResult create() { Course cc = new Course(); TryUpdateModel(cc); db.courses.Add(cc); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult create() { Batch bd = new Batch(); TryUpdateModel(bd); db.Batchdb.Add(bd); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "Id,Nome,CodigoCRM,EstadoCRM,Especialidade")] Medico medico) { if (ModelState.IsValid) { db.Medicos.Add(medico); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(medico)); }
public ActionResult Create([Bind(Include = "ID,Ime,Prezime,DatumRodenja,Adresa,ImeRoditelja")] Ucenik ucenik) { if (ModelState.IsValid) { db.Ucenik.Add(ucenik); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ucenik)); }
public ActionResult Create([Bind(Include = "id,FirstName,LastName,Nic,Course_id,Batch_id,phone_no")] Registation registation) { if (ModelState.IsValid) { db.Registationdb.Add(registation); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(registation)); }
public ActionResult Create([Bind(Include = "StudentId,Std_name,date,GENDER")] Student student) { if (ModelState.IsValid) { db.students.Add(student); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(student)); }
public ActionResult Create([Bind(Include = "PredmetID,ImePredmeta,ImeProfesora,Opis")] Predmet predmet) { if (ModelState.IsValid) { db.Predmet.Add(predmet); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(predmet)); }
public ActionResult Create([Bind(Include = "feeid,feeamount,date,StudentId")] fee fee) { if (ModelState.IsValid) { db.fees.Add(fee); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StudentId = new SelectList(db.students, "StudentId", "Std_name", fee.StudentId); return(View(fee)); }
public ActionResult Create([Bind(Include = "OcjenaID,Grade,datum,komentar,PredmetID,UcenikID")] Ocjena ocjena) { if (ocjena.IsValid()) { db.Ocjena.Add(ocjena); db.SaveChanges(); return(RedirectToAction("Index")); } else { TempData["Pogreska"] = ocjena.ErrorMessage; } return(View(ocjena)); }
public ActionResult Reg(Login login) { // Check if Email already register var registerdEmail = (from c in c.Logins where c.Email.Equals(login.Email) select c).SingleOrDefault(); // Hash Password var hashedPw = Crypto.Hash(login.Password); login.Password = hashedPw; if (registerdEmail != null) { ViewBag.Error = "This email already registered !"; return View(); } else { c.Logins.Add(login); c.SaveChanges(); return View("Index"); } }