예제 #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()); });
        }
예제 #2
0
파일: Program.cs 프로젝트: hdxhan/IKendeLib
        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()); });
        }
예제 #3
0
파일: Program.cs 프로젝트: yuyu2you/Peanut
        public static void Test()
        {
            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);

            sql = "insert into employees(firstname,lastname) values(@p1,@p2)";
            sql["p1", "henry"]["p2", "fan"].Execute();

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

            Query <int> getCount = "select count(*) from employees";



            Query <Employee> getEmp = "select * from employees where employeeid=3";



            Query <IList <Employee> > getEmps = "select * from employees";



            (Employee.firstName == "henry").Delete <Employee>();



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

            ListOrders();
        }