/// <summary>
        /// 输出xml
        /// </summary>
        /// <param name="stting"></param>
        /// <returns></returns>
        private string ConvertToXml(PecketBookWebSetting model)
        {
            //TODO:转换成xml结构的算法
            //创建一个xml对象
            XmlDocument xmlDoc = new XmlDocument();
            //创建开头
            XmlDeclaration dec = xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null);

            xmlDoc.AppendChild(dec);
            //创建根节点
            XmlElement root = xmlDoc.CreateElement("Root");

            root.SetAttribute("UseBookComfirm", ConfigConvert.ConvertToString(model.UseBookComfirm));
            root.SetAttribute("UseBookNextDaySeat", ConfigConvert.ConvertToString(model.UseBookNextDaySeat));
            root.SetAttribute("UseBookNowDaySeat", ConfigConvert.ConvertToString(model.UseBookNowDaySeat));
            root.SetAttribute("UseBookSeat", ConfigConvert.ConvertToString(model.UseBookSeat));
            root.SetAttribute("UseCancelBook", ConfigConvert.ConvertToString(model.UseCancelBook));
            root.SetAttribute("UseCancelWait", ConfigConvert.ConvertToString(model.UseCancelWait));
            root.SetAttribute("UseCanLeave", ConfigConvert.ConvertToString(model.UseCanLeave));
            root.SetAttribute("UseComeBack", ConfigConvert.ConvertToString(model.UseComeBack));
            root.SetAttribute("UseContinue", ConfigConvert.ConvertToString(model.UseContinue));
            root.SetAttribute("UseShortLeave", ConfigConvert.ConvertToString(model.UseShortLeave));
            root.SetAttribute("UseWaitSeat", ConfigConvert.ConvertToString(model.UseWaitSeat));
            root.SetAttribute("UseSelectSeat", ConfigConvert.ConvertToString(model.UseSelectSeat));
            root.SetAttribute("UseChangeSeat", ConfigConvert.ConvertToString(model.UseChangeSeat));
            //添加根节点
            xmlDoc.AppendChild(root);
            return(xmlDoc.OuterXml);
        }
Beispiel #2
0
        public JsonResult SavePecketWebSetting()
        {
            JsonResult result = null;

            SeatManage.ClassModel.PecketBookWebSetting setting = new SeatManage.ClassModel.PecketBookWebSetting();
            setting.UseBookComfirm     = Request.Params["cb_UseBookComfirm"] == null ? false : true;     // cb_UseBookComfirm.Checked;
            setting.UseBookNextDaySeat = Request.Params["cb_UseBookNextDaySeat"] == null ? false : true; //cb_UseBookNextDaySeat.Checked;
            setting.UseBookNowDaySeat  = Request.Params["cb_UseBookNowDaySeat"] == null ? false : true;  //cb_UseBookNowDaySeat.Checked;
            setting.UseBookSeat        = Request.Params["cb_UseBookSeat"] == null ? false : true;        //cb_UseBookSeat.Checked;
            setting.UseCancelBook      = Request.Params["cb_UseCancelBook"] == null ? false : true;      //cb_UseCancelBook.Checked;
            setting.UseCancelWait      = Request.Params["cb_UseCancelWait"] == null ? false : true;      //cb_UseCancelWait.Checked;
            setting.UseCanLeave        = Request.Params["cb_UseCanLeave"] == null ? false : true;        //cb_UseCanLeave.Checked;
            setting.UseComeBack        = Request.Params["cb_UseComeBack"] == null ? false : true;        //cb_UseComeBack.Checked;
            setting.UseContinue        = Request.Params["cb_UseContinue"] == null ? false : true;        // cb_UseContinue.Checked;
            setting.UseShortLeave      = Request.Params["cb_UseShortLeave"] == null ? false : true;      // cb_UseShortLeave.Checked;
            setting.UseWaitSeat        = Request.Params["cb_UseWaitSeat"] == null ? false : true;        //cb_UseWaitSeat.Checked;
            setting.UseSelectSeat      = Request.Params["cb_SelectSeat"] == null ? false : true;         //cb_SelectSeat.Checked;
            setting.UseChangeSeat      = Request.Params["cb_ChangeSeat"] == null ? false : true;         //cb_ChangeSeat.Checked;

            if (SeatManage.Bll.T_SM_SystemSet.UpdatePecketWebSetting(setting))
            {
                result = Json(new { status = "yes", message = "微信规则配置保存成功" }, JsonRequestBehavior.AllowGet);
            }
            else
            {
                result = Json(new { status = "no", message = "微信规则配置保存失败" }, JsonRequestBehavior.AllowGet);
            }
            return(result);
        }
Beispiel #3
0
        public ActionResult BlacklistInfo()
        {
            //初始化黑名单设置页面
            SeatManage.ClassModel.BlacklistSetting blacklistset = SeatManage.Bll.T_SM_SystemSet.GetRegulationRulesSetting().BlacklistSet;
            ViewBag.IsBlUserdChecked            = blacklistset.Used ? "yes" : "no";
            ViewBag.nbvrcontText                = blacklistset.ViolateTimes.ToString();
            ViewBag.ddlleavemodeSelectedValue   = ((int)blacklistset.LeaveBlacklist).ToString();
            ViewBag.nbleavetimeText             = blacklistset.LimitDays.ToString();
            ViewBag.nbvrovertimeText            = blacklistset.ViolateFailDays.ToString();
            ViewBag.cbBookOverTimeChecked       = blacklistset.ViolateRoule[SeatManage.EnumType.ViolationRecordsType.BookingTimeOut] ? "yes" : "no";
            ViewBag.cbLeaveByAdminChecked       = blacklistset.ViolateRoule[SeatManage.EnumType.ViolationRecordsType.LeaveByAdmin] ? "yes" : "no";
            ViewBag.cbSeatOverTimeChecked       = blacklistset.ViolateRoule[SeatManage.EnumType.ViolationRecordsType.SeatOutTime] ? "yes" : "no";
            ViewBag.cbShortLeaveByAdminChecked  = blacklistset.ViolateRoule[SeatManage.EnumType.ViolationRecordsType.ShortLeaveByAdminOutTime] ? "yes" : "no";
            ViewBag.cbShortLeaveByReaderChecked = blacklistset.ViolateRoule[SeatManage.EnumType.ViolationRecordsType.ShortLeaveByReaderOutTime] ? "yes" : "no";
            ViewBag.cbShortLeaveOverTimeChecked = blacklistset.ViolateRoule[SeatManage.EnumType.ViolationRecordsType.ShortLeaveOutTime] ? "yes" : "no";

            //初始化门禁设置页面
            SeatManage.ClassModel.AccessSetting accset = SeatManage.Bll.T_SM_SystemSet.GetAccessSetting();
            if (accset == null)
            {
                accset = new SeatManage.ClassModel.AccessSetting();
            }

            ViewBag.IsASUserdCheckedForm3          = accset.IsUsed ? "yes" : "no";
            ViewBag.IsELUserdCheckedForm3          = accset.EnterLib ? "yes" : "no";
            ViewBag.IsOLUserdCheckedForm3          = accset.OutLib ? "yes" : "no";
            ViewBag.cbBLIsUsedCheckedForm3         = accset.IsLimitBlackList ? "yes" : "no";
            ViewBag.IsAddrvCheckedForm3            = accset.AddViolationRecords ? "yes" : "no";
            ViewBag.LeaveTimeTextForm3             = accset.LeaveTimeSpan.ToString();
            ViewBag.ddlleavemodeSelectedValueForm3 = ((int)accset.LeaveMode).ToString();
            ViewBag.IsOnSeatCheckedForm3           = accset.IsReleaseOnSeat ? "yes" : "no";
            ViewBag.IsShortLeaveCheckedForm3       = accset.IsComeBack ? "yes" : "no";
            ViewBag.IsBookingCheckedForm3          = accset.IsBookingConfinmed ? "yes" : "no";
            //初始化微信端设置
            SeatManage.ClassModel.PecketBookWebSetting setting = SeatManage.Bll.T_SM_SystemSet.GetPecketWebSetting();
            if (setting == null)
            {
                setting = new SeatManage.ClassModel.PecketBookWebSetting();
            }
            ViewBag.cb_UseBookComfirmChecked     = setting.UseBookComfirm;
            ViewBag.cb_UseBookNextDaySeatChecked = setting.UseBookNextDaySeat;
            ViewBag.cb_UseBookNowDaySeatChecked  = setting.UseBookNowDaySeat;
            ViewBag.cb_UseBookSeatChecked        = setting.UseBookSeat;
            ViewBag.cb_UseCancelBookChecked      = setting.UseCancelBook;
            ViewBag.cb_UseCancelWaitChecked      = setting.UseCancelWait;
            ViewBag.cb_UseCanLeaveChecked        = setting.UseCanLeave;
            ViewBag.cb_UseComeBackChecked        = setting.UseComeBack;
            ViewBag.cb_UseContinueChecked        = setting.UseContinue;
            ViewBag.cb_UseShortLeaveChecked      = setting.UseShortLeave;
            ViewBag.cb_UseWaitSeatChecked        = setting.UseWaitSeat;
            ViewBag.cb_ChangeSeatChecked         = setting.UseChangeSeat;
            ViewBag.cb_SelectSeatChecked         = setting.UseSelectSeat;
            //初始化消息推送
            SeatManage.ClassModel.PushMsssageSetting objPushMsssageSetting = SeatManage.Bll.T_SM_SystemSet.GetMsgPushSet() ?? new SeatManage.ClassModel.PushMsssageSetting();
            ViewBag.cb_AdminOperationChecked = objPushMsssageSetting.PushSetting[SeatManage.EnumType.MsgPushType.AdminOperation];
            ViewBag.cb_EnterVrChecked        = objPushMsssageSetting.PushSetting[SeatManage.EnumType.MsgPushType.EnterVR];
            ViewBag.cb_EnterBlackChecked     = objPushMsssageSetting.PushSetting[SeatManage.EnumType.MsgPushType.EnterBlack];
            ViewBag.cb_LeaveVrBlackChecked   = objPushMsssageSetting.PushSetting[SeatManage.EnumType.MsgPushType.LeaveVrBlack];
            ViewBag.cb_OtherUserChecked      = objPushMsssageSetting.PushSetting[SeatManage.EnumType.MsgPushType.OtherUser];
            ViewBag.cb_TimeOutChecked        = objPushMsssageSetting.PushSetting[SeatManage.EnumType.MsgPushType.TimeOut];
            ViewBag.cb_UserOperationChecked  = objPushMsssageSetting.PushSetting[SeatManage.EnumType.MsgPushType.UserOperation];
            return(View());
        }