//
        // GET: /Hypertension/Create
        public ActionResult Create()
        {
            TayBacDBContext dbContext = new TayBacDBContext();
            List <object>   ls        = new List <object>();
            HospitalModels  hp_model  = new HospitalModels();
            huyetap         ha        = new huyetap();
            benhnhan        pa        = new benhnhan();
            KhoaModels      kh_model  = new KhoaModels();
            GiuongModels    gi_model  = new GiuongModels();
            List <benhvien> lsbv      = hp_model.getAll();
            List <khoa>     lskhoa    = new List <khoa>();

            if (lsbv.Count() > 0)
            {
                lskhoa = kh_model.getListByIdBV(lsbv.First().idbv);
            }
            List <giuong> lsgiuong = new List <giuong>();

            if (lskhoa.Count() > 0)
            {
                lsgiuong = gi_model.getListByIdKhoa(lskhoa.First().idkhoa);
            }

            ls.Add(lsbv);
            ls.Add(ha);
            ls.Add(pa);
            ls.Add(lskhoa);
            ls.Add(lsgiuong);

            return(View(ls));
        }
示例#2
0
        public ActionResult jsonLsKhoa(string id)
        {
            KhoaModels  kh_model = new KhoaModels();
            List <khoa> kh       = kh_model.getListByIdBV(id);

            return(Json(kh, JsonRequestBehavior.AllowGet));
        }
        //
        // GET: /Bloodpressure/Edit/5
        public ActionResult Edit(string id)
        {
            TayBacDBContext dbContext = new TayBacDBContext();
            List <object>   ls        = new List <object>();
            HospitalModels  hp_model  = new HospitalModels();
            HuyetapModels   ha_model  = new HuyetapModels();
            huyetap         ha        = ha_model.getByID(id);



            benhnhan        pa       = new benhnhan();
            KhoaModels      kh_model = new KhoaModels();
            GiuongModels    gi_model = new GiuongModels();
            List <benhvien> lsbv     = hp_model.getAll();
            List <khoa>     lskhoa   = new List <khoa>();

            if (lsbv.Count() > 0)
            {
                lskhoa = kh_model.getListByIdBV(lsbv.First().idbv);
            }
            List <giuong> lsgiuong = new List <giuong>();

            if (lskhoa.Count() > 0)
            {
                lsgiuong = gi_model.getListByIdKhoa(lskhoa.First().idkhoa);
            }

            //
            BenhsuModels  bs_model = new BenhsuModels();
            benhsu        bs_data  = bs_model.getByID(ha.idbs);
            PatientModels pa_model = new PatientModels();
            benhnhan      pa_data  = pa_model.detail(bs_data.idbn);
            benhvien      bv_data  = hp_model.details(pa_data.idbv);

            pa_data.benhvien = bv_data;
            bs_data.benhnhan = pa_data;
            ha.benhsu        = bs_data;
            //

            ls.Add(lsbv);
            ls.Add(ha);
            ls.Add(pa);
            ls.Add(lskhoa);
            ls.Add(lsgiuong);

            return(View(ls));
        }