public void NUnit_CardHistory_Domain_GetById()
 {
     Att_RosterServices service = new Att_RosterServices();
     var model = new Att_Roster { Id = 1 };
     string status = string.Empty;
     var result = service.GetById<Att_RosterEntity>(model.Id, ref status) as Att_RosterEntity;
     NUnit.Framework.Assert.IsNotNull(result);
     Console.Write("SearchResult: " + result.Id
         + " | " + result.ProfileID
         + " | " + result.Comment
         );
 }
        public void NUnit_CardHistory_Domain_GetById()
        {
            Att_RosterServices service = new Att_RosterServices();
            var model = new Att_Roster {
                Id = 1
            };
            string status = string.Empty;
            var    result = service.GetById <Att_RosterEntity>(model.Id, ref status) as Att_RosterEntity;

            NUnit.Framework.Assert.IsNotNull(result);
            Console.Write("SearchResult: " + result.Id
                          + " | " + result.ProfileID
                          + " | " + result.Comment
                          );
        }
        public void NUnit_CardHistory_Domain_Delete()
        {
            Att_RosterServices service = new Att_RosterServices();
            int rs    = 0;
            var model = new Att_Roster {
                Id = 2
            };
            string result = service.Delete <Att_RosterEntity>(model.Id);

            if (result != null)
            {
                rs += 1;
                Console.WriteLine("Process Success >>> Delete >>> " + model.Id);
            }
        }
        public void NUnit_CardHistory_Domain_Remove()
        {
            Att_RosterServices service = new Att_RosterServices();
            int rs    = 0;
            var model = new Att_Roster {
                Id = 1
            };
            string result = service.Remove <Att_RosterEntity>(model.Id);

            if (result != string.Empty)
            {
                rs += 1;
                Console.WriteLine("Process Success >>> Remove >>> " + model.Id);
            }
        }
 public void NUnit_CardHistory_Domain_Edit()
 {
     Att_RosterServices service = new Att_RosterServices();
     var model = new Att_Roster
     {
         Id = 1,
         ProfileID = 1,
         Comment = "Update Name ",
     };
     string result = service.Edit(model);
     if (result != string.Empty)
     {
         Console.WriteLine("Process Success >>> Update >>> " + model.Id
                 + " | " + model.ProfileID
                 + " | " + model.Comment
                 );
     }
 }
        public void NUnit_CardHistory_Domain_Edit()
        {
            Att_RosterServices service = new Att_RosterServices();
            var model = new Att_Roster
            {
                Id        = 1,
                ProfileID = 1,
                Comment   = "Update Name ",
            };
            string result = service.Edit(model);

            if (result != string.Empty)
            {
                Console.WriteLine("Process Success >>> Update >>> " + model.Id
                                  + " | " + model.ProfileID
                                  + " | " + model.Comment
                                  );
            }
        }
 public void NUnit_CardHistory_Domain_Add()
 {
     Att_RosterServices service = new Att_RosterServices();
     string result = string.Empty;
     int countSC = 0;
     for (int i = 1; i <= 10; i++)
     {
         var model = new Att_Roster
         {
             ProfileID = 1,
             Comment = "Comment " + i
         };
         result = service.Add(model);
         if (result != string.Empty)
         {
             countSC += 1;
             Console.WriteLine("Process Success >>> Create >>> " + model.Id
                 + " | " + model.Comment
                 );
         }
     }
     Console.WriteLine("Total success record: " + countSC);
 }
        public void NUnit_CardHistory_Domain_Add()
        {
            Att_RosterServices service = new Att_RosterServices();
            string             result  = string.Empty;
            int countSC = 0;

            for (int i = 1; i <= 10; i++)
            {
                var model = new Att_Roster
                {
                    ProfileID = 1,
                    Comment   = "Comment " + i
                };
                result = service.Add(model);
                if (result != string.Empty)
                {
                    countSC += 1;
                    Console.WriteLine("Process Success >>> Create >>> " + model.Id
                                      + " | " + model.Comment
                                      );
                }
            }
            Console.WriteLine("Total success record: " + countSC);
        }
 public void NUnit_WorkDay_Domain_SummaryInOut()
 {
     #region listShift
     using (var contextCategory = new VnrHrmDataContext())
     {
         List <Cat_Shift> listShift = new List <Cat_Shift>();
         Cat_Shift        _shift    = new Cat_Shift()
         {
             Id         = 1,
             ShiftName  = "Ca Test",
             InTime     = DateTime.Parse("01-09-14 08:00:00"),
             CoOut      = 9,
             CoBreakIn  = 4,
             CoBreakOut = 5,
         };
         listShift.Add(_shift);
         contextCategory.Cat_Shift.Add(_shift);
         contextCategory.SaveChanges();
     }
     #endregion
     #region listRoster
     using (var contextAtt = new VnrHrmDataContext())
     {
         List <Att_Roster> listRoster = new List <Att_Roster>();
         Att_Roster        _roster    = new Att_Roster()
         {
             ProfileID       = 1,
             RosterGroupName = "Nhom 1",
             Type            = "E_DEFAULT",
             Status          = "",
             DateEnd         = DateTime.Parse("01-03-2014"),
             DateStart       = DateTime.Parse("01-02-2014"),
             MonShiftID      = 1,
             TueShiftID      = 1,
             WedShiftID      = 1,
             ThuShiftID      = 1,
             FriShiftID      = 1,
             SatShiftID      = 1,
             SunShiftID      = 1
         };
         listRoster.Add(_roster);
         contextAtt.Att_Roster.Add(_roster);
         contextAtt.SaveChanges();
         #endregion
         #region listTamScanLog
         List <Att_TAMScanLog> listTamScanLog = new List <Att_TAMScanLog>();
         Att_TAMScanLog        _tamScanLog1   = new Att_TAMScanLog()
         {
             CardCode = "123",
             TimeLog  = DateTime.Parse("01-02-2014 08:00:00"),
             SrcType  = "E_IN",
             Type     = ""
         };
         Att_TAMScanLog _tamScanLog2 = new Att_TAMScanLog()
         {
             CardCode = "123",
             TimeLog  = DateTime.Parse("01-02-2014 17:00:00"),
             SrcType  = "E_OUT",
             Type     = ""
         };
         Att_TAMScanLog _tamScanLog3 = new Att_TAMScanLog()
         {
             CardCode = "123",
             TimeLog  = DateTime.Parse("02-02-2014 08:00:00"),
             SrcType  = "E_IN",
             Type     = ""
         };
         Att_TAMScanLog _tamScanLog4 = new Att_TAMScanLog()
         {
             CardCode = "123",
             TimeLog  = DateTime.Parse("02-02-2014 17:00:00"),
             SrcType  = "E_OUT",
             Type     = ""
         };
         listTamScanLog.Add(_tamScanLog1);
         listTamScanLog.Add(_tamScanLog2);
         listTamScanLog.Add(_tamScanLog3);
         listTamScanLog.Add(_tamScanLog4);
         contextAtt.Att_TAMScanLog.Add(_tamScanLog1);
         contextAtt.Att_TAMScanLog.Add(_tamScanLog2);
         contextAtt.Att_TAMScanLog.Add(_tamScanLog3);
         contextAtt.Att_TAMScanLog.Add(_tamScanLog4);
         contextAtt.SaveChanges();
     }
     #endregion
     # region CardHistory
     using (var contextHr = new VnrHrmDataContext())
        public void NUnit_WorkDay_Domain_SummaryInOut()
        {
            #region listShift
            using (var contextCategory = new VnrHrmDataContext())
            {
                List<Cat_Shift> listShift = new List<Cat_Shift>();
                Cat_Shift _shift = new Cat_Shift()
                {
                    Id = 1,
                    ShiftName = "Ca Test",
                    InTime = DateTime.Parse("01-09-14 08:00:00"),
                    CoOut = 9,
                    CoBreakIn = 4,
                    CoBreakOut = 5,
                };
                listShift.Add(_shift);
                contextCategory.Cat_Shift.Add(_shift);
                contextCategory.SaveChanges();
            }
            #endregion
            #region listRoster
            using (var contextAtt = new VnrHrmDataContext())
            {
                List<Att_Roster> listRoster = new List<Att_Roster>();
                Att_Roster _roster = new Att_Roster()
                {
                    ProfileID = 1,
                    RosterGroupName = "Nhom 1",
                    Type = "E_DEFAULT",
                    Status = "",
                    DateEnd = DateTime.Parse("01-03-2014"),
                    DateStart = DateTime.Parse("01-02-2014"),
                    MonShiftID = 1,
                    TueShiftID = 1,
                    WedShiftID = 1,
                    ThuShiftID = 1,
                    FriShiftID = 1,
                    SatShiftID = 1,
                    SunShiftID = 1
                };
                listRoster.Add(_roster);
                contextAtt.Att_Roster.Add(_roster);
                contextAtt.SaveChanges();
                #endregion
                #region listTamScanLog
                List<Att_TAMScanLog> listTamScanLog = new List<Att_TAMScanLog>();
                Att_TAMScanLog _tamScanLog1 = new Att_TAMScanLog()
                {
                    CardCode = "123",
                    TimeLog = DateTime.Parse("01-02-2014 08:00:00"),
                    SrcType = "E_IN",
                    Type = ""
                };
                Att_TAMScanLog _tamScanLog2 = new Att_TAMScanLog()
                {
                    CardCode = "123",
                    TimeLog = DateTime.Parse("01-02-2014 17:00:00"),
                    SrcType = "E_OUT",
                    Type = ""
                };
                Att_TAMScanLog _tamScanLog3 = new Att_TAMScanLog()
                {
                    CardCode = "123",
                    TimeLog = DateTime.Parse("02-02-2014 08:00:00"),
                    SrcType = "E_IN",
                    Type = ""
                };
                Att_TAMScanLog _tamScanLog4 = new Att_TAMScanLog()
                {
                    CardCode = "123",
                    TimeLog = DateTime.Parse("02-02-2014 17:00:00"),
                    SrcType = "E_OUT",
                    Type = ""
                };
                listTamScanLog.Add(_tamScanLog1);
                listTamScanLog.Add(_tamScanLog2);
                listTamScanLog.Add(_tamScanLog3);
                listTamScanLog.Add(_tamScanLog4);
                contextAtt.Att_TAMScanLog.Add(_tamScanLog1);
                contextAtt.Att_TAMScanLog.Add(_tamScanLog2);
                contextAtt.Att_TAMScanLog.Add(_tamScanLog3);
                contextAtt.Att_TAMScanLog.Add(_tamScanLog4);
                contextAtt.SaveChanges();
            }
            #endregion
            # region CardHistory
            using (var contextHr = new VnrHrmDataContext())
            {
                List<Hre_CardHistory> listcardhistory = new List<Hre_CardHistory>();
                Hre_CardHistory cardhistory = new Hre_CardHistory()
                {
                    ProfileID = 1,
                    CardCode = "123",
                    DateEffect = DateTime.Parse("01-01-2014")
                };
                listcardhistory.Add(cardhistory);
                contextHr.Hre_CardHistory.Add(cardhistory);
                contextHr.SaveChanges();
            }
            #endregion
            DateTime dateFrom = DateTime.Parse("01-02-2014");
            DateTime dateTo = DateTime.Parse("01-03-2014");

            List<int> listSelectedProfileID = new List<int>(){1,2};

            Att_WorkDayServices service = new Att_WorkDayServices();
            //List<Att_WorkDayEntity> ListInOut = service.SummaryInOut(dateFrom, dateTo, listSelectedProfileID);
        }
Example #11
0
 public void NUnit_CardHistory_Domain_Remove()
 {
     Att_RosterServices service = new Att_RosterServices();
     int rs = 0;
     var model = new Att_Roster { Id = 1 };
     string result = service.Remove<Att_RosterEntity>(model.Id);
     if (result != string.Empty)
     {
         rs += 1;
         Console.WriteLine("Process Success >>> Remove >>> " + model.Id);
     }
 }
Example #12
0
 public void NUnit_CardHistory_Domain_Delete()
 {
     Att_RosterServices service = new Att_RosterServices();
     int rs = 0;
     var model = new Att_Roster { Id = 2 };
     string result = service.Delete<Att_RosterEntity>(model.Id);
     if (result != null)
     {
         rs += 1;
         Console.WriteLine("Process Success >>> Delete >>> " + model.Id);
     }
 }