public ActionResult Create(Firma firma) { if (ModelState.IsValid) { db.Firmas.Add(firma); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.Sehir = new SelectList(db.Sehirs, "Plaka", "Sehir1", firma.Sehir); return View(firma); }
public ActionResult Create(Firma firma,byte Plaka) { ViewBag.SehirId = new SelectList(db.Sehirs, "Plaka", "Sehir1"); if (ModelState.IsValid) { firma.Tip = 1; firma.Sehir = Plaka; db.Firmas.Add(firma); db.SaveChanges(); return RedirectToAction("Index"); } return View(firma); }
public ActionResult Edit(Firma firma) { if (ModelState.IsValid) { db.Entry(firma).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.Sehir = new SelectList(db.Sehirs, "Plaka", "Sehir1", firma.Sehir); return View(firma); }
public ActionResult Login1(Firma firma) { string mail = firma.Mail; string sifre = firma.Sifre; var user = (from u in db.Firmas where u.Mail == mail select u).FirstOrDefault(); if (user != null && (user.Mail == mail && user.Sifre == sifre)) { FormsAuthentication.SetAuthCookie(mail, true); return RedirectToAction("Index", "Home"); } else { ModelState.AddModelError("", " Mail veya şifre hatalı!"); } return View(firma); }