예제 #1
0
        public ActionResult Create(SystemPerson systemPerson)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            if (Request.Files.Count > 0)
            {
                if (Request.Files[0].FileName != "")
                {
                    if (allowedExtensions.Contains(Path.GetExtension(Request.Files[0].FileName)))
                    {
                        systemPerson.cv = uploadFile(systemPerson.id.ToString());
                    }
                    else
                    {
                        ModelState.AddModelError("cv", "only pdf , doc , docx and txt files allowed");
                    }
                }
            }
            if (ModelState.IsValid)
            {
                systemPerson.id = Guid.NewGuid();
                _personService.add(systemPerson);
                return(RedirectToAction("Index"));
            }

            ViewBag.jobId            = new SelectList(_jobService.getAll(), "id", "name", systemPerson.jobId);
            ViewBag.specializationId = new SelectList(new List <Specialization>(), "id", "name", systemPerson.specializationId);
            return(View(systemPerson));
        }
        public ActionResult Create([Bind(Include = "id,Laboratory1,DateofLab,visitId")] Laboratory laboratory)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            if (ModelState.IsValid)
            {
                laboratory.id = Guid.NewGuid();
                db.Laboratories.Add(laboratory);
                db.SaveChanges();
                return(RedirectToAction("Index", new { @id = laboratory.visitId }));
            }
            if (laboratory.visitId == null)
            {
                return(HttpNotFound());
            }

            visit visit = _visitService.get(laboratory.visitId);

            if (visit == null)
            {
                return(HttpNotFound());
            }
            ViewBag.visit = visit;
            return(View(laboratory));
        }
예제 #3
0
        public ActionResult Create(patient patient)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            if (ModelState.IsValid)
            {
                if (patient.birthDate != null)
                {
                    patient.age = DateTime.Now.Year - patient.birthDate.Value.Year;

                    if (patient.birthDate.Value.Month > DateTime.Now.Month)
                    {
                        patient.age--;
                    }
                    else if (patient.birthDate.Value.Month == DateTime.Now.Month)
                    {
                        if (patient.birthDate.Value.Day > DateTime.Now.Day)
                        {
                            patient.age--;
                        }
                    }
                }
                patient.id = Guid.NewGuid();
                db.patients.Add(patient);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.doctorId = new SelectList(db.SystemPersons, "id", "name", patient.doctorId);
            return(View(patient));
        }
        public ActionResult Create(examination examination)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            if (ModelState.IsValid)
            {
                examination.id = Guid.NewGuid();
                db.examinations.Add(examination);
                db.SaveChanges();
                return(RedirectToAction("Index", new { id = examination.visitId }));
            }
            if (examination.visitId == null)
            {
                return(HttpNotFound());
            }

            visit visit = _visitService.get(examination.visitId);

            if (visit == null)
            {
                return(HttpNotFound());
            }
            ViewBag.visit = visit;
            return(View(examination));
        }
예제 #5
0
        public ActionResult Create([Bind(Include = "id,visitDate,visitStatus,visitSite,complaintType,PresentHistory,decision,requestedInvestigations,GeneralAppearance,mentality,Built,Pallor,jaundice,cyanosis,postureDuringWalking,postureStanding,postureSitting,postureLyingSupineorPhone,vitalSigns,DoctorId,patientId")] visit visit)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            if (ModelState.IsValid)
            {
                visit.id = Guid.NewGuid();
                db.visits.Add(visit);
                db.SaveChanges();
                return(RedirectToAction("Index", new { @id = visit.patientId }));
            }

            if (visit.patientId == null)
            {
                return(HttpNotFound());
            }

            patient patient = _patientService.get(visit.patientId);

            if (patient == null)
            {
                return(HttpNotFound());
            }
            ViewBag.patient  = patient;
            ViewBag.DoctorId = new SelectList(db.SystemPersons.Where(o => o.Job.name.ToLower() == "doctor"), "id", "name", visit.DoctorId);
            return(View(visit));
        }
예제 #6
0
        // GET: Reservations
        public ActionResult Index()
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            var reservations = db.Reservations.Include(r => r.SystemPerson).ToList();

            if ((Request.QueryString["roomNumberQ"] != string.Empty && Request.QueryString["roomNumberQ"] != null) ||
                (Request.QueryString["doctorIdsearch"] != string.Empty && Request.QueryString["doctorIdsearch"] != null)
                )
            {
                if ((Request.QueryString["doctorIdsearch"] != string.Empty && Request.QueryString["doctorIdsearch"] != null))
                {
                    Guid doctorId;
                    if (Guid.TryParse(Request.QueryString["doctorIdsearch"], out doctorId))
                    {
                        reservations = reservations.Where(r => r.doctorId == doctorId).ToList();
                    }
                }
                if ((Request.QueryString["roomNumberQ"] != string.Empty && Request.QueryString["roomNumberQ"] != null))
                {
                    reservations = reservations.Where(o => o.roomNumber.ToLower().Contains(Request.QueryString["roomNumberQ"])).ToList();
                }
            }

            ViewBag.doctorIdsearch = new SelectList(db.SystemPersons.Where(d => d.Job.name.ToLower().Contains("doctor")), "id", "name");
            return(View(reservations));
        }
예제 #7
0
 // GET: Jobs
 public ActionResult Index()
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     return(View(db.Jobs.ToList()));
 }
예제 #8
0
 // GET: Jobs/Create
 public ActionResult Create()
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     return(View());
 }
예제 #9
0
 // GET: Specializations/Create
 public ActionResult Create()
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     ViewBag.jobId = new SelectList(db.Jobs, "id", "name");
     return(View());
 }
예제 #10
0
        // GET: SystemPersons/Details/5


        // GET: SystemPersons/Create
        public ActionResult Create()
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            ViewBag.jobId            = new SelectList(_jobService.getAll(), "id", "name");
            ViewBag.specializationId = new SelectList(new List <Specialization>(), "id", "name");
            return(View());
        }
예제 #11
0
        // GET: Specializations
        public ActionResult Index()
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            var specializations = db.Specializations.Include(s => s.Job);

            return(View(specializations.ToList()));
        }
예제 #12
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            SystemPerson systemPerson = _personService.get(id);

            _personService.delete(systemPerson);
            return(RedirectToAction("Index"));
        }
예제 #13
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            Group group = db.Groups.Find(id);

            db.Groups.Remove(group);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #14
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            Specialization specialization = db.Specializations.Find(id);

            db.Specializations.Remove(specialization);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #15
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            medicine medicine = db.medicines.Find(id);
            Guid     prescId  = (Guid)medicine.prescriptionId;

            db.medicines.Remove(medicine);
            db.SaveChanges();
            return(RedirectToAction("Index", new { @id = prescId }));
        }
        public ActionResult DeleteConfirmed(Guid id)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            prescription prescription = db.prescriptions.Find(id);
            Guid         visitId      = (Guid)prescription.visitId;

            db.prescriptions.Remove(prescription);
            db.SaveChanges();
            return(RedirectToAction("Index", new { @id = visitId }));
        }
예제 #17
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            visit visit     = db.visits.Find(id);
            Guid  patientId = (Guid)visit.patientId;

            db.visits.Remove(visit);
            db.SaveChanges();
            return(RedirectToAction("Index", new { @id = patientId }));
        }
예제 #18
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            Endoscopy endoscopy = db.Endoscopies.Find(id);
            Guid      visitId   = (Guid)endoscopy.visitId;

            db.Endoscopies.Remove(endoscopy);
            db.SaveChanges();
            return(RedirectToAction("Index", new { @id = visitId }));
        }
        public ActionResult DeleteConfirmed(Guid id)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            Imaging imaging = db.Imagings.Find(id);
            Guid    visitId = (Guid)imaging.VisitId;

            db.Imagings.Remove(imaging);
            db.SaveChanges();
            return(RedirectToAction("Index", new { @id = visitId }));
        }
예제 #20
0
 public ActionResult Edit(medicine medicine)
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(medicine).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = medicine.prescriptionId }));
     }
     return(View(medicine));
 }
예제 #21
0
 public ActionResult Edit([Bind(Include = "id,name")] Group group)
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(group).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(group));
 }
 public ActionResult Edit(examination examination)
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(examination).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = examination.visitId }));
     }
     return(View(examination));
 }
 public ActionResult Edit([Bind(Include = "id,ImageDate,ImageCenter,TypeofImage,Site,Comments,ImageName,VisitId")] Imaging imaging)
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(imaging).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = imaging.VisitId }));
     }
     return(View(imaging));
 }
 public ActionResult Edit([Bind(Include = "id,groupId,tableId,canAdd,canEdit,canDelete,canRead")] Permission permission)
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(permission).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { @id = permission.groupId }));
     }
     return(View(permission));
 }
 public ActionResult Edit([Bind(Include = "id,notes,visitId")] prescription prescription)
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(prescription).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = prescription.visitId }));
     }
     return(View(prescription));
 }
 public ActionResult Edit([Bind(Include = "id,Laboratory1,DateofLab,visitId")] Laboratory laboratory)
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(laboratory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = laboratory.visitId }));
     }
     return(View(laboratory));
 }
예제 #27
0
        public ActionResult Edit(SystemPerson systemPerson)
        {
            if (!HomeController.Authorized(this))
            {
                return(RedirectToAction("Login", "Accounts"));
            }
            if (Request.Files.Count > 0)
            {
                if (Request.Files[0].FileName != "")
                {
                    if (allowedExtensions.Contains(Path.GetExtension(Request.Files[0].FileName)))
                    {
                        string rootFolderPath = Request.MapPath("~/App_Data/fileUploads/");
                        var    dir            = new DirectoryInfo(rootFolderPath);

                        foreach (var file in dir.EnumerateFiles(systemPerson.id.ToString() + "*.*"))
                        {
                            file.Delete();
                        }
                        systemPerson.cv = uploadFile(systemPerson.id.ToString());
                    }
                    else
                    {
                        ModelState.AddModelError("cv", "only pdf , doc , docx and txt files allowed");
                    }
                }
                else
                {
                    if (Request["oldCV"] != null && Request["oldCV"] != string.Empty)
                    {
                        systemPerson.cv = Request["oldCV"];
                    }
                }
            }
            else
            {
                if (Request["oldCV"] != null && Request["oldCV"] != string.Empty)
                {
                    systemPerson.cv = Request["oldCV"];
                }
            }
            if (ModelState.IsValid)
            {
                _personService.edit(systemPerson);
                return(RedirectToAction("Index"));
            }
            ViewBag.jobId            = new SelectList(_jobService.getAll(), "id", "name", systemPerson.jobId);
            ViewBag.specializationId = new SelectList(_jobService.get(systemPerson.jobId).Specializations, "id", "name", systemPerson.specializationId);
            return(View(systemPerson));
        }
예제 #28
0
 public ActionResult Edit([Bind(Include = "id,Endoscopy1,EndoscopyType,site,comments,graph,visitId")] Endoscopy endoscopy)
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(endoscopy).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = endoscopy.visitId }));
     }
     return(View(endoscopy));
 }
예제 #29
0
 public ActionResult Edit([Bind(Include = "id,name,jobId")] Specialization specialization)
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(specialization).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.jobId = new SelectList(db.Jobs, "id", "name", specialization.jobId);
     return(View(specialization));
 }
 public ActionResult Edit(Account account)
 {
     if (!HomeController.Authorized(this))
     {
         return(RedirectToAction("Login", "Accounts"));
     }
     if (ModelState.IsValid)
     {
         db.Entry(account).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.groupId = new SelectList(db.Groups, "id", "name");
     return(View(account));
 }