Ejemplo n.º 1
0
        /// <summary>
        /// The main method...
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            TM2SQL_DAO tm2sqlDAO = new TM2SQL_DAO();
            //NB Modified TaskManagerModelContainer.Designer.cs linie 40!!

            //var obs = new ObjectContext(@"metadata=res://*/TaskManagerModel.csdl|res://*/TaskManagerModel.ssdl|res://*/TaskManagerModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source='YNDAL-LAPTOP\SQLEXPRESS';initial catalog=TaskManagerDB;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&quot");

            //Console.WriteLine("First step done");

            //IEnumerable<User> users = TM2SQL_DAO.GetAllUsers();

            //Console.Out.WriteLine("Size: " + users.Count<User>());

            //foreach (User u in users)
            //{
            //    Console.Out.WriteLine(u.UserName);
            //}

            //TM2SQL_DAO.GetJobsFromUser(4);

            //TM2SQL_DAO.GetJobsFromPeriodGrouped(new DateTime(2012, 1, 1), new DateTime(2012, 12, 31));
                //.GetJobsFromUser(5);

            User user = new User("Endnu en.WIHhhU..!", "...");
            tm2sqlDAO.AddUser(user);

            //IEnumerable<User> users = TM2SQL_DAO.GetAllUsers();

            Job job = new Job(user, 50, 5, s => 50);
            //job.TimeSubmitted = DateTime.Now;

            tm2sqlDAO.AddJob(job);
            tm2sqlDAO.AddLog(job, DateTime.Now);

            IEnumerable<User> users = tm2sqlDAO.GetAllUsers();
            IEnumerable<Job> jobs = tm2sqlDAO.GetJobsFromUser(user.UserId);

            foreach (User u in users)
            {
                Console.WriteLine("User: "******"Jobs: " + j);
            }

            //ConsoleUI console = new ConsoleUI();
        }
Ejemplo n.º 2
0
 public void Cleanup()
 {
     ITM_DAO dao = new TM2SQL_DAO();
     dao.DeleteUser("test");
 }