Beispiel #1
0
        private void addCity(string province,string name)
        {
            using (DataContainer c = new DataContainer())
            {
                var sheng = (from l in c.Category
                             where l.Id == 82
                             select l).First();//城市
                Object z1 = new Object();
                z1.Category.Add(sheng);
                z1.Name = name;
                z1.Remark = "";
                z1.ObjectPropty.Add(new ObjectPropty() { Name = "城市", Value = "" });
                z1.ObjectPropty.Add(new ObjectPropty() { Name = "省", Value = province });
                c.AddToObject(z1);
                c.SaveChanges();

                w("保存:" + name);
            }
        }
Beispiel #2
0
        private void addCountry(string zhou, string name)
        {
            using (DataContainer c = new DataContainer())
            {
                var guo = (from l in c.Category
                           where l.Id == 43
                           select l).First();//洲
                Object z1 = new Object();
                z1.Category.Add(guo);
                z1.Name = name;
                z1.Remark = "";
                z1.ObjectPropty.Add(new ObjectPropty() { Name = "国家",Value = ""});
                z1.ObjectPropty.Add(new ObjectPropty() { Name = "洲", Value = zhou });
                c.AddToObject(z1);
                c.SaveChanges();

                w("保存:" + name);
            }
        }
Beispiel #3
0
        private void addZhou(string name)
        {
            using (DataContainer c = new DataContainer())
            {
                var zhou = (from l in c.Category
                            where l.Id == 42
                            select l).First();//洲
                Object z1 = new Object();
                z1.Category.Add(zhou);
                z1.Name = name;
                z1.Remark = "";
                c.AddToObject(z1);

                c.SaveChanges();

                w("保存:" + name);
            }
        }