public ActionResult Create([Bind(Include = "Id,Photo,Work,Title,Icon,Location,Date,Working")] jobList jobList) { if (ModelState.IsValid) { db.JobLists.Add(jobList); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(jobList)); }
public ActionResult Create([Bind(Include = "Id,PhotoItem,FullName,Work,Icon,Location,Rating,HeaderPhoto")] EmployersList employersList) { if (ModelState.IsValid) { db.EmployersLists.Add(employersList); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(employersList)); }
public ActionResult Create([Bind(Include = "Id,Photo,Icon,Work,Location,Count,Experience")] JobsGrid jobsGrid) { if (ModelState.IsValid) { db.JobsGrids.Add(jobsGrid); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(jobsGrid)); }
public ActionResult Create([Bind(Include = "Id,FullName,PhotoItem,Icon,Work,Location,Price,Skills")] CandidateListing candidateListing) { if (ModelState.IsValid) { db.CandidateListings.Add(candidateListing); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(candidateListing)); }
public ActionResult Create([Bind(Include = "Id,Text,Desc,Qualification,Responsibilities,Photo")] JobDetails jobDetails) { if (ModelState.IsValid) { db.JobDetails.Add(jobDetails); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(jobDetails)); }
public ActionResult Index(LoginIndexModel loginView) { if (!ModelState.IsValid) { return(View(loginView)); } HomeworkMvc.Models.Admin adminPanel = db.Admins.FirstOrDefault(a => a.Email == loginView.Email); if (adminPanel != null && Crypto.VerifyHashedPassword(adminPanel.Password, loginView.Password)) { adminPanel.Token = Guid.NewGuid().ToString(); db.SaveChanges(); HttpCookie cookie = new HttpCookie("token", adminPanel.Token) { HttpOnly = true, Expires = loginView.RememberMe ? DateTime.Now.AddYears(1) : DateTime.MinValue }; Response.Cookies.Add(cookie); return(RedirectToAction("Index", "Home")); } ModelState.AddModelError("", "E-poçt və ya şifrə yalnışdır"); return(View(loginView)); }