public ActionResult Register_Doctor(long id) { User user = (User)Session["UserID"]; var medicalOrgID = user.User_Id; ViewData["medicalOrgID"] = medicalOrgID; Medical_Organization medical_Organization = db.Medical_Organization.Find(user.User_Id); /* * var getdepartmentslist = medical_Organization.Departments.ToList(); * getdepartmentslist.Insert(0, new Department { Department_Id = 0, Department_Name = "Select" }); * ViewBag.ListOfDepartments = getdepartmentslist; */ if (id <= 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Doctor doctor = new Doctor(); doctor.Doctor_Id = id; if (doctor == null) { return(new HttpStatusCodeResult(HttpStatusCode.NotFound)); } return(View(doctor)); }
public ActionResult Edit() { Medical_Organization medical_Organization = db.Medical_Organization.Find((long)Int64.Parse(Request.Form["Medical_Org_Id"])); if (medical_Organization == null) { ModelState.AddModelError("", "Something Wrong is occured"); return(View(medical_Organization)); } if (ModelState.IsValid) { medical_Organization.Medical_Org_Name = Request.Form["Medical_Org_Name"]; medical_Organization.User.Email = Request.Form["[0]"]; // [0] refer to email feild in input tag medical_Organization.User.Phone = Request.Form["User.Phone"]; medical_Organization.User.City = Request.Form["User.City"]; medical_Organization.User.Address = Request.Form["User.Address"]; if (Request.Form["User.Password"].Split(' ')[0] != medical_Organization.User.Password.Split(' ')[0]) { if (Request.Form["Confirm_Password"].Split(' ')[0] == Request.Form["User.Password"].Split(' ')[0]) { medical_Organization.User.Password = Request.Form["User.Password"]; } else { ModelState.AddModelError("Confirm_Password", "Password do not match Confirm Password Feild"); return(View(medical_Organization)); } } db.Entry(medical_Organization).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(medical_Organization)); }
public ActionResult Register_Hospital([Bind(Include = "Medical_Org_Name,Medical_Org_Id")] Medical_Organization md_org) { if (ModelState.IsValid) { md_org.Medium_Rate = 0.0; db.Medical_Organization.Add(md_org); db.SaveChanges(); return(RedirectToAction("UploadFile", new { id = md_org.Medical_Org_Id })); } return(View(md_org)); }
public ActionResult Details_Of_Hospital(long?id) { if (id == null) { return(RedirectToAction("Index")); } Medical_Organization org = db.Medical_Organization.Find(id); if (org == null) { return(RedirectToAction("Index")); } return(View(org)); }
// GET: Medical_Organization/Create //public ActionResult Create() //{ // ViewBag.Medical_Org_Id = new SelectList(db.Users, "User_Id", "Email"); // return View(); //} //// POST: Medical_Organization/Create //// To protect from overposting attacks, please enable the specific properties you want to bind to, for //// more details see https://go.microsoft.com/fwlink/?LinkId=317598. //[HttpPost] //[ValidateAntiForgeryToken] //public ActionResult Create([Bind(Include = "Medical_Org_Id,Medical_Org_Name,Medium_Rate")] Medical_Organization medical_Organization) //{ // if (ModelState.IsValid) // { // db.Medical_Organization.Add(medical_Organization); // db.SaveChanges(); // return RedirectToAction("Index"); // } // ViewBag.Medical_Org_Id = new SelectList(db.Users, "User_Id", "Email", medical_Organization.Medical_Org_Id); // return View(medical_Organization); //} // GET: Medical_Organization/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Medical_Organization medical_Organization = db.Medical_Organization.Find(id); if (medical_Organization == null) { return(HttpNotFound()); } ViewBag.Medical_Org_Id = new SelectList(db.Users, "User_Id", "Email", medical_Organization.Medical_Org_Id); return(View(medical_Organization)); }
//Hospiatal Registeration public ActionResult Register_Hospital(long id) { if (id <= 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Medical_Organization md_org = new Medical_Organization(); md_org.Medical_Org_Id = id; if (md_org == null) { return(new HttpStatusCodeResult(HttpStatusCode.NotFound)); } return(View(md_org)); }
public ActionResult Manage_Department() { User user = (User)Session["UserID"]; if (user == null) { return(RedirectToAction("Index", "Home")); } else if (user.User_Type != 2) { return(RedirectToAction("Index", "Home")); } Medical_Organization medical_Organization = db.Medical_Organization.Find(user.User_Id); var id = (long)user.User_Id; ViewData["medical_org_id"] = id; return(View(medical_Organization.Departments)); }
public ActionResult Manage_Doctors() { User user = (User)Session["UserID"]; if (user == null) { return(RedirectToAction("Index", "Home")); } else if (user.User_Type != 2) { return(RedirectToAction("Index", "Home")); } Medical_Organization medical_Organization = db.Medical_Organization.Find(user.User_Id); //list of doctors var doctor_list = db.Doctors.Where(d => d.Medical_Org_Id == medical_Organization.Medical_Org_Id); return(View(doctor_list)); }
public ActionResult Details_Of_Doctor(long?id) { if (id == null) { return(RedirectToAction("Index")); } Doctor dc = db.Doctors.Find(id); if (dc == null) { return(RedirectToAction("Index")); } Medical_Organization med = db.Medical_Organization.Find(dc.Medical_Org_Id); ViewBag.Medical_Org_Name = med.Medical_Org_Name; ViewBag.Medical_Org_Email = med.User.Email; ViewBag.Medical_Org_Phone = med.User.Phone; ViewBag.Medical_Org_City = med.User.City; ViewBag.Medical_Org_Address = med.User.Address; return(View(dc)); }