Пример #1
0
 public void NUnit_Domain_GetByIdCatDayOff()
 {
     Cat_DayOffServices service = new Cat_DayOffServices();
     var DayOff = new Cat_DayOff { Id = 2 };
     string status = string.Empty;
     var result = service.GetById<Cat_DayOff>(DayOff.Id, ref status) ;
     NUnit.Framework.Assert.IsNotNull(result);
     Console.Write("SearchResult: " + result.Id + " | " + result.DateOff + " | " + result.Type + " | " + result.Status + " | " + result.Comments + " | " + result.OrgStructureID + " | " + result.IsLeaveDay);
 }
Пример #2
0
        public void NUnit_Domain_GetByIdCatDayOff()
        {
            Cat_DayOffServices service = new Cat_DayOffServices();
            var DayOff = new Cat_DayOff {
                Id = 2
            };
            string status = string.Empty;
            var    result = service.GetById <Cat_DayOff>(DayOff.Id, ref status);

            NUnit.Framework.Assert.IsNotNull(result);
            Console.Write("SearchResult: " + result.Id + " | " + result.DateOff + " | " + result.Type + " | " + result.Status + " | " + result.Comments + " | " + result.OrgStructureID + " | " + result.IsLeaveDay);
        }
Пример #3
0
 public void NUnit_Domain_UpdateCatDayOff()
 {
     Cat_DayOffServices service = new Cat_DayOffServices();
     var DayOff = new Cat_DayOff
     {
         Id = 12,
         Type = "ABCDomain12",
         Status = "BC-12",
     };
  //   NUnit.Framework.Assert.IsTrue(result);
     if (service.Edit<Cat_DayOff>(DayOff) == ActionStatus.EditSucceed.ToString())
     {
         Console.WriteLine("==>>> Result After Update:  " + DayOff.Id + " | " + DayOff.DateOff + " | " + DayOff.Type + " | " + DayOff.Status + " | " + DayOff.Comments + " | " + DayOff.OrgStructureID + " | " + DayOff.IsLeaveDay);
     }
 }
Пример #4
0
        public void NUnit_Domain_UpdateCatDayOff()
        {
            Cat_DayOffServices service = new Cat_DayOffServices();
            var DayOff = new Cat_DayOff
            {
                Id     = 12,
                Type   = "ABCDomain12",
                Status = "BC-12",
            };

            //   NUnit.Framework.Assert.IsTrue(result);
            if (service.Edit <Cat_DayOff>(DayOff) == ActionStatus.EditSucceed.ToString())
            {
                Console.WriteLine("==>>> Result After Update:  " + DayOff.Id + " | " + DayOff.DateOff + " | " + DayOff.Type + " | " + DayOff.Status + " | " + DayOff.Comments + " | " + DayOff.OrgStructureID + " | " + DayOff.IsLeaveDay);
            }
        }
Пример #5
0
        public void NUnit_Domain_DeleteCatDayOff()
        {
            Cat_DayOffServices service = new Cat_DayOffServices();
            int rs = 0;
            for (int i = 1; i <= 10; i++)
            {
                var DayOff = new Cat_DayOff { Id = i };
                if (service.Delete<Cat_DayOff>(DayOff.Id) == ActionStatus.DeleteSucceed.ToString())
                {
                    rs += 1;
                    Console.WriteLine("Process Success >>> Delete >>> " + i);
                }
            }
            Console.WriteLine("Total success record: " + rs);

            //NUnit.Framework.Assert.IsTrue(result);
        }
Пример #6
0
 /// <summary>
 /// Thêm mới một record
 /// </summary>
 /// <param name="cat"></param>
 /// <returns></returns>
 public bool Add(Cat_DayOff cat)
 {
     using (var context = new VnrAttendanceDataContext())
     {
         IUnitOfWork unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
         Cat_DayOffRepository repo = new Cat_DayOffRepository(unitOfWork);
         try
         {
             repo.Add(cat);
             repo.SaveChanges();
             return true;
         }
         catch
         {
             return false;
         }
     }
 }
Пример #7
0
 /// <summary>
 /// Edit một record
 /// </summary>
 /// <param name="cat"></param>
 /// <returns></returns>
 public bool Edit(Cat_DayOff cat)
 {
     using (var context = new VnrAttendanceDataContext())
     {
         IUnitOfWork          unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
         Cat_DayOffRepository repo       = new Cat_DayOffRepository(unitOfWork);
         try
         {
             repo.Edit(cat);
             repo.SaveChanges();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }
Пример #8
0
 public void NUnit_Domain_AddCatDayOff()
 {
     Cat_DayOffServices service = new Cat_DayOffServices();
     int rs = 0;
     for (int i = 0; i < 10; i++)
     {
         var DayOff = new Cat_DayOff
         {
             Type = "NUnit Domain DayOffName " + i,
             Status = "NUnit-DayOffCode-" + i,
         };
         if (service.Add<Cat_DayOff>(DayOff) == ActionStatus.AddSucceed.ToString())
         {
             rs += 1;
             Console.WriteLine("Process Success >>> Create >>> " + DayOff.Id + " | " + DayOff.DateOff + " | " + DayOff.Type + " | " + DayOff.Status + " | " + DayOff.Comments + " | " + DayOff.OrgStructureID + " | " + DayOff.IsLeaveDay);
         }
     }
     Console.WriteLine("Total success record: " + rs);
 }
Пример #9
0
        public void NUnit_Domain_DeleteCatDayOff()
        {
            Cat_DayOffServices service = new Cat_DayOffServices();
            int rs = 0;

            for (int i = 1; i <= 10; i++)
            {
                var DayOff = new Cat_DayOff {
                    Id = i
                };
                if (service.Delete <Cat_DayOff>(DayOff.Id) == ActionStatus.DeleteSucceed.ToString())
                {
                    rs += 1;
                    Console.WriteLine("Process Success >>> Delete >>> " + i);
                }
            }
            Console.WriteLine("Total success record: " + rs);

            //NUnit.Framework.Assert.IsTrue(result);
        }
Пример #10
0
        public void NUnit_Domain_AddCatDayOff()
        {
            Cat_DayOffServices service = new Cat_DayOffServices();
            int rs = 0;

            for (int i = 0; i < 10; i++)
            {
                var DayOff = new Cat_DayOff
                {
                    Type   = "NUnit Domain DayOffName " + i,
                    Status = "NUnit-DayOffCode-" + i,
                };
                if (service.Add <Cat_DayOff>(DayOff) == ActionStatus.AddSucceed.ToString())
                {
                    rs += 1;
                    Console.WriteLine("Process Success >>> Create >>> " + DayOff.Id + " | " + DayOff.DateOff + " | " + DayOff.Type + " | " + DayOff.Status + " | " + DayOff.Comments + " | " + DayOff.OrgStructureID + " | " + DayOff.IsLeaveDay);
                }
            }
            Console.WriteLine("Total success record: " + rs);
        }