Exemplo n.º 1
0
        private string CheckExist(TiepNhanEntity entity, ref List <string> Messages)
        {
            HoSoBenhAnBUS hoSoBenhAnBUS = new HoSoBenhAnBUS();
            PhongKhamBUS  phongKhamBUS  = new PhongKhamBUS();
            NhanVienBUS   nhanVienBUS   = new NhanVienBUS();

            using (QLPHONGKHAMEntities db = new QLPHONGKHAMEntities())
            {
                if (entity.MaLoaiHoSo != Com.BusConstant.HS_KHAMMOI && entity.MaLoaiHoSo != BUS.Com.BusConstant.HS_TAIKHAM)
                {
                    Messages.Add("Loại hồ sơ không tồn tại!");
                    return(Constant.RES_FAI);
                }

                HoSoBenhAnDTO hoSoBenhAn = new HoSoBenhAnDTO();
                if (hoSoBenhAnBUS.GetInfomationHoSo(db, entity.MaHoSoTruoc, out hoSoBenhAn) == Constant.RES_FAI && entity.MaLoaiHoSo == Com.BusConstant.HS_TAIKHAM)
                {
                    Messages.Add("Hồ sơ bệnh án trước không tồn tại!");
                    return(Constant.RES_FAI);
                }
                PhongKhamDTO phong = new PhongKhamDTO();
                if (phongKhamBUS.GetInformationPhongKham(db, entity.MaPhongKham, out phong) == Constant.RES_FAI)
                {
                    Messages.Add("Phòng khám không tồn tại!");
                    return(Constant.RES_FAI);
                }
                NhanVienDTO nhanVien = new NhanVienDTO();
                if (nhanVienBUS.GetInfomationNhanVien(db, entity.MaNguoiTN, out nhanVien) == Constant.RES_FAI)
                {
                    Messages.Add("Nhân viên tiếp nhận không tồn tại!");
                    return(Constant.RES_FAI);
                }
            }
            return(Constant.RES_SUC);
        }
Exemplo n.º 2
0
        // lay thong tin phong
        public string GetInformationPhong(string MaPhong, out PhongKhamDTO phong)
        {
            PhongKhamBUS phongKhamBUS = new PhongKhamBUS();

            using (QLPHONGKHAMEntities db = new QLPHONGKHAMEntities())
            {
                return(phongKhamBUS.GetInformationPhongKham(db, MaPhong, out phong));
            }
        }
Exemplo n.º 3
0
        public void GetInformation_TestCase2()
        {
            PhongKhamDTO phongKhamDTO = null;

            PhongKhamBUS phongKhamBUS = new PhongKhamBUS();



            string actual   = phongKhamBUS.GetInformationPhongKham(db, "1234567890", out phongKhamDTO);
            string expected = "1111";

            Assert.Equals(actual, expected);
        }
Exemplo n.º 4
0
        // LẤY THÔNG TIN XÉT NGHIỆM
        public string GetInforPhong(string MaPhong, out PhongKhamDTO phong)
        {
            phong = new PhongKhamDTO();
            PhongKhamBUS bus = new PhongKhamBUS();

            using (QLPHONGKHAMEntities db = new QLPHONGKHAMEntities())
            {
                if (bus.GetInformationPhongKham(db, MaPhong, out phong) == Constant.RES_FAI)
                {
                    return(Constant.RES_FAI);
                }
            }
            return(Constant.RES_SUC);
        }
Exemplo n.º 5
0
        public string GetInformationPhongKham(QLPHONGKHAMEntities db, string MaPhongKham, out PhongKhamDTO InformationPhongKham)
        {
            InformationPhongKham = new PhongKhamDTO();
            PHONG entity = null;

            object[] id = { MaPhongKham };
            if (phongKhamService.FindById(db, id, out entity) == Constant.RES_FAI)
            {
                return(Constant.RES_FAI);
            }
            if (entity == null)
            {
                return(Constant.RES_FAI);
            }
            BUS.Com.Utils.CopyPropertiesFrom(entity, InformationPhongKham);
            return(Constant.RES_SUC);
        }
Exemplo n.º 6
0
        public void GetInformation_TestCase1()
        {
            // create data search
            db.PHONGs.Add(new PHONG {
                MaPhong = "1234567890"
            });
            db.PHONGs.Add(new PHONG {
                MaPhong = "1234567891"
            });
            db.PHONGs.Add(new PHONG {
                MaPhong = "1234567892"
            });

            PhongKhamDTO phongKhamDTO = null;

            PhongKhamBUS phongKhamBUS = new PhongKhamBUS();



            string actual   = phongKhamBUS.GetInformationPhongKham(db, "1234567890", out phongKhamDTO);
            string expected = "0000";

            Assert.Equals(actual, expected);
        }
Exemplo n.º 7
0
        public string GetListPhongKham(QLPHONGKHAMEntities db, out List <PhongKhamDTO> ListPhongKham)
        {
            ListPhongKham = new List <PhongKhamDTO>();
            List <PHONG> listObjectDAO = null;

            if (phongKhamService.Select(db, out listObjectDAO) == Constant.RES_FAI)
            {
                return(Constant.RES_FAI);
            }
            if (listObjectDAO == null)
            {
                return(Constant.RES_FAI);
            }
            foreach (PHONG pk in listObjectDAO)
            {
                PhongKhamDTO PhongKhamDTO = new PhongKhamDTO();
                if (pk.GhiChu == Com.BusConstant.KHAM)
                {
                    BUS.Com.Utils.CopyPropertiesFrom(pk, PhongKhamDTO);
                    ListPhongKham.Add(PhongKhamDTO);
                }
            }
            return(Constant.RES_SUC);
        }