コード例 #1
0
        public static mr_demo_data Createmr_demo_data(int demo_id, int city_id, int dept_id)
        {
            mr_demo_data mr_demo_data = new mr_demo_data();

            mr_demo_data.demo_id = demo_id;
            mr_demo_data.city_id = city_id;
            mr_demo_data.dept_id = dept_id;
            return(mr_demo_data);
        }
コード例 #2
0
 public void AddTomr_demo_data(mr_demo_data mr_demo_data)
 {
     base.AddObject("mr_demo_data", mr_demo_data);
 }
コード例 #3
0
 public void AddTomr_demo_data(mr_demo_data mr_demo_data)
 {
     base.AddObject("mr_demo_data", mr_demo_data);
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: mahuidong/my-csharp-sample
        static void Main(string[] args)
        {
            // 测试类.
            Test p = new Test();



            mr_demo_data data1 = new mr_demo_data()
            {
                city_id = 1, dept_id = 1, demo_info = "C1_D1"
            };
            mr_demo_data data2 = new mr_demo_data()
            {
                city_id = 1, dept_id = 2, demo_info = "C1_D2"
            };
            mr_demo_data data3 = new mr_demo_data()
            {
                city_id = 2, dept_id = 1, demo_info = "C2_D1"
            };
            mr_demo_data data4 = new mr_demo_data()
            {
                city_id = 2, dept_id = 2, demo_info = "C2_D2"
            };


            Console.WriteLine("测试插入数据!");

            p.SaveMrDemoData(data1);
            p.SaveMrDemoData(data2);
            p.SaveMrDemoData(data3);
            p.SaveMrDemoData(data4);


            Console.WriteLine("测试查询!");

            var query =
                from data in p.MrDemoDataSource
                where data.city_id == 1
                select data;


            foreach (mr_demo_data d in query)
            {
                Console.WriteLine(d.ToString());
            }

            data2.demo_info = "Update 22";
            data4.demo_info = "Update 44";


            Console.WriteLine("测试更新!");
            p.SaveMrDemoData(data2);
            p.SaveMrDemoData(data4);


            query =
                from data in p.MrDemoDataSource
                where
                data.city_id == 1 ||
                data.city_id == 2
                select data;

            foreach (mr_demo_data d in query)
            {
                Console.WriteLine(d.ToString());
            }



            Console.WriteLine("测试删除!");
            p.DeleteMrDemoData(data1);
            p.DeleteMrDemoData(data3);

            query =
                from data in p.MrDemoDataSource
                where
                data.city_id == 1 ||
                data.city_id == 2
                select data;

            foreach (mr_demo_data d in query)
            {
                Console.WriteLine(d.ToString());
            }

            p.DeleteMrDemoData(data2);
            p.DeleteMrDemoData(data4);

            Console.WriteLine("Finish!");

            Console.ReadLine();
        }
コード例 #5
0
 public static mr_demo_data Createmr_demo_data(int demo_id, int city_id, int dept_id)
 {
     mr_demo_data mr_demo_data = new mr_demo_data();
     mr_demo_data.demo_id = demo_id;
     mr_demo_data.city_id = city_id;
     mr_demo_data.dept_id = dept_id;
     return mr_demo_data;
 }