Exemple #1
0
 public ActionResult Edit([Bind(Include = "UserId,Password,FirstName,LastName,Age,Gender,Address,PhoneNumber,UserType")] UserInformation userInformation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userInformation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(userInformation));
 }
Exemple #2
0
        public ActionResult Create([Bind(Include = "JobId,Employer,Address,PhoneNumber,EmailId,SkillsRequired,Qualification,Location,Salary,NoOfVaccancies")] JobDetail jobDetail)
        {
            if (ModelState.IsValid)
            {
                db.JobDetails.Add(jobDetail);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(jobDetail));
        }
Exemple #3
0
        public ActionResult Create([Bind(Include = "UserId,Password,FirstName,LastName,Age,Gender,Address,PhoneNumber,UserType")] UserInformation userInformation)
        {
            try
            {
                using (JobPortalSystemContext1 db = new JobPortalSystemContext1())
                {
                    db.UserInformations.Add(userInformation);

                    db.SaveChanges();

                    Session["PhoneNumber"] = userInformation.PhoneNumber.ToString();
                    Session["Password"]    = userInformation.Password.ToString();
                    Session["UserType"]    = userInformation.UserType.ToString();
                    Session["FirstName"]   = userInformation.FirstName.ToString();
                    return(RedirectToAction("Index", "JobDetails"));
                }
            }
            catch (Exception)
            {
                ModelState.AddModelError("", "Failed to Register details");
                return(RedirectToAction("Create"));
            }
        }