Ejemplo n.º 1
0
 private static void SelectValidHourEntries(DataAccessLayer.ValidHourEntry objVHE)
 {
     Console.WriteLine("Current Data in Projects");
     foreach (DataAccessLayer.ValidHourEntry Row in objVHE.SelValidHourEntries())
     {
         Console.WriteLine("  TimePeriodID:{0}\n  TimePeriod:{1}\n", Row.TimePeriodID, Row.TimePeriod);
     }
     Console.WriteLine("---------------------------");
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            int NewID = -1, RC;
            bool ShowEmployeesTest = true;
            bool ShowProjectsTest = true;
            bool ShowEmployeeProjectHoursTest = true;
            bool ShowThisYearsDatesTest = false;
            bool ShowValidHourEntriesTest = false;

            #region Employees Test
            if (ShowEmployeesTest)
            {
                DataAccessLayer.Employee objE = new DataAccessLayer.Employee();
                Console.WriteLine("++++ Testing: Employees ++++");

                RC = objE.InsEmployee("Emp1", out NewID);
                Console.WriteLine("Insert = RC: {0} and NewID: {1}", RC, NewID);
                SelectEmployees(objE);

                RC = objE.UpdEmployee(NewID, "Emp1A");
                Console.WriteLine("Update = RC: {0}", RC);
                SelectEmployees(objE);

                RC = objE.DelEmployee(NewID);
                Console.WriteLine("Del = RC: {0}", RC);
                SelectEmployees(objE); 
                Console.WriteLine("\n"); 
            }
            #endregion

            #region Projects Test
            if (ShowProjectsTest)
            {
                DataAccessLayer.Project objP = new DataAccessLayer.Project();
                Console.WriteLine("++++ Testing: Projects ++++");

                RC = objP.InsProject("Project1000", "DescA", out NewID);
                Console.WriteLine("Insert = RC: {0} and NewID: {1}", RC, NewID);
                SelectProjects(objP);

                RC = objP.UpdProject(NewID, "Project1100", "DescZ");
                Console.WriteLine("Update = RC: {0}", RC);
                SelectProjects(objP);

                RC = objP.DelProject(NewID);
                Console.WriteLine("Del = RC: {0}", RC);
                SelectProjects(objP);
                Console.WriteLine("\n"); 
            }
            #endregion
             
            #region EmployeeProjectHours Test
            if (ShowEmployeeProjectHoursTest)
            {
                DataAccessLayer.EmployeeProjectHour objEPH = new DataAccessLayer.EmployeeProjectHour();
                Console.WriteLine("++++ Testing: EmployeeProjectHours ++++");

                RC = objEPH.InsEmployeeProjectHour(2, 100, DateTime.Parse("2016/01/03"), 17);
                Console.WriteLine("Insert = RC: {0} and NewID: {1}", RC, NewID);
                SelectEmployeeProjectHours(objEPH);

                RC = objEPH.UpdEmployeeProjectHour(2, 100, DateTime.Parse("2016/01/03"), 7);
                Console.WriteLine("Update = RC: {0}", RC);
                SelectEmployeeProjectHours(objEPH);

                RC = objEPH.DelEmployeeProjectHour(2, 100, DateTime.Parse("2016/01/03"));
                Console.WriteLine("Del = RC: {0}", RC);
                SelectEmployeeProjectHours(objEPH);
                Console.WriteLine("\n"); 
            }
            #endregion

            #region ThisYearsDates Test
            if (ShowThisYearsDatesTest)
            {
                DataAccessLayer.ThisYearsDate objTYD = new DataAccessLayer.ThisYearsDate();
                Console.WriteLine("++++ Testing: ValidHourEntries ++++");
                SelectThisYearsDates(objTYD);
                Console.ReadLine(); 
            }
            #endregion

            #region ValidHourEntries Test
            if (ShowValidHourEntriesTest)
            {
                DataAccessLayer.ValidHourEntry objVHE = new DataAccessLayer.ValidHourEntry();
                Console.WriteLine("++++ Testing: ValidHourEntries ++++");
                SelectValidHourEntries(objVHE);
            }
            #endregion

            Console.WriteLine("Press any key to quit");
            Console.ReadLine(); 
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            int  NewID = -1, RC;
            bool ShowEmployeesTest            = true;
            bool ShowProjectsTest             = true;
            bool ShowEmployeeProjectHoursTest = true;
            bool ShowThisYearsDatesTest       = false;
            bool ShowValidHourEntriesTest     = false;

            #region Employees Test
            if (ShowEmployeesTest)
            {
                DataAccessLayer.Employee objE = new DataAccessLayer.Employee();
                Console.WriteLine("++++ Testing: Employees ++++");

                RC = objE.InsEmployee("Emp1", out NewID);
                Console.WriteLine("Insert = RC: {0} and NewID: {1}", RC, NewID);
                SelectEmployees(objE);

                RC = objE.UpdEmployee(NewID, "Emp1A");
                Console.WriteLine("Update = RC: {0}", RC);
                SelectEmployees(objE);

                RC = objE.DelEmployee(NewID);
                Console.WriteLine("Del = RC: {0}", RC);
                SelectEmployees(objE);
                Console.WriteLine("\n");
            }
            #endregion

            #region Projects Test
            if (ShowProjectsTest)
            {
                DataAccessLayer.Project objP = new DataAccessLayer.Project();
                Console.WriteLine("++++ Testing: Projects ++++");

                RC = objP.InsProject("Project1000", "DescA", out NewID);
                Console.WriteLine("Insert = RC: {0} and NewID: {1}", RC, NewID);
                SelectProjects(objP);

                RC = objP.UpdProject(NewID, "Project1100", "DescZ");
                Console.WriteLine("Update = RC: {0}", RC);
                SelectProjects(objP);

                RC = objP.DelProject(NewID);
                Console.WriteLine("Del = RC: {0}", RC);
                SelectProjects(objP);
                Console.WriteLine("\n");
            }
            #endregion

            #region EmployeeProjectHours Test
            if (ShowEmployeeProjectHoursTest)
            {
                DataAccessLayer.EmployeeProjectHour objEPH = new DataAccessLayer.EmployeeProjectHour();
                Console.WriteLine("++++ Testing: EmployeeProjectHours ++++");

                RC = objEPH.InsEmployeeProjectHour(2, 100, DateTime.Parse("2016/01/03"), 17);
                Console.WriteLine("Insert = RC: {0} and NewID: {1}", RC, NewID);
                SelectEmployeeProjectHours(objEPH);

                RC = objEPH.UpdEmployeeProjectHour(2, 100, DateTime.Parse("2016/01/03"), 7);
                Console.WriteLine("Update = RC: {0}", RC);
                SelectEmployeeProjectHours(objEPH);

                RC = objEPH.DelEmployeeProjectHour(2, 100, DateTime.Parse("2016/01/03"));
                Console.WriteLine("Del = RC: {0}", RC);
                SelectEmployeeProjectHours(objEPH);
                Console.WriteLine("\n");
            }
            #endregion

            #region ThisYearsDates Test
            if (ShowThisYearsDatesTest)
            {
                DataAccessLayer.ThisYearsDate objTYD = new DataAccessLayer.ThisYearsDate();
                Console.WriteLine("++++ Testing: ValidHourEntries ++++");
                SelectThisYearsDates(objTYD);
                Console.ReadLine();
            }
            #endregion

            #region ValidHourEntries Test
            if (ShowValidHourEntriesTest)
            {
                DataAccessLayer.ValidHourEntry objVHE = new DataAccessLayer.ValidHourEntry();
                Console.WriteLine("++++ Testing: ValidHourEntries ++++");
                SelectValidHourEntries(objVHE);
            }
            #endregion

            Console.WriteLine("Press any key to quit");
            Console.ReadLine();
        }