public void NUnit_CardHistory_Domain_GetById()
 {
     string status = string.Empty;
     Hre_CardHistoryServices service = new Hre_CardHistoryServices();
     var model = new Hre_CardHistory { Id = 2 };
     var result = service.GetById<Hre_CardHistoryEntity>(model.Id, ref status) as Hre_CardHistoryEntity;
     NUnit.Framework.Assert.IsNotNull(result);
     Console.Write("SearchResult: " + result.Id 
         + " | " + result.ProfileID
         + " | " + result.CardCode 
         );
 }
Exemplo n.º 2
0
        public void NUnit_CardHistory_Domain_GetById()
        {
            string status = string.Empty;
            Hre_CardHistoryServices service = new Hre_CardHistoryServices();
            var model = new Hre_CardHistory {
                Id = 2
            };
            var result = service.GetById <Hre_CardHistoryEntity>(model.Id, ref status) as Hre_CardHistoryEntity;

            NUnit.Framework.Assert.IsNotNull(result);
            Console.Write("SearchResult: " + result.Id
                          + " | " + result.ProfileID
                          + " | " + result.CardCode
                          );
        }
Exemplo n.º 3
0
        public void NUnit_CardHistory_Domain_Delete()
        {
            Hre_CardHistoryServices service = new Hre_CardHistoryServices();
            int rs    = 0;
            var model = new Hre_CardHistory {
                Id = 3
            };
            string result = service.Delete <Hre_CardHistoryEntity>(model.Id);

            if (result != null)
            {
                rs += 1;
                Console.WriteLine("Process Success >>> Delete >>> " + model.Id);
            }
        }
 public void NUnit_CardHistory_Domain_Edit()
 {
     Hre_CardHistoryServices service = new Hre_CardHistoryServices();
     var model = new Hre_CardHistory
     {
         Id = 1,
         ProfileID = 1,
         CardCode = "Update Name ",
     };
     string result = service.Edit(model);
     if (result != string.Empty)
     {
         Console.WriteLine("Process Success >>> Update >>> " + model.Id
                 + " | " + model.ProfileID
                 + " | " + model.CardCode
                 );
     }
 }
Exemplo n.º 5
0
        public void NUnit_CardHistory_Domain_Edit()
        {
            Hre_CardHistoryServices service = new Hre_CardHistoryServices();
            var model = new Hre_CardHistory
            {
                Id        = 1,
                ProfileID = 1,
                CardCode  = "Update Name ",
            };
            string result = service.Edit(model);

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

            for (int i = 1; i <= 10; i++)
            {
                var model = new Hre_CardHistory
                {
                    ProfileID = 1,
                    CardCode  = "CardCode " + i
                };
                result = service.Add(model);
                if (result != string.Empty)
                {
                    countSC += 1;
                    Console.WriteLine("Process Success >>> Create >>> " + model.Id
                                      + " | " + model.CardCode
                                      );
                }
            }
            Console.WriteLine("Total success record: " + countSC);
        }
Exemplo n.º 8
0
        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);
        }
 public void NUnit_CardHistory_Domain_Remove()
 {
     Hre_CardHistoryServices service = new Hre_CardHistoryServices();
     int rs = 0;
     var model = new Hre_CardHistory { Id = 2 };
     string result = service.Remove<Hre_CardHistoryEntity>(model.Id);
     if (result != null)
     {
         rs += 1;
         Console.WriteLine("Process Success >>> Remove >>> " + model.Id);
     }
 }