示例#1
0
        public async Task<ActionResult> Create([Bind(Include = "Id,Name")] DiseaseGroup diseaseGroup)
        {
            if (ModelState.IsValid)
            {
                db.DiseaseGroups.Add(diseaseGroup);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(diseaseGroup);
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,Name")] LaboratorySpecialization laboratorySpecialization)
        {
            if (ModelState.IsValid)
            {
                db.LaboratorySpecializations.Add(laboratorySpecialization);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(laboratorySpecialization));
        }
示例#3
0
        public async Task <ActionResult> Create([Bind(Include = "Id,SpecialtyName")] ServiceStaffSpecialty serviceStaffSpecialty)
        {
            if (ModelState.IsValid)
            {
                db.ServiceStaffSpecialties.Add(serviceStaffSpecialty);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(serviceStaffSpecialty));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,FirstName,SecondName")] Patient patient)
        {
            if (ModelState.IsValid)
            {
                db.Patients.Add(patient);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(patient));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,MedicalInstitutionName,Address")] MedicalInstitution medicalInstitution)
        {
            if (ModelState.IsValid)
            {
                db.MedicalInstitutions.Add(medicalInstitution);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(medicalInstitution));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,Number,NumOfBeds,HospitalDepartmentId")] Ward ward)
        {
            if (ModelState.IsValid)
            {
                db.Wards.Add(ward);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.HospitalDepartmentId = new SelectList(db.HospitalDepartments.ToList().Select(hd => new { hd.Id, Name = hd.DepartmentName }), "Id", "Name");
            return(View(ward));
        }
示例#7
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Number,ClinicId")] Cabinet cabinet)
        {
            if (ModelState.IsValid)
            {
                db.Cabinets.Add(cabinet);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.ClinicId = new SelectList(db.Clinics, "Id", "MedicalInstitutionName", cabinet.ClinicId);
            return(View(cabinet));
        }
示例#8
0
        public async Task <ActionResult> Create([Bind(Include = "Id,SpecialtyId,FirstName,SecondName")] ServiceStaff serviceStaff)
        {
            if (ModelState.IsValid)
            {
                db.ServiceStaffs.Add(serviceStaff);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.SpecialtyId = new SelectList(db.ServiceStaffSpecialties, "Id", "SpecialtyName", serviceStaff.SpecialtyId);
            return(View(serviceStaff));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,MedicalInstitutionName,Address,HospitalId")] Clinic clinic)
        {
            if (ModelState.IsValid)
            {
                db.Clinics.Add(clinic);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.HospitalId = new SelectList(db.Hospitals, "Id", "MedicalInstitutionName", clinic.HospitalId);
            return(View(clinic));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,DiseaseName,DiseaseGroupId")] Disease disease)
        {
            if (ModelState.IsValid)
            {
                db.Diseases.Add(disease);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.DiseaseGroupId = new SelectList(db.DiseaseGroups, "Id", "Name", disease.DiseaseGroupId);
            return(View(disease));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,Degree,ProfileId,FirstName,SecondName")] MedicalStaff medicalStaff)
        {
            if (ModelState.IsValid)
            {
                db.MedicalStaffs.Add(medicalStaff);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.ProfileId = new SelectList(db.MedicalStaffProfiles, "Id", "ProfileName", medicalStaff.ProfileId);
            return(View(medicalStaff));
        }
示例#12
0
        public async Task <ActionResult> Create([Bind(Include = "Id,HospitalId,Number")] HospitalBuilding hospitalBuilding)
        {
            if (ModelState.IsValid)
            {
                db.HospitalBuildings.Add(hospitalBuilding);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.HospitalId = new SelectList(db.Hospitals, "Id", "MedicalInstitutionName", hospitalBuilding.HospitalId);
            return(View(hospitalBuilding));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,ProfileName,DiseaseGroupId,SalaryAddition,VacationAddition,IsSurgeon")] MedicalStaffProfile medicalStaffProfile)
        {
            if (ModelState.IsValid)
            {
                db.MedicalStaffProfiles.Add(medicalStaffProfile);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.DiseaseGroupId = new SelectList(db.DiseaseGroups, "Id", "Name", medicalStaffProfile.DiseaseGroupId);
            return(View(medicalStaffProfile));
        }
示例#14
0
        public async Task <ActionResult> Create([Bind(Include = "Id,ServiceStaffId,MedicalInstitutionId,Salary,Vacation,EmploymentDate,DischargeDate")] ServiceStaffEmployment serviceStaffEmployment)
        {
            if (ModelState.IsValid)
            {
                db.ServiceStaffEmployments.Add(serviceStaffEmployment);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.MedicalInstitutionId = new SelectList(db.MedicalInstitutions, "Id", "MedicalInstitutionName", serviceStaffEmployment.MedicalInstitutionId);
            ViewBag.ServiceStaffId       = new SelectList(db.ServiceStaffs.Include(ss => ss.Specialty).ToList().Select(ss => new { ss.Id, Name = ss.FirstName + " " + ss.SecondName + "|" + ss.Specialty.SpecialtyName }), "Id", "Name", serviceStaffEmployment.ServiceStaffId);
            return(View(serviceStaffEmployment));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,MedicalStaffId,EmploymentType,MedicalInstitutionId,Salary,Vacation,EmploymentDate,DischargeDate")] MedicalStaffEmployment medicalStaffEmployment)
        {
            if (ModelState.IsValid)
            {
                db.MedicalStaffEmployments.Add(medicalStaffEmployment);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.MedicalInstitutionId = new SelectList(db.MedicalInstitutions, "Id", "MedicalInstitutionName", medicalStaffEmployment.MedicalInstitutionId);
            ViewBag.MedicalStaffId       = new SelectList(db.MedicalStaffs.Include(ms => ms.Profile).ToList().Select(ms => new { ms.Id, Name = ms.MedicalStaffName }), "Id", "Name", medicalStaffEmployment.MedicalStaffId);
            return(View(medicalStaffEmployment));
        }
示例#16
0
        public async Task <ActionResult> Create([Bind(Include = "Id,DiseaseGroupId,HospitalBuildingId")] HospitalDepartment hospitalDepartment)
        {
            if (ModelState.IsValid)
            {
                db.HospitalDepartments.Add(hospitalDepartment);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.DiseaseGroupId     = new SelectList(db.DiseaseGroups, "Id", "Name", hospitalDepartment.DiseaseGroupId);
            ViewBag.HospitalBuildingId = new SelectList(db.HospitalBuildings.ToList().Select(hd => new { hd.Id, Name = hd.HospitalBuildingName }), "Id", "Name");
            return(View(hospitalDepartment));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,LaboratoryId,MedicalInstitutionId,ContractPrice")] LaboratoryContract laboratoryContract)
        {
            if (ModelState.IsValid)
            {
                db.LaboratoryContracts.Add(laboratoryContract);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.LaboratoryId         = new SelectList(db.Laboratories.ToList().Select(l => new { l.Id, Name = l.LaboratoryName }), "Id", "Name", laboratoryContract.LaboratoryId);
            ViewBag.MedicalInstitutionId = new SelectList(db.MedicalInstitutions.ToList().Select(mi => new { mi.Id, Name = mi.MedicalInstitutionName }), "Id", "Name", laboratoryContract.MedicalInstitutionId);
            //ViewBag.LaboratoryId = new SelectList(db.Laboratories, "Id", "Address", laboratoryContract.LaboratoryId);
            //ViewBag.MedicalInstitutionId = new SelectList(db.MedicalInstitutions, "Id", "MedicalInstitutionName", laboratoryContract.MedicalInstitutionId);
            return(View(laboratoryContract));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,MedicalInstitutionVisitId,OperationName,SurgeonId,OperationDate,OperationResult")] Operation operation)
        {
            if (ModelState.IsValid)
            {
                db.Operations.Add(operation);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }


            var medicalInstitutionVisits     = GetMedicalInstitutionVisits();
            var medicalInstitutionVisitItems = medicalInstitutionVisits.ToList();

            ViewBag.MedicalInstitutionVisitId = new SelectList(medicalInstitutionVisitItems, "Id", "Name", operation.MedicalInstitutionVisitId);
            ViewBag.SurgeonId = GetSurgeonSelectList(medicalInstitutionVisitItems.First()?.Id);
            return(View(operation));
        }
示例#19
0
        public async Task <ActionResult> Create([Bind(Include = "Id,PatientId,DoctorId,VisitDate,DiseaseId,CabinetId")] ClinicVisit clinicVisit)
        {
            if (ModelState.IsValid)
            {
                db.ClinicVisits.Add(clinicVisit);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.DiseaseId = new SelectList(db.Diseases, "Id", "DiseaseName", clinicVisit.DiseaseId);

            ViewBag.PatientId = new SelectList(db.Patients.ToList().Select(p => new { p.Id, Name = p.FullName }), "Id", "Name", clinicVisit.PatientId);
            ViewBag.CabinetId = new SelectList(db.Cabinets.Include(c => c.Clinic).ToList().Select(c => new { c.Id, Name = c.CabinetName }), "Id", "Name", clinicVisit.CabinetId);

            //ViewBag.DoctorId = new SelectList(db.MedicalStaffs.Include(ms => ms.Profile).ToList().Select(ms => new { ms.Id, Name = ms.MedicalStaffName }), "Id", "Name", clinicVisit.DoctorId);
            ViewBag.DoctorId = GetDoctorsByDiseaseAndHospital(clinicVisit.CabinetId, clinicVisit.DiseaseId,
                                                              clinicVisit.VisitDate, clinicVisit.DoctorId);
            return(View(clinicVisit));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,PatientId,DoctorId,VisitDate,DiseaseId,WardId,VisitEndDate,Temperature,PatientCondition")] HospitalVisit hospitalVisit)
        {
            if (ModelState.IsValid)
            {
                db.HospitalVisits.Add(hospitalVisit);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }


            ViewBag.DiseaseId = new SelectList(db.Diseases, "Id", "DiseaseName");
            //ViewBag.DoctorId = new SelectList(db.MedicalStaffs.Include(ms => ms.Profile).ToList().Select(ms => new { ms.Id, Name = ms.MedicalStaffName }), "Id", "Name");
            //ViewBag.WardId = new SelectList(db.Wards.Include(w => w.HospitalDepartment).ToList().Select(w => new { w.Id, Name = w.WardName }), "Id", "Name");
            ViewBag.WardId    = GetWardsByDisease(hospitalVisit.DiseaseId, hospitalVisit.WardId);
            ViewBag.DoctorId  = GetDoctorsByDiseaseAndHospital(hospitalVisit.WardId, hospitalVisit.DiseaseId, hospitalVisit.VisitDate, hospitalVisit.VisitEndDate, hospitalVisit.DoctorId);
            ViewBag.PatientId = new SelectList(db.Patients.ToList().Select(p => new { p.Id, Name = p.FullName }), "Id", "Name");

            return(View(hospitalVisit));
        }
示例#21
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Address,selectedSpecializations")] Laboratory laboratory, int[] selectedSpecializations)
        {
            if (ModelState.IsValid)
            {
                if (selectedSpecializations != null)
                {
                    laboratory.LaboratorySpecializations.Clear();
                    foreach (var ls in db.LaboratorySpecializations.Where(ls => selectedSpecializations.Contains(ls.Id)))
                    {
                        laboratory.LaboratorySpecializations.Add(ls);
                    }
                }

                db.Laboratories.Add(laboratory);

                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(laboratory));
        }