public ActionResult CareerProfile(careerProfile careerPro) { //if (ModelState.IsValid) //{ // db.personalDetails.Add(personaldetail); // db.SaveChanges(); // return RedirectToAction("Index"); //} careerProfile career = (from careers in db2.careerProfiles where careers.email == careerPro.email select careers).SingleOrDefault(); if (career == null) { careerPro.createDate = DateTime.Now; db2.careerProfiles.InsertOnSubmit(careerPro); db2.SubmitChanges(); } else { career.modifiedDate = DateTime.Now; career.highestEducationLevelId = careerPro.highestEducationLevelId; career.expectedSalary = careerPro.expectedSalary; career.availablityId = careerPro.availablityId; career.latestPosition = careerPro.latestPosition; career.latestSalary = careerPro.latestSalary; career.yearOfWorkingExp = careerPro.yearOfWorkingExp; db2.SubmitChanges(); } return RedirectToAction("workExperience", "CareerProfile", new { email = Session["userId"].ToString(), id = 0 }); // return View(); }
// // GET: /careerProfile/ public ActionResult CareerProfile(string email, int id = 0) { // ViewBag.email = email; //string email = Request.QueryString["email"]; careerProfile careerPro = (from careers in db2.careerProfiles where careers.email == email select careers).SingleOrDefault(); if (careerPro == null && email != "") { careerPro = new careerProfile(); careerPro.email = email; careerPro.createDate = DateTime.Now; db2.careerProfiles.InsertOnSubmit(careerPro); } string photoName = (from perdetail in db2.personalDetails where perdetail.email == email select perdetail.photo).SingleOrDefault(); string folder =""; string extension; if (photoName != "" && photoName != null) { extension = System.IO.Path.GetExtension(photoName); folder = photoName.Substring(0, photoName.Length - extension.Length); } ViewBag.folder = folder; ViewBag.dateTime = DateTime.Now.ToString(); ViewBag.photoName = photoName; ViewBag.availablityId = new SelectList(db2.availablityDefs, "availablityId", "availablityName"); ViewBag.highestEducationLevelId = new SelectList(db2.highestEducationLevelDefs,"highestEducationLevelId","highestEducationLevel"); return View(careerPro); }
partial void DeletecareerProfile(careerProfile instance);
partial void UpdatecareerProfile(careerProfile instance);
partial void InsertcareerProfile(careerProfile instance);
public ActionResult Edit(careerProfile careerprofile) { if (ModelState.IsValid) { db.Entry(careerprofile).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(careerprofile); }
public ActionResult Create(careerProfile careerprofile) { //if (ModelState.IsValid) //{ // db.careerProfiles.Add(careerprofile); // db.SaveChanges(); // return RedirectToAction("Index"); //} if (ModelState.IsValid) { db2.careerProfiles.InsertOnSubmit(careerprofile); db2.SubmitChanges(); } return View(careerprofile); }