public ActionResult DeleteConfirmed(int id) { DoctorAdminLogic bl = new DoctorAdminLogic(); bl.deleteDoctor(id); ViewBag.Message = String.Format("The doctor was deleted successfully."); return(View("Home")); }
public static MvcHtmlString DropDownListForDctors(this HtmlHelper htmlHelper, string name) { DoctorAdminLogic bl = new DoctorAdminLogic(); string options = ""; foreach (var user in bl.listDoctors()) { options += $"<option value ='{user.IdP}'> {user.IdP} </option>"; } return(new MvcHtmlString($"<select name={name} style='color:black style:position:relative; width:220px;'>{options}</select>")); }
public ActionResult Create(FormCollection collection) { try { DoctorAdminLogic bl = new DoctorAdminLogic(); long j = Convert.ToInt64(collection["PhoneNumber"]); bl.AddDoctor(collection["FName"], collection["LName"], collection["email"], Convert.ToInt64(collection["IdP"]), Convert.ToInt64(collection["Licensing"]), j, collection["Specialty"], collection["gender"]); ViewBag.Message = String.Format("The doctor was added successfully."); return(View("Home")); } catch { ViewBag.Message = String.Format("The ID number already exists in the system , try again"); return(View()); } }
public ActionResult Edit(FormCollection collection)//[Bind(Include = "Id,IdP,FName,LName,gender,Specialty,Licensing,PhoneNumber,email")] DoctorViewModel doctorViewModel) { try { DoctorAdminLogic bl = new DoctorAdminLogic(); long j = Convert.ToInt64(collection["PhoneNumber"]); string g = collection["FName"]; long f = Convert.ToInt64(collection["IdP"]); string h = collection["gender"]; bl.EditDoctor(collection["FName"], collection["LName"], collection["email"], Convert.ToInt64(collection["IdP"]), Convert.ToInt64(collection["Licensing"]), j, collection["Specialty"], collection["gender"]); ViewBag.Message = String.Format("The doctor was edited successfully."); return(View("Home")); } catch { return(View()); } }