// GET: EmployeeDetails/Create public ActionResult Create() { RegisterViewModel model = new RegisterViewModel(); EmployeeDetail empDetails = new EmployeeDetail(); Doctor doctor = new Doctor(); model.EmpDetails = empDetails; model.Doctor = doctor; ViewBag.BranchDetail_ID = new SelectList(db.BranchDetails, "ID", "Name"); ViewBag.City_ID = new SelectList(db.Cities, "ID", "name"); ViewBag.EmployeeType_ID = new SelectList(db.EmployeeTypes, "ID", "Description"); ViewBag.Title_ID = new SelectList(db.Titles, "ID", "Name"); ViewBag.Qualification = new SelectList(db.Qualifications, "ID", "Name"); ViewBag.Specialization = new SelectList(db.Specializations, "ID", "Name"); return View(model); }
public async Task<ActionResult> MyProfile(EmployeeDetail model) { if (ModelState.IsValid) { db.Entry(model).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index" , "Home"); } ViewBag.BranchDetail_ID = new SelectList(db.BranchDetails, "ID", "Name", model.BranchDetail_ID); ViewBag.City_ID = new SelectList(db.Cities, "ID", "name", model.City_ID); ViewBag.EmployeeType_ID = new SelectList(db.EmployeeTypes, "ID", "Description", model.EmployeeType_ID); ViewBag.Title_ID = new SelectList(db.Titles, "ID", "Name", model.Title_ID); return View(model); }