/// <summary>
 /// 保存
 /// </summary>
 /// <returns></returns>
 public bool Save()
 {
     SeatManage.Bll.FileOperate          fileOperation = new SeatManage.Bll.FileOperate();
     SeatManage.ClassModel.UserGuideInfo model         = new SeatManage.ClassModel.UserGuideInfo();
     foreach (GuideImageItem item in _GuideImages)
     {
         if (!fileOperation.UpdateFile(item.ImageUrl, item.ImageNmae, SeatManage.EnumType.SeatManageSubsystem.UserGuide))
         {
             ErrorMessage = string.Format("文件{0}上传失败!", item.ImageNmae);
             return(false);
         }
         model.ImageFilePath.Add(item.ImageNmae);
     }
     model.XMLContent = model.ToXml();
     if (SeatManage.Bll.T_SM_SystemSet.UpdateUserGuide(model))
     {
         MessageBoxWindow mbw = new MessageBoxWindow();
         mbw.viewModel.Message = "保存成功!";
         mbw.viewModel.Type    = Code.MessageBoxType.Success;
         mbw.ShowDialog();
         return(true);
     }
     else
     {
         ErrorMessage = string.Format("保存失败!");
         return(false);
     }
 }
 /// <summary>
 /// 加载图片
 /// </summary>
 public void GetData()
 {
     SeatManage.ClassModel.UserGuideInfo model = SeatManage.Bll.T_SM_SystemSet.GetUserGuide();
     if (model == null)
     {
         return;
     }
     GuideImages.Clear();
     foreach (string file in model.ImageFilePath)
     {
         GuideImageItem item = new GuideImageItem();
         item.ImageInfo = ImageSaveLocation(file);
         GuideImages.Add(item);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 执行图片切换
        /// </summary>
        public void ImageChangeRun()
        {
            try
            {
                SchoolNotices = SystemObject.GetInstance().SchoolNote;
                PromotionAd   = SystemObject.GetInstance().PromotionAdvert;
                UserGuide     = SystemObject.GetInstance().UserGuide;
                noticeNum     = 0;
                promotionNum  = 0;
                guideNum      = 0;
                if (UserGuide != null && UserGuide.ImageFilePath.Count > 0)
                {
                    NowShowImage =
                        new System.Windows.Media.Imaging.BitmapImage(new Uri(Apppath + "UserGuide\\" + UserGuide.ImageFilePath[guideNum], UriKind.RelativeOrAbsolute)); NowTap = AdType.None;
                }
                if (PromotionAd.Count > 0)
                {
                    NowShowImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(Apppath + "PromotionImage\\" + PromotionAd[promotionNum].AdImagePath, UriKind.RelativeOrAbsolute)); NowTap = AdType.PromotionAd;
                }
                if (SchoolNotices.Count > 0)
                {
                    NowShowImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(Apppath + "NoteImage\\" + SchoolNotices[noticeNum].NoteImagePath, UriKind.RelativeOrAbsolute)); NowTap = AdType.SchoolNotice;
                }
                BtnVisible();
                if (ImageSwitch != null)
                {
                    ImageSwitch(this, new EventArgs());
                }


                ImgTime             = new TimeLoop(10 * 1000);
                ImgTime.TimeTo     += ImgTime_TimeTo;
                ImgTimeStop         = new TimeLoop(10 * 1000);
                ImgTimeStop.TimeTo += ImgTimeStop_TimeTo;
                ImgTime.TimeStrat();
            }
            catch (Exception ex)
            {
                WriteLog.Write("消息滚动启动失败:" + ex.Message);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 执行图片切换
        /// </summary>
        public void ImageChangeRun()
        {
            SchoolNotices = OperateResult.SystemObject.GetInstance().SchoolNote;
            PromotionAd   = OperateResult.SystemObject.GetInstance().PromotionAdvert;
            UserGuide     = OperateResult.SystemObject.GetInstance().UserGuide;
            noticeNum     = 0;
            promotionNum  = 0;
            guideNum      = 0;
            if (UserGuide != null && UserGuide.ImageFilePath.Count > 0)
            {
                NowShowImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(Apppath + "UserGuide\\" + UserGuide.ImageFilePath[guideNum], UriKind.RelativeOrAbsolute));
                NowTap       = AdType.None;
            }
            if (PromotionAd.Count > 0)
            {
                NowShowImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(Apppath + "PromotionImage\\" + PromotionAd[promotionNum].AdImagePath, UriKind.RelativeOrAbsolute));
                NowTap       = AdType.PromotionAd;
            }
            if (SchoolNotices.Count > 0)
            {
                NowShowImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(Apppath + "NoteImage\\" + SchoolNotices[noticeNum].NoteImagePath, UriKind.RelativeOrAbsolute));
                NowTap       = AdType.SchoolNotice;
            }
            BtnVisible();
            if (ImageSwitch != null)
            {
                ImageSwitch(this, new EventArgs());
            }


            ImgTime             = new SeatManage.SeatManageComm.TimeLoop(10 * 1000);
            ImgTime.TimeTo     += new EventHandler(ImgTime_TimeTo);
            ImgTimeStop         = new SeatManage.SeatManageComm.TimeLoop(10 * 1000);
            ImgTimeStop.TimeTo += new EventHandler(ImgTimeStop_TimeTo);
            ImgTime.TimeStrat();
        }