public string AddHoSoBenhAn(QLPHONGKHAMEntities db, HoSoBenhAnDTO HoSoEntity) { HOSOBENHAN hoSoBenhAnDAO = new HOSOBENHAN(); BUS.Com.Utils.CopyPropertiesFrom(HoSoEntity, hoSoBenhAnDAO); return(hoSoBenhAnService.Save(db, hoSoBenhAnDAO)); }
public void Insert_TestCase2() { HOSOBENHAN hoSoBenhAn = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10 + "1", MaHoSoTruoc = TestCommon.LEN_10 + "1", MaHoSoGoc = TestCommon.LEN_10 + "1", MaLoaiHoSo = TestCommon.LEN_10 + "1", MaBenhNhan = TestCommon.LEN_10 + "1", MaNguoiTN = TestCommon.LEN_10 + "1", NgayTiepNhan = TestCommon.LEN_8 + "1", YeuCauKham = TestCommon.LEN_250 + "1", TrieuChung = TestCommon.LEN_250 + "1", NgayKham = TestCommon.LEN_8 + "1", SoThuTu = 1, MaPhongKham = TestCommon.LEN_10 + "1", MaBacSi = TestCommon.LEN_10 + "1", ChuanDoan = "abc", CoKeDon = true, }; HoSoBenhAnDAO dao = new HoSoBenhAnDAO(); string actual = dao.Save(db, hoSoBenhAn); string expected = "1111"; Assert.Equals(expected, actual); }
public void Update_TestCase10() { HoSoBenhAnDAO dao = new HoSoBenhAnDAO(); HOSOBENHAN hoSoBenhAn = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, MaLoaiHoSo = TestCommon.LEN_10, MaBenhNhan = TestCommon.LEN_10, MaNguoiTN = TestCommon.LEN_10, NgayTiepNhan = TestCommon.LEN_8, YeuCauKham = TestCommon.LEN_250, TrieuChung = TestCommon.LEN_250, NgayKham = TestCommon.LEN_8, SoThuTu = 1, MaPhongKham = TestCommon.LEN_10, MaBacSi = TestCommon.LEN_10, }; dao.Save(db, hoSoBenhAn); HOSOBENHAN hoSoBenhAnUpdate = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, MaLoaiHoSo = TestCommon.LEN_10, MaBenhNhan = TestCommon.LEN_10, MaNguoiTN = TestCommon.LEN_10, NgayTiepNhan = TestCommon.LEN_8, YeuCauKham = TestCommon.LEN_250, TrieuChung = TestCommon.LEN_250, NgayKham = TestCommon.LEN_8, SoThuTu = -1, MaPhongKham = TestCommon.LEN_10, MaBacSi = TestCommon.LEN_10 }; }
public void Insert_TestCase3() { HOSOBENHAN hoSoBenhAn = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, }; HoSoBenhAnDAO dao = new HoSoBenhAnDAO(); string actual = dao.Save(db, hoSoBenhAn); string expected = "1111"; Assert.Equals(expected, actual); }
public string GetRootHoSoBenhAn(QLPHONGKHAMEntities db, string MaHoSoTruoc, out HoSoBenhAnDTO hoSoBenhAnRoot) { hoSoBenhAnRoot = new HoSoBenhAnDTO(); HOSOBENHAN rootDAO = null; if (hoSoBenhAnService.GetRootHoSo(db, MaHoSoTruoc, out rootDAO) == COM.Constant.RES_FAI) { return(COM.Constant.RES_FAI); } BUS.Com.Utils.CopyPropertiesFrom(rootDAO, hoSoBenhAnRoot); return(COM.Constant.RES_SUC); }
public string DeleteHoSoBenhAn(QLPHONGKHAMEntities db, HoSoBenhAnDTO HoSoEntity) { object[] id = { HoSoEntity.MaHoSo }; HOSOBENHAN hoSoBenhAnDAO = null; if (hoSoBenhAnService.FindById(db, id, out hoSoBenhAnDAO) == COM.Constant.RES_FAI) { return(COM.Constant.RES_FAI); } if (hoSoBenhAnDAO == null) { return(COM.Constant.RES_FAI); } return(hoSoBenhAnService.Delete(db, hoSoBenhAnDAO)); }
public void Update_TestCase6() { HoSoBenhAnDAO dao = new HoSoBenhAnDAO(); HOSOBENHAN hoSoBenhAn = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, MaHoSoTruoc = TestCommon.LEN_10, MaHoSoGoc = TestCommon.LEN_10, MaLoaiHoSo = TestCommon.LEN_10, MaBenhNhan = TestCommon.LEN_10, MaNguoiTN = TestCommon.LEN_10, NgayTiepNhan = TestCommon.LEN_8, YeuCauKham = TestCommon.LEN_250, TrieuChung = TestCommon.LEN_250, NgayKham = TestCommon.LEN_8, SoThuTu = 1, MaPhongKham = TestCommon.LEN_10, MaBacSi = TestCommon.LEN_10, ChuanDoan = "abc", CoKeDon = true, }; dao.Save(db, hoSoBenhAn); HOSOBENHAN hoSoBenhAnUpdate = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, MaHoSoTruoc = TestCommon.LEN_10, MaHoSoGoc = TestCommon.LEN_10, MaLoaiHoSo = TestCommon.LEN_10, MaBenhNhan = TestCommon.LEN_10, MaNguoiTN = TestCommon.LEN_10, NgayTiepNhan = TestCommon.LEN_8, YeuCauKham = TestCommon.LEN_250, TrieuChung = TestCommon.LEN_250, NgayKham = TestCommon.LEN_8, SoThuTu = 1, MaPhongKham = TestCommon.LEN_10, MaBacSi = TestCommon.LEN_10, ChuanDoan = "TEST UPDATE", CoKeDon = true, }; string actual = dao.Save(db, hoSoBenhAnUpdate); // Biến kết quả string expected = "0000"; // Test Assert.Equals(expected, actual); }
public void Update_TestCase2() { HoSoBenhAnDTO hoSoBenhAnDTO = new HoSoBenhAnDTO { MaHoSo = TestCommon.LEN_10, MaHoSoTruoc = TestCommon.LEN_10, MaHoSoGoc = TestCommon.LEN_10, MaLoaiHoSo = TestCommon.LEN_10, MaBenhNhan = TestCommon.LEN_10, MaNguoiTN = TestCommon.LEN_10, NgayTiepNhan = TestCommon.LEN_8, YeuCauKham = TestCommon.LEN_250, TrieuChung = TestCommon.LEN_250, NgayKham = TestCommon.LEN_8, SoThuTu = 1, MaPhongKham = TestCommon.LEN_10, MaBacSi = TestCommon.LEN_10, ChuanDoan = "abc", CoKeDon = true, }; HoSoBenhAnBUS hoSoBenhAnBUS = new HoSoBenhAnBUS(); hoSoBenhAnBUS.AddHoSoBenhAn(db, hoSoBenhAnDTO); HOSOBENHAN hoSoBenhAnUpdate = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10 + "1", MaHoSoTruoc = TestCommon.LEN_10 + "1", MaHoSoGoc = TestCommon.LEN_10 + "1", MaLoaiHoSo = TestCommon.LEN_10 + "1", MaBenhNhan = TestCommon.LEN_10 + "1", MaNguoiTN = TestCommon.LEN_10 + "1", NgayTiepNhan = TestCommon.LEN_8 + "1", YeuCauKham = TestCommon.LEN_250 + "1", TrieuChung = TestCommon.LEN_250 + "1", NgayKham = TestCommon.LEN_8 + "1", SoThuTu = 1, MaPhongKham = TestCommon.LEN_10 + "1", MaBacSi = TestCommon.LEN_10 + "1", ChuanDoan = "abc", CoKeDon = true, }; string actual = hoSoBenhAnBUS.UpdateHoSoBenhAn(db, hoSoBenhAnDTO); string expected = "1111"; Assert.Equals(expected, actual); }
public void Delete_TestCase11() { HOSOBENHAN hoSoBenhAnUpdate = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, MaHoSoTruoc = TestCommon.LEN_10, MaHoSoGoc = TestCommon.LEN_10, MaLoaiHoSo = TestCommon.LEN_10, MaBenhNhan = TestCommon.LEN_10, MaNguoiTN = TestCommon.LEN_10, }; HoSoBenhAnDAO dao = new HoSoBenhAnDAO(); string actual = dao.Save(db, hoSoBenhAnUpdate); Assert.Equals(null, actual); }
public void Insert_TestCase4() { HOSOBENHAN hoSoBenhAn = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, MaLoaiHoSo = "1234", MaBenhNhan = "1234", MaNguoiTN = "1234", MaPhongKham = "1234", MaBacSi = "1234", }; HoSoBenhAnDAO dao = new HoSoBenhAnDAO(); string actual = dao.Save(db, hoSoBenhAn); string expected = "1111"; Assert.Equals(expected, actual); }
public string GetInfomationHoSo(QLPHONGKHAMEntities db, string MaHoSo, out HoSoBenhAnDTO HoSoEntity) { HoSoEntity = new HoSoBenhAnDTO(); object[] id = { MaHoSo }; HOSOBENHAN hoSoBenhAnDAO = null; if (hoSoBenhAnService.FindById(db, id, out hoSoBenhAnDAO) == COM.Constant.RES_FAI) { return(COM.Constant.RES_FAI); } if (hoSoBenhAnDAO == null) { return(COM.Constant.RES_FAI); } BUS.Com.Utils.CopyPropertiesFrom(hoSoBenhAnDAO, HoSoEntity); return(COM.Constant.RES_SUC); }
public void Update_TestCase9() { HoSoBenhAnDAO dao = new HoSoBenhAnDAO(); HOSOBENHAN hoSoBenhAn = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, MaLoaiHoSo = TestCommon.LEN_10, MaBenhNhan = TestCommon.LEN_10, MaNguoiTN = TestCommon.LEN_10, NgayTiepNhan = TestCommon.LEN_8, YeuCauKham = TestCommon.LEN_250, TrieuChung = TestCommon.LEN_250, NgayKham = TestCommon.LEN_8, SoThuTu = 1, MaPhongKham = TestCommon.LEN_10, MaBacSi = TestCommon.LEN_10, }; dao.Save(db, hoSoBenhAn); HOSOBENHAN hoSoBenhAnUpdate = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, MaLoaiHoSo = "12345", MaBenhNhan = "12345", MaNguoiTN = "12345", NgayTiepNhan = TestCommon.LEN_8, YeuCauKham = TestCommon.LEN_250, TrieuChung = TestCommon.LEN_250, NgayKham = TestCommon.LEN_8, SoThuTu = 1, MaPhongKham = "12345", MaBacSi = "12345", }; string actual = dao.Save(db, hoSoBenhAnUpdate); // Biến kết quả string expected = "1111"; // Test Assert.Equals(expected, actual); }
public void Update_TestCase8() { HoSoBenhAnDAO dao = new HoSoBenhAnDAO(); HOSOBENHAN hoSoBenhAn = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, MaLoaiHoSo = TestCommon.LEN_10, MaBenhNhan = TestCommon.LEN_10, }; dao.Save(db, hoSoBenhAn); HOSOBENHAN hoSoBenhAnUpdate = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, }; string actual = dao.Save(db, hoSoBenhAnUpdate); // Biến kết quả string expected = "1111"; // Test Assert.Equals(expected, actual); }
public void Update_TestCase3() { HoSoBenhAnDTO hoSoBenhAnDTO = new HoSoBenhAnDTO { MaHoSo = TestCommon.LEN_10, MaLoaiHoSo = TestCommon.LEN_10, MaBenhNhan = TestCommon.LEN_10, }; HoSoBenhAnBUS hoSoBenhAnBUS = new HoSoBenhAnBUS(); hoSoBenhAnBUS.AddHoSoBenhAn(db, hoSoBenhAnDTO); HOSOBENHAN hoSoBenhAnUpdate = new HOSOBENHAN { MaHoSo = TestCommon.LEN_10, }; string actual = hoSoBenhAnBUS.UpdateHoSoBenhAn(db, hoSoBenhAnDTO); string expected = "1111"; Assert.Equals(expected, actual); }