public ActionResult Edit([Bind(Include = "PatientId,HistoryId,Path")] Document document)
 {
     if (ModelState.IsValid)
     {
         db.Entry(document).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.HistoryId = new SelectList(db.Histories, "HistoryId", "Disease", document.HistoryId);
     ViewBag.PatientId = new SelectList(db.Patients, "PatientId", "Name", document.PatientId);
     return(View(document));
 }
        public ActionResult Create([Bind(Include = "DoctorId,Name,Password,City,ContactNo")] Doctor doctor)
        {
            if (ModelState.IsValid)
            {
                db.Doctors.Add(doctor);
                db.SaveChanges();
                ViewBag.Message = "Account Created Successfully...Your ID is " + doctor.DoctorId;
                //return RedirectToAction("Index");
            }

            return(View(doctor));
        }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "PatientId,Name,Password,Age,BloodGroup,Allergy,ContactNo,Gender,Address,City,Pincode")] Patient patient)
        {
            if (ModelState.IsValid)
            {
                db.Patients.Add(patient);
                db.SaveChanges();
                ViewBag.Message = "Account Created Successfully...Your ID is " + patient.PatientId;
                //return RedirectToAction("Index","Home");
            }

            return(View(patient));
        }
        public ActionResult Create([Bind(Include = "HistoryId,PatientId,Disease,Hospital,City,Doctor,DateFrom,DateTo")] History history)
        {
            if (ModelState.IsValid)
            {
                db.Histories.Add(history);
                db.SaveChanges();
                return(RedirectToAction("Details", new { id = Session["id"] }));
            }

            //ViewBag.PatientId = new SelectList(db.Patients, "PatientId", "Name", history.PatientId);
            return(View(history));
        }
        public ActionResult Add(Document document)
        {
            string fileName  = Path.GetFileNameWithoutExtension(document.ImageFile.FileName);
            string extension = Path.GetExtension(document.ImageFile.FileName);

            fileName      = fileName + DateTime.Now.ToString("yymmssfff") + extension;
            document.Path = "~/PatientDocument/" + fileName;
            fileName      = Path.Combine(Server.MapPath("~/PatientDocument/"), fileName);
            document.ImageFile.SaveAs(fileName);
            using (MedicalHistoryEntities2 db = new MedicalHistoryEntities2())
            {
                db.Documents.Add(document);
                db.SaveChanges();
            }
            ViewBag.Message = "Document Uploaded Successfully....";
            //ModelState.Clear();
            return(View());
        }