Skip to content
Loading
data.ToArray();
return Json(data, JsonRequestBehavior.AllowGet);
}
}
else
{
data.Add("
if (FileUpload == null) data.Add("
  • Please choose Excel file
  • ");
    data.Add("");
    data.ToArray();
    return Json(data, JsonRequestBehavior.AllowGet);
    }
    }
    private static Doctor GetFormattedDocotr(Doctor a)
    {
    if (a != null)
    return new Doctor
    {
    DoctorId = a.DoctorId,
    FormNumber = a.FormNumber,
    Date = a.Date,
    Title = a.Title,
    FullName = a.FullName,
    Gender = a.Gender,
    DateOfBirth = a.DateOfBirth,
    MobileNumber = a.MobileNumber,
    LandLineNumber = a.LandLineNumber,
    Qualifications = a.Qualifications,
    Speciality = a.Speciality,
    Expertise = a.Expertise,
    RegistrationNumber = a.RegistrationNumber,
    YearsOfExperience = a.YearsOfExperience,
    ShortProfile = a.ShortProfile,
    Email = a.Email,
    Website = a.Website,
    Subscription = a.Subscription,
    SmartPhone = a.SmartPhone
    };
    return null;
    }
    // GET: /Doctor/Details/5
    public ActionResult Details(int? id)
    {
    if (id == null)
    {
    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
    }
    var doctor = db.Doctors.Find(id);
    if (doctor == null)
    {
    return HttpNotFound();
    }
    return View(doctor);
    }
    // GET: /Doctor/Create
    public ActionResult Create()
    {
    return View();
    }
    // POST: /Doctor/Create
    // To protect from overposting attacks, please enable the specific properties you want to bind to, for
    // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Create([Bind(Include = "DoctorId,FormNumber,Date,Title,FullName,Gender,DateOfBirth,MobileNumber,LandLineNumber,Qualifications,Speciality,Expertise,RegistrationNumber,YearsOfExperience,ShortProfile,Email,Website,Subscription,SmartPhone")] Doctor doctor)
    {
    if (ModelState.IsValid)
    {
    db.Doctors.Add(doctor);
    db.SaveChanges();
    return RedirectToAction("Index");
    }
    return View(doctor);
    }
    // GET: /Doctor/Edit/5
    public ActionResult Edit(int? id)
    {
    if (id == null)
    {
    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
    }
    var doctor = db.Doctors.Find(id);
    if (doctor == null)
    {
    return HttpNotFound();
    }
    return View(doctor);
    }
    // POST: /Doctor/Edit/5
    // To protect from overposting attacks, please enable the specific properties you want to bind to, for
    // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Edit([Bind(Include = "DoctorId,FormNumber,Date,Title,FullName,Gender,DateOfBirth,MobileNumber,LandLineNumber,Qualifications,Speciality,Expertise,RegistrationNumber,YearsOfExperience,ShortProfile,Email,Website,Subscription,SmartPhone")] Doctor doctor)
    {
    if (ModelState.IsValid)
    {
    db.Entry(doctor).State = EntityState.Modified;
    db.SaveChanges();
    return RedirectToAction("Index");
    }
    return View(doctor);
    }
    // GET: /Doctor/Delete/5
    public ActionResult Delete(int? id)
    {
    if (id == null)
    {
    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
    }
    var doctor = db.Doctors.Find(id);
    if (doctor == null)
    {
    return HttpNotFound();
    }
    return View(doctor);
    }
    // POST: /Doctor/Delete/5
    [HttpPost, ActionName("Delete")]
    [ValidateAntiForgeryToken]
    public ActionResult DeleteConfirmed(int id)
    {
    var doctor = db.Doctors.Find(id);
    db.Doctors.Remove(doctor);
    db.SaveChanges();
    return RedirectToAction("Index");
    }
    protected override void Dispose(bool disposing)
    {
    if (disposing)
    {
    db.Dispose();
    }
    base.Dispose(disposing);
    }
    }
    }
    -1