private TerminalInfoV2 DataRowToTerminalInfoNew(DataRow dr)
        {
            TerminalInfoV2 terminal = new TerminalInfoV2();

            terminal.ClientNo           = dr["DeviceNum"].ToString();
            terminal.TerminalMacAddress = dr["TerminalMacAddress"].ToString();
            terminal.ScreenshotPath     = dr["ScreenshotPath"].ToString();
            string tempFile = dr["Date"].ToString();

            if (!string.IsNullOrEmpty(tempFile))
            {
                terminal.StatusUpdateTime = DateTime.Parse(tempFile);
            }
            terminal.IsUpdatePlayList = (bool)dr["IsUpdatePlayList"];
            terminal.Describe         = dr["Describe"].ToString();
            tempFile = dr["DeviceSetting"].ToString();
            if (!string.IsNullOrEmpty(tempFile))
            {
                terminal.DeviceSetting = ClientConfigV2.Convert(tempFile);
            }

            tempFile = dr["EmpowerLoseEfficacyTime"].ToString();
            if (!string.IsNullOrEmpty(tempFile))
            {
                terminal.EmpowerLoseEfficacyTime = DateTime.Parse(tempFile);
            }
            if (dr["LastPrintTimes"] == DBNull.Value)
            {
                terminal.LastPrintTimes = 0;
            }
            else
            {
                terminal.LastPrintTimes = int.Parse(dr["LastPrintTimes"].ToString());
            }
            if (dr["PrintedTimes"] == DBNull.Value)
            {
                terminal.PrintedTimes = 0;
            }
            else
            {
                terminal.PrintedTimes = int.Parse(dr["PrintedTimes"].ToString());
            }
            if (dr["PrinterStatus"] == DBNull.Value)
            {
                terminal.PrinterStatus = false;
            }
            else
            {
                terminal.PrinterStatus = Convert.ToBoolean(dr["PrinterStatus"].ToString());
            }
            return(terminal);
        }
        /// <summary>
        /// 选座方式验证
        /// </summary>
        /// <param name="clientset">终端选座方式</param>
        /// <param name="roomSelectSeatSet">阅览室设置的选座方式</param>
        /// <returns></returns>
        public static SelectSeatMode ProvenSelectSeatMethod(ClientConfigV2 clientset, SeatChooseMethodSet roomSelectSeatSet)
        {
            SelectSeatMode method = SelectSeatMode.OptionalMode;

            if (clientset.SelectMethod == SelectSeatMode.Default)
            {
                method = NowReadingRoomState.RoomSelectSeatMode(roomSelectSeatSet, SeatManage.Bll.ServiceDateTime.Now);
            }
            else
            {
                method = clientset.SelectMethod;
            }
            return(method);
        }
        /// <summary>
        /// 选座验证操作。
        /// </summary>
        /// <param name="student">学生信息</param>
        /// <param name="room">选择的阅览室</param>
        /// <param name="clientconfig">客户端设置</param>
        /// <returns></returns>
        public static bool ProvenReaderState(ReaderInfo student, ReadingRoomInfo room, BlacklistSetting blacklistSet, ClientConfigV2 clientconfig)
        {
            if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimes(student.CardNo, clientconfig.PosTimes))
            {
                PopupWindow selectTooWindow = new PopupWindow(TipType.SelectSeatFrequent);
                selectTooWindow.ShowDialog();
                return(true);
            }
            if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimesByReadingRoom(student.CardNo, room.Setting.PosTimes, room.No))
            {
                PopupWindow selectTooWindow = new PopupWindow(TipType.SelectSeatFrequent);
                selectTooWindow.ShowDialog();
                return(true);
            }


            if (room.Setting.UsedBlacklistLimit)
            {
                if (student.BlacklistLog.Count > 0)
                {
                    if (room.Setting.BlackListSetting.Used)
                    {
                        bool isBlack = false;
                        foreach (BlackListInfo blinfo in student.BlacklistLog)
                        {
                            if (blinfo.ReadingRoomID == room.No)
                            {
                                isBlack = true;
                                break;
                            }
                        }
                        if (isBlack)
                        {
                            PopupWindow blacklistWindow = new PopupWindow(TipType.IsBlacklist);
                            blacklistWindow.ShowDialog();
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        PopupWindow blacklistWindow = new PopupWindow(TipType.IsBlacklist);
                        blacklistWindow.ShowDialog();
                        return(true);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 把图片路径转换为资源字典
        /// </summary>
        /// <param name="config"></param>
        /// <returns></returns>
        private System.Windows.Media.Imaging.BitmapImage GetSchoolLogoBitmapImageResource(ClientConfigV2 config)
        {
            string temp = "";

            try
            {
                string path = AppDomain.CurrentDomain.BaseDirectory;

                temp = string.Format("{0}{1}", path, config.BackImgage["SchoolLogoImage"]);
                if (System.IO.File.Exists(temp))
                {
                    return(new System.Windows.Media.Imaging.BitmapImage(new Uri(temp, UriKind.RelativeOrAbsolute)));
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                SeatManage.SeatManageComm.WriteLog.Write(string.Format("背景图片初始化失败:{0} {1},{2}", config.BackImgage[temp], ex.Message, temp));
                return(null);
            }
        }
Beispiel #5
0
 /// <summary>
 /// 选座方式验证
 /// </summary>
 /// <param name="clientset">终端选座方式</param>
 /// <param name="roomSelectSeatSet">阅览室设置的选座方式</param>
 /// <returns></returns>
 public static SelectSeatMode ProvenSelectSeatMethod(ClientConfigV2 clientset, SeatChooseMethodSet roomSelectSeatSet)
 {
     return(clientset.SelectMethod == SelectSeatMode.Default ? SeatManage.Bll.NowReadingRoomState.RoomSelectSeatMode(roomSelectSeatSet, SeatManage.Bll.ServiceDateTime.Now) : clientset.SelectMethod);
 }
Beispiel #6
0
        /// <summary>
        /// 选座验证操作。
        /// </summary>
        /// <param name="student">学生信息</param>
        /// <param name="room">选择的阅览室</param>
        /// <param name="clientconfig">客户端设置</param>
        /// <returns></returns>
        public static bool ProvenReaderState(ReaderInfo student, ReadingRoomInfo room, BlacklistSetting blacklistSet, ClientConfigV2 clientconfig)
        {
            if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimes(student.CardNo, clientconfig.PosTimes))
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatFrequent);
                return(true);
            }
            if (SeatManage.Bll.EnterOutOperate.CheckReaderChooseSeatTimesByReadingRoom(student.CardNo, room.Setting.PosTimes, room.No))
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.SelectSeatFrequent);
                return(true);
            }
            if (!room.Setting.UsedBlacklistLimit)
            {
                return(false);
            }
            if (student.BlacklistLog.Count <= 0)
            {
                return(false);
            }
            if (!room.Setting.BlackListSetting.Used)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.IsBlacklist);
                return(true);
            }
            bool isBlack = student.BlacklistLog.Any(blinfo => blinfo.ReadingRoomID == room.No);

            if (isBlack)
            {
                PopupWindowsObject.GetInstance().Window.ShowMessage(TipType.IsBlacklist);
                return(true);
            }
            return(false);
        }