private void GetReadingRooms(ClassModel.LibraryInfo libinfo, string libid)
        {
            try
            {
                string  sqlstr = "SELECT [ReadingRoomID],[ReadingRoomNo],[ReadingRoomName],[ReadingRoomOrder],[LibraryID],[ReadingSetting],[RoomSeat] FROM [T_SM_ReadingRoom] WHERE [LibraryID]='" + libid + "'";
                DataSet ds     = Query(sqlstr, Old_connectionString, null);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    ClassModel.ReadingRoomInfo room = new ClassModel.ReadingRoomInfo();
                    room.Libaray = libinfo;
                    room.Name    = dr["ReadingRoomName"].ToString();
                    ClassModel.SeatLayout sl = ClassModel.SeatLayout.GetSeatLayout(dr["RoomSeat"].ToString());
                    sl.RoomNo     = sl.Seats.Keys.ElementAt(0).Substring(0, 6);
                    room.No       = sl.RoomNo;
                    room.SeatList = sl;
                    room.Setting  = new ClassModel.ReadingRoomSetting();
                    if (Progress != null)
                    {
                        Progress("正在导入阅览室:" + dr["ReadingRoomName"].ToString() + "……");
                    }
                    if (!SeatManage.Bll.T_SM_ReadingRoom.AddNewReadingRoom(room))
                    {
                        throw new Exception("添加阅览室失败!");
                    }
                    else
                    {
                        if (Progress != null)
                        {
                            Progress("阅览室:" + dr["ReadingRoomName"].ToString() + "导入成功!");
                        }
                    }
                    roomcount++;

                    if (SeatManage.Bll.T_SM_ReadingRoom.UpdateSeatLayout(room.SeatList) == SeatManage.EnumType.HandleResult.Failed)
                    {
                        throw new Exception("添加座位失败!");
                    }
                    else
                    {
                        if (Progress != null)
                        {
                            Progress("阅览室:" + dr["ReadingRoomName"].ToString() + "座位导入成功!");
                        }
                    }
                }
            }
            catch
            {
                throw;
            }
        }
 private void GetLibs(ClassModel.School school, string schoolid)
 {
     try
     {
         string  sqlstr = "SELECT [LibraryID],[LibraryNo],[LibraryName],[LibraryOrder],[SchoolID] FROM [T_SM_Library] WHERE [SchoolID]='" + schoolid + "'";
         DataSet ds     = Query(sqlstr, Old_connectionString, null);
         foreach (DataRow dr in ds.Tables[0].Rows)
         {
             ClassModel.LibraryInfo lib = new ClassModel.LibraryInfo();
             lib.No     = (libcount + 1).ToString("X2");
             lib.Name   = dr["LibraryName"].ToString();
             lib.School = school;
             if (Progress != null)
             {
                 Progress("正在导入图书馆:" + dr["LibraryName"].ToString() + "……");
             }
             if (!SeatManage.Bll.T_SM_Library.AddNewLibrary(lib))
             {
                 throw new Exception("添加图书馆出错!");
             }
             else
             {
                 if (Progress != null)
                 {
                     Progress("图书馆:" + dr["LibraryName"].ToString() + "导入成功!");
                 }
             }
             libcount++;
             GetReadingRooms(lib, dr["LibraryID"].ToString());
         }
     }
     catch
     {
         throw;
     }
 }