public void AddListBase(List <Station_Info> stationInsertList)
        {
            var tempresult     = DbSet.ToList();
            var realinsertList = new List <Station_Info>();

            for (int i = 0; i < stationInsertList.Count; i++)
            {
                if (!tempresult.Exists(a => a.StaffCode == stationInsertList[i].StaffCode))//如果数据库存在,就不再插入了
                {
                    realinsertList.Add(stationInsertList[i]);
                }
            }
            Db.AddRange(realinsertList);
        }
        public void AddListBase(List <Grade_Info> gradeInsertList)
        {
            var tempresult     = DbSet.ToList();
            var realinsertList = new List <Grade_Info>();

            for (int i = 0; i < gradeInsertList.Count; i++)
            {
                if (!tempresult.Exists(a => a.GradeCode == gradeInsertList[i].GradeCode))//如果数据库存在,就不再插入了
                {
                    realinsertList.Add(gradeInsertList[i]);
                }
            }
            Db.AddRange(realinsertList);
        }
Exemplo n.º 3
0
        public void AddListBase(List <Depart_Info> departInsertList)
        {
            var tempresult     = DbSet.ToList();
            var realinsertList = new List <Depart_Info>();

            for (int i = 0; i < departInsertList.Count; i++)
            {
                if (!tempresult.Exists(a => a.DepartCode == departInsertList[i].DepartCode))//如果数据库存在,就不再插入了
                {
                    realinsertList.Add(departInsertList[i]);
                }
            }
            Db.AddRange(realinsertList);
        }
Exemplo n.º 4
0
 public void AddList(List <Class_Info> class_Infos)
 {
     Db.AddRange(class_Infos);
 }