Hidistro.UI.Web/Admin/promotion/GetCouponListHandler.cs

(完整代码) 1KB

namespace Hidistro.UI.Web.Admin.promotion
{
    using Hidistro.ControlPanel.Promotions;
    using Newtonsoft.Json;
    using System;
    using System.Data;
    using System.Linq;
    using System.Web;
    using Hidistro.Entities.Promotions;

    public class GetCouponListHandler : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            try
            {
                string[] allKeys = context.Request.Params.AllKeys;
                DateTime now = DateTime.Now;
                if (allKeys.Contains<string>("time"))
                {
                    now = DateTime.Parse(context.Request["time"].ToString());
                }
                DataTable unFinishedCoupon = CouponHelper.GetUnFinishedCoupon(now, CouponType.活动赠送);// 3);
                var type = new
                {
                    type = "success",
                    data = unFinishedCoupon
                };
                string s = JsonConvert.SerializeObject(type);
                context.Response.Write(s);
            }
            catch (Exception exception)
            {
                context.Response.Write("{\"type\":\"error\",\"data\":\"" + exception.Message + "\"}");
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。