예제 #1
0
        public static void Test()
        {
            TimeWatch.Clean();
            TimeWatch.________________________________________________________("Peaunt Exeuctes");

            CustOrderHist coh = new CustOrderHist();

            coh.CustomerID = "ANATR";
            IList <CustOrderHistItem> cohs = coh.List <CustOrderHistItem>();

            foreach (CustOrderHistItem item in cohs)
            {
                Console.WriteLine(item.ProductName);
            }


            SQL      sql;
            Employee employee = (Employee.employeeID == 3).ListFirst <Employee>(DB.DB3);

            Console.WriteLine(employee);
            TimeWatch.________________________________________________________("Insert Employee");
            sql = "insert into employees(firstname,lastname) values(@p1,@p2)";
            sql["p1", "henry"]["p2", "fan"].Execute();
            TimeWatch.________________________________________________________();

            TimeWatch.________________________________________________________("del employee");
            sql = "delete from employees where firstname=@p1";
            sql["p1", "henry"].Execute();
            TimeWatch.________________________________________________________();

            TimeWatch.________________________________________________________("count employee");
            Query <int> getCount = "select count(*) from employees";

            TimeWatch.________________________________________________________();

            TimeWatch.________________________________________________________("get employee");
            Query <Employee> getEmp = "select * from employees where employeeid=3";

            TimeWatch.________________________________________________________();


            TimeWatch.________________________________________________________("list employee");
            Query <IList <Employee> > getEmps = "select * from employees";

            TimeWatch.________________________________________________________();

            TimeWatch.________________________________________________________("del employee with expression");
            (Employee.firstName == "henry").Delete <Employee>();
            TimeWatch.________________________________________________________();

            TimeWatch.________________________________________________________("modify employee");
            (Employee.employeeID == 3).Edit <Employee>(d => { d.LastName = "a"; });
            TimeWatch.________________________________________________________();

            ListOrders();

            TimeWatch.________________________________________________________();

            TimeWatch.Report(o => { Console.WriteLine(o.ToString()); });
        }