public void PatientRegisterTest() { //Arrange PatientsDAO patientDAO = new PatientsDAO(); HomeDAO homeDAO = new HomeDAO(); Patient patient = new Patient { PatientId = 90, Name = "Test Patient 2", Email = "*****@*****.**", Password = "******", PhoneNumber = "0888123456", Diagnose = "test", BloodGroup = "B-" }; //Act bool result = homeDAO.PatientRegister(patient); //Assert Assert.IsTrue(result); //Clean-Up patientDAO.DeletePatient(patient); }
public ActionResult Listar(string nome) { HomeDAO dao = new HomeDAO(); IList <Nome> nomes = dao.Lista(nome); return(View(nomes)); }
public void DonorRegisterTest() { //Arrange DonorsDAO donorsDAO = new DonorsDAO(); HomeDAO homeDAO = new HomeDAO(); Donor donor = new Donor(); donor.DonorId = 7; donor.Name = "Ralitsa Mladenova"; donor.Email = "*****@*****.**"; donor.Password = "******"; donor.PhoneNumber = "0888654321"; donor.Status = "Available"; donor.BloodGroup = "0+"; //Act bool result = homeDAO.DonorRegister(donor); //Assert Assert.IsTrue(result); //Clean-Up donorsDAO.DeleteDonor(donor); }
public ActionResult DealsOfTheWeek() { ArrayList model = new ArrayList(); var products = HomeDAO.LoadProductDealsOfTheWeek(); model.Add(products); return(PartialView(model)); }
public ActionResult Banner() { ArrayList model = new ArrayList(); var product = HomeDAO.LoadProductsToBaner(); model.Add(product); return(PartialView(model)); }
public ActionResult Trends() { ArrayList model = new ArrayList(); var listProducts = HomeDAO.LoadTrends(); model.Add(listProducts); return(PartialView(model)); }
public ActionResult TatCa() { Session["KM"] = null; var db = new HomeDAO(); Session["Title"] = "Tất Cả Sách"; Session["Products"] = db.GetList(); return(View("../DanhSachSanPham/Index")); }
public ActionResult XemNhieu() { Session["KM"] = null; var db = new HomeDAO(); Session["Title"] = "Xem nhiều"; Session["Products"] = db.GetListXemNhieuAll(); return(View("../DanhSachSanPham/Index")); }
public ActionResult Noibat() { Session["KM"] = null; var db = new HomeDAO(); Session["Title"] = "Nổi Bật"; Session["Products"] = db.GetListNoiBatAll(); return(View("../DanhSachSanPham/Index")); }
public ActionResult SachMoi() { Session["KM"] = null; var db = new HomeDAO(); Session["Title"] = "Sách Mới"; Session["Products"] = db.GetListSachMoiAll(); return(View("../DanhSachSanPham/Index")); }
public ActionResult MHMoi() { Session["CTBrand"] = null; Session["CTKhuyenMai"] = null; HomeDAO dao = new HomeDAO(); Session["Title"] = "Mô Hình Mới"; Session["Products"] = dao.GetListMoiAll(); return(RedirectToAction("Index", "MoHinhs")); }
public ActionResult XemNhieu() { Session["CTBrand"] = null; Session["CTKhuyenMai"] = null; HomeDAO dao = new HomeDAO(); Session["Title"] = "Mô Hình Được Xem Nhiều"; Session["Products"] = dao.GetListXemNhieuAll(); return(RedirectToAction("Index", "MoHinhs")); }
public ActionResult Search(string name, string loai, string nsx, string min, string max) { Session["CTBrand"] = null; Session["CTKhuyenMai"] = null; HomeDAO dao = new HomeDAO(); string title; Session["Products"] = dao.Search(name, loai, nsx, min, max, out title); Session["Title"] = title; return(RedirectToAction("Index", "MoHinhs")); }
public ActionResult MoHinh(int id) { Session["CTBrand"] = null; HomeDAO dao = new HomeDAO(); var db = new SanPhamContext(); var km = db.KhuyenMais.Find(id); Session["Title"] = "Mô Hình Của Chương Trình Khuyến Mãi: " + km.TenKM; Session["CTKhuyenMai"] = km; Session["Products"] = dao.GetListTheoKM(id); return(RedirectToAction("Index", "MoHinhs")); }
// GET: Home public ActionResult Index() { var dao = new HomeDAO(); View3Baidang view = new View3Baidang(); ViewBag.List = dao.ListAll(); view.v1 = dao.List_baidang("SK"); view.v2 = dao.List_baidang("TD"); view.v3 = dao.List_baidang("TS"); view.v4 = dao.ListAll(); return(View(view)); }
public ActionResult Featured() { ArrayList model = new ArrayList(); var special = HomeDAO.LoadProductSpecial(); var discount = HomeDAO.LoadProductDiscount(); var bestSell = HomeDAO.LoadProductBestSell(); model.Add(special); model.Add(discount); model.Add(bestSell); return(PartialView(model)); }
public ActionResult MoHinh(int id) { Session["CTKhuyenMai"] = null; HomeDAO dao = new HomeDAO(); var db = new SanPhamContext(); var brand = db.NSXs.Find(id); Session["CTBrand"] = brand; Session["Title"] = "Mô Hình Của " + brand.TenNSX; Session["Products"] = dao.GetListTheoNSX(id); return(RedirectToAction("Index", "MoHinhs")); }
public void EmailDoesNotExistInPatientsTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); string email = "*****@*****.**"; bool isDonor = false; //Act bool result = homeDAO.EmailAlreadyExists(email, isDonor); //Assert Assert.IsFalse(result); }
public void EmailExistsInPatientsTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); string email = "*****@*****.**"; bool isDonor = false; //Act bool result = homeDAO.EmailAlreadyExists(email, isDonor); //Assert Assert.IsTrue(result); }
public void EmailDoesNotExistInDonorsTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); string email = "*****@*****.**"; bool isDonor = true; //Act bool result = homeDAO.EmailAlreadyExists(email, isDonor); //Assert Assert.IsFalse(result); }
public void EmailExistsInDonorsTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); string email = "*****@*****.**"; bool isDonor = true; //Act bool result = homeDAO.EmailAlreadyExists(email, isDonor); //Assert Assert.IsTrue(result); }
// GET: MoHinhs public ActionResult Index(int?page) { if (Session["Products"] != null) { var list = Session["Products"] as List <WebApplication30.Models.SanPham>; return(View(list.ToPagedList(page ?? 1, 1))); } else { Session["Title"] = "Tất Cả"; HomeDAO dao = new HomeDAO(); return(View(dao.GetAll().ToPagedList(page ?? 1, 1))); } }
public static TrendingEntity[] GetTrendingData() //Show the details of the data after insert in HTML Table { var details = new List <TrendingEntity>(); try { details = new HomeDAO().GetTrendingList(); } catch (Exception ex) { // details.Add(new DbStatusEntity(ex.Message)); } return(details.ToArray()); }
public void ChangeDonorStatusTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); DonorsDAO donorsDAO = new DonorsDAO(); string email = "*****@*****.**"; string password = "******"; string expected = "Available"; //Act Donor donor = homeDAO.DonorLogin(email, password); donorsDAO.ChangeDonorStatus(donor); //Assert Assert.AreEqual(expected, donor.Status); }
public void PatientRegisterAlreadyExistingTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); Patient patient = new Patient(); patient.PatientId = 1; patient.Name = "Test Patient"; patient.Email = "*****@*****.**"; patient.Password = "******"; patient.PhoneNumber = "0888123456"; patient.Diagnose = "test"; patient.BloodGroup = "B-"; //Act bool result = homeDAO.PatientRegister(patient); //Assert Assert.IsFalse(result); }
public void TransfuseBloodTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); DonorsDAO donorsDAO = new DonorsDAO(); Patient testPatient = new Patient(); testPatient.Name = "test"; string email = "*****@*****.**"; string password = "******"; //Act Donor donor = homeDAO.DonorLogin(email, password); donorsDAO.TransfuseBlood(donor, testPatient); //Assert Assert.AreEqual(testPatient.Name, donor.Status); }
public void DonorRegisterAlreadyExistingTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); Donor donor = new Donor { DonorId = 2, Name = "Dimitur Petrov", Email = "*****@*****.**", Password = "******", PhoneNumber = "0881231234", Status = null, BloodGroup = "0+" }; //Act bool result = homeDAO.DonorRegister(donor); //Assert Assert.IsFalse(result); }
public void DeletePatientTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); PatientsDAO patientsDAO = new PatientsDAO(); Patient testPatient = new Patient(); testPatient.PatientId = 102; testPatient.Name = "Test Patient 2"; testPatient.Email = "*****@*****.**"; testPatient.Password = "******"; testPatient.PhoneNumber = "0888123456"; testPatient.Diagnose = "test"; testPatient.BloodGroup = "A+"; //Act homeDAO.PatientRegister(testPatient); patientsDAO.DeletePatient(testPatient); //Assert Assert.IsTrue(homeDAO.PatientLogin(testPatient.Email, testPatient.Password) == null); }
public void PatientLoginTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); string email = "*****@*****.**"; string password = "******"; Patient expected = new Patient { PatientId = 14, Name = "Nikolai Petrov", Email = "*****@*****.**", Password = "******", PhoneNumber = "0881231234", Diagnose = "Blood Cancer", BloodGroup = "A-" }; //Act Patient result = homeDAO.PatientLogin(email, HashPassword(password)); //Assert Assert.AreEqual(expected, result); }
public void DeleteDonorFromSystemTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); DonorsDAO donorsDAO = new DonorsDAO(); Donor testDonor = new Donor(); testDonor.DonorId = 101; testDonor.Name = "Test Donor 1"; testDonor.Email = "*****@*****.**"; testDonor.Password = "******"; testDonor.PhoneNumber = "0888123456"; testDonor.Status = null; testDonor.BloodGroup = "B-"; //Act homeDAO.DonorRegister(testDonor); donorsDAO.DeleteDonor(testDonor); //Assert Assert.IsTrue(homeDAO.DonorLogin(testDonor.Email, testDonor.Password) == null); }