Ejemplo n.º 1
0
    private void OnCheckResVersion(UpdateHelper.CheckVersionResult result, string message)
    {
        var action = new Action(() =>
        {
            if (result == UpdateHelper.CheckVersionResult.NONEEDUPDATE)
            {
                BegainLoading();
            }
            else if (result == UpdateHelper.CheckVersionResult.NEEDUPDATE)
            {
                StartCoroutine(updateHelper.UpdateMd5List(OnUpdateMd5List));
            }
            else if (result == UpdateHelper.CheckVersionResult.GAMENEEDUPDATE)
            {
                UpdateUrl = message;
                StartupView.BigUpdateTip.SetActive(true);
            }
            else if (UpdateHelper.CheckVersionResult.ERROR == result)
            {
                ShowErrorTip(message);
            }
        }
                                );

        if (GameSetting.Instance.ForceShowAnn == 1)
        {
            AnnouncementHelper.ShowAnnouncement(UpdateHelper.AnnoucementURL, action);
        }
        else
        {
            action();
        }
    }
Ejemplo n.º 2
0
        public ActionResult Create(AnnouncementViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(viewModel));
            }

            try
            {
                SendEmailAndSMS(viewModel);

                // sanitize the html from user
                viewModel.AnnouncementHtml =
                    AntiXssEncoder.HtmlEncode(viewModel.AnnouncementHtml, false);

                // add announcement to Azure table storage
                AnnouncementHelper.AddAnnouncent(viewModel);
                AnnouncementHelper.CreatedNewAnnouncement = true;

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                // log caught exception with Elmah
                ErrorSignal.FromCurrentContext().Raise(ex);

                return(View(viewModel));
            }
        }
Ejemplo n.º 3
0
        private void GetAnnouncement()
        {
            var          data = AnnouncementHelper.GetList(0, 1);
            JsonTransfer jt   = new JsonTransfer();

            jt.Add("data", data);
            Response.Write(DesEncrypt(jt));
            Response.End();
        }
Ejemplo n.º 4
0
        // GET: Announcements/Delete/5
        public ActionResult Delete(string partitionKey, string rowKey)
        {
            var viewModel = AnnouncementHelper.GetAnnouncementViewModel(partitionKey, rowKey);

            if (viewModel == null)
            {
                viewModel = new AnnouncementViewModel();
            }

            return(View(viewModel));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 获取公告列表
        /// </summary>
        public void GetAnnouncemmentList()
        {
            var start  = GetInt("start");
            var limit  = GetInt("limit");
            var result = AnnouncementHelper.GetList(start * limit, limit);

            var jt = new JsonTransfer();

            jt.Add("list", result.Results);
            jt.Add("totalcount", result.TotalCount);
            Response.Write(jt.ToJson());
            Response.End();
        }
Ejemplo n.º 6
0
        // GET: Announcements/Edit/5
        public ActionResult Edit(string partitionKey, string rowKey)
        {
            var viewModel = AnnouncementHelper.GetAnnouncementViewModel(partitionKey, rowKey);

            if (viewModel == null)
            {
                viewModel = new AnnouncementViewModel();
            }

            viewModel.AnnouncementHtml = WebUtility.HtmlDecode(viewModel.AnnouncementHtml);

            return(View("Create", viewModel));
        }
Ejemplo n.º 7
0
        public ActionResult Delete(AnnouncementViewModel viewModel)
        {
            try
            {
                AnnouncementHelper.DeleteAnnouncement(viewModel.PartitionKey, viewModel.RowKey);
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                // log caught exception with Elmah
                ErrorSignal.FromCurrentContext().Raise(ex);

                return(View());
            }
        }
Ejemplo n.º 8
0
        // GET: Announcements
        public ActionResult Index()
        {
            var viewModel = AnnouncementHelper.GetAllAnnouncements();


            // Send status notification if an announcement has been
            // created or updated. User is sent back to index view
            // after saving announcement.
            string title                 = string.Empty;
            string message               = string.Empty;
            int    notifyInt             = 2;
            bool   hasStatusNotification = false;

            // to send notification that announcement created successfully
            if (AnnouncementHelper.CreatedNewAnnouncement)
            {
                hasStatusNotification = true;
                title     = "New Announcement Created";
                message   = $"Your new announcement has been created.";
                notifyInt = (int)NotificationType.Success;
            }

            // to send notification that announcement updated successfully
            if (AnnouncementHelper.UpdatedAnnouncement)
            {
                hasStatusNotification = true;
                title     = "Announcement Updated";
                message   = $"Your announcement has been updated.";
                notifyInt = (int)NotificationType.Success;
            }

            if (hasStatusNotification)
            {
                ViewBag.StatusTitle           = title;
                ViewBag.StatusMessage         = message;
                ViewBag.NotifyInt             = notifyInt;
                ViewBag.HasStatusNotification = hasStatusNotification;
            }
            else
            {
                ViewBag.HasStatusNotification = false;
            }

            AnnouncementHelper.CreatedNewAnnouncement = false;
            AnnouncementHelper.UpdatedAnnouncement    = false;

            return(View(viewModel));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 删除公告列表
        /// </summary>
        public void DelAnnouncemmentList()
        {
            var ids    = GetString("ids");
            var idlist = Utility.GetListint(ids);

            if (idlist.Count == 0)
            {
                ReturnErrorMsg("删除的公告id不能为空");
                return;
            }

            if (AnnouncementHelper.DelAnnouncementList(ids))
            {
                ReturnCorrectMsg("删除成功");
            }
            else
            {
                ReturnErrorMsg("删除失败");
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 新增公告
        /// </summary>
        public void AddAnnouncemment()
        {
            var content = GetString("content");

            if (string.IsNullOrEmpty(content))
            {
                ReturnErrorMsg("公告内容不能为空");
                return;
            }
            var announcement = new Announcement();

            announcement.Content    = content;
            announcement.CreateTime = DateTime.Now;
            if (AnnouncementHelper.AddAnnouncement(announcement))
            {
                ReturnCorrectMsg("新增成功");
            }
            else
            {
                ReturnErrorMsg("新增失败");
            }
        }
Ejemplo n.º 11
0
        public ActionResult Edit(AnnouncementViewModel viewModel)
        {
            try
            {
                // sanitize the html from user
                viewModel.AnnouncementHtml =
                    AntiXssEncoder.HtmlEncode(viewModel.AnnouncementHtml, false);

                // add announcement to Azure table storage
                AnnouncementHelper.UpdateAnnouncent(viewModel);

                AnnouncementHelper.UpdatedAnnouncement = true;

                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                // log caught exception with Elmah
                ErrorSignal.FromCurrentContext().Raise(ex);

                return(View());
            }
        }
        public ActionResult Index()
        {
            var viewModel = AnnouncementHelper.GetAllAnnouncements();

            return(View(viewModel));
        }
Ejemplo n.º 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     MerchantStat = SystemHelper.GetMerchantStat(Int32.Parse(SellerId));
     MerchantStat.AnnouncementContent = AnnouncementHelper.GetNewsItem().Content;
     Fastlinkslist = DevSystemHelper.GetPagFastlinks(0, 0).Results.ToList();
 }