Пример #1
0
        public void CheckUniqueDate()
        {
            //arrange
            DateTime      fromDate = new DateTime(2017, 02, 13);
            AttandanceDAL attDal   = new AttandanceDAL();

            //act
            var result = attDal.CheckDateUnique(fromDate, 2);

            //Assert
            Assert.AreEqual(false, result);
        }
Пример #2
0
        public ActionResult AtCheckIn()
        {
            var      attanceDao  = new AttandanceDAL();
            UsersDAL userDAL     = new UsersDAL();
            var      modelUser   = userDAL.GetUser(User.Identity.Name);
            int      userID      = modelUser.UserID;
            var      resultAttan = attanceDao.CheckIn(userID);

            if (resultAttan == 1)
            {
                TempData["msg"] = "Điểm Danh Thành Công";
                Session.Add(CommonConstants.CHECKED, "checked");
            }

            return(View("AtIndex", atDAL.ListAllOfUser(userID)));
        }
Пример #3
0
        public void CheckCongThemTest()
        {
            //arrange
            DateTime fromDate = new DateTime(2017, 02, 12);
            DateTime toDate   = new DateTime(2017, 02, 15);
            var      model    = new UserEventCreateViewModel();

            model.UeID          = 3;
            model.UeCreateDate  = DateTime.Now;
            model.UeDateExpires = fromDate.Date;
            model.UeWillExpires = toDate.Date;
            model.UserID        = 1;

            AttandanceDAL modelAtt = new AttandanceDAL();
            var           expected = 1;

            //act
            var actual = modelAtt.CheckCongThem(model);

            //assert
            Assert.AreEqual(expected, actual);
        }
Пример #4
0
 public AttandanceController()
 {
     atDAL = new AttandanceDAL();
 }