コード例 #1
0
ファイル: LotteryAwardDAO.cs プロジェクト: yankaics/cms-1
        public void GetCount(int publishmentSystemID, ELotteryType lotteryType, int lotteryID, out int totalNum, out int wonNum)
        {
            totalNum = 0;
            wonNum   = 0;

            var lotteryIDList = new List <int>();

            if (lotteryID == 0)
            {
                lotteryIDList = DataProviderWX.LotteryDAO.GetLotteryIDList(publishmentSystemID, lotteryType);
            }
            else
            {
                lotteryIDList.Add(lotteryID);
            }

            string sqlString =
                $"SELECT SUM(TotalNum), SUM(WonNum) FROM {TABLE_NAME} WHERE {LotteryWinnerAttribute.PublishmentSystemID} = {publishmentSystemID} AND {LotteryWinnerAttribute.LotteryID} IN ({TranslateUtils.ToSqlInStringWithoutQuote(lotteryIDList)})";

            using (var rdr = ExecuteReader(sqlString))
            {
                if (rdr.Read() && !rdr.IsDBNull(0))
                {
                    totalNum = rdr.GetInt32(0);
                    wonNum   = rdr.GetInt32(1);
                }
                rdr.Close();
            }
        }
コード例 #2
0
        public string GetSelectString(int publishmentSystemID, ELotteryType lotteryType)
        {
            string whereString =
                $"WHERE {LotteryAttribute.PublishmentSystemID} = {publishmentSystemID} AND {LotteryAttribute.LotteryType} = '{ELotteryTypeUtils.GetValue(lotteryType)}'";

            return(BaiRongDataProvider.TableStructureDao.GetSelectSqlString(TABLE_NAME, SqlUtils.Asterisk, whereString));
        }
コード例 #3
0
        public int GetFirstIDByKeywordID(int publishmentSystemID, ELotteryType lotteryType, int keywordID)
        {
            string sqlString =
                $"SELECT TOP 1 ID FROM {TABLE_NAME} WHERE {LotteryAttribute.PublishmentSystemID} = {publishmentSystemID} AND {LotteryAttribute.LotteryType} = '{ELotteryTypeUtils.GetValue(lotteryType)}' AND {LotteryAttribute.IsDisabled} <> '{true}' AND {LotteryAttribute.KeywordID} = {keywordID}";

            return(BaiRongDataProvider.DatabaseDao.GetIntResult(sqlString));
        }
コード例 #4
0
ファイル: ELotteryType.cs プロジェクト: yankaics/cms-1
 public static string GetValue(ELotteryType type)
 {
     if (type == ELotteryType.Scratch)
     {
         return("Scratch");
     }
     else if (type == ELotteryType.BigWheel)
     {
         return("BigWheel");
     }
     else if (type == ELotteryType.GoldEgg)
     {
         return("GoldEgg");
     }
     else if (type == ELotteryType.Flap)
     {
         return("Flap");
     }
     else if (type == ELotteryType.YaoYao)
     {
         return("YaoYao");
     }
     else
     {
         throw new Exception();
     }
 }
コード例 #5
0
 public static string GetText(ELotteryType type)
 {
     if (type == ELotteryType.Scratch)
     {
         return("刮刮卡");
     }
     else if (type == ELotteryType.BigWheel)
     {
         return("大转盘");
     }
     else if (type == ELotteryType.GoldEgg)
     {
         return("砸金蛋");
     }
     else if (type == ELotteryType.Flap)
     {
         return("大翻牌");
     }
     else if (type == ELotteryType.YaoYao)
     {
         return("摇摇乐");
     }
     else
     {
         throw new Exception();
     }
 }
コード例 #6
0
        public List <LotteryWinnerInfo> GetWinnerInfoList(int publishmentSystemId, ELotteryType lotteryType, int lotteryId)
        {
            var winnerInfoList = new List <LotteryWinnerInfo>();

            string sqlWhere =
                $"WHERE {LotteryWinnerAttribute.PublishmentSystemId} = {publishmentSystemId} AND {LotteryWinnerAttribute.LotteryType} = '{ELotteryTypeUtils.GetValue(lotteryType)}'";

            if (lotteryId > 0)
            {
                sqlWhere =
                    $"WHERE {LotteryWinnerAttribute.PublishmentSystemId} = {publishmentSystemId} AND {LotteryWinnerAttribute.LotteryId} = {lotteryId}";
            }

            var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, "ORDER BY ID DESC");

            using (var rdr = ExecuteReader(sqlSelect))
            {
                while (rdr.Read())
                {
                    var winnerInfo = new LotteryWinnerInfo(rdr);
                    winnerInfoList.Add(winnerInfo);
                }
                rdr.Close();
            }

            return(winnerInfoList);
        }
コード例 #7
0
ファイル: ELotteryType.cs プロジェクト: yankaics/cms-1
 public static string GetText(ELotteryType type)
 {
     if (type == ELotteryType.Scratch)
     {
         return("¹Î¹Î¿¨");
     }
     else if (type == ELotteryType.BigWheel)
     {
         return("´óתÅÌ");
     }
     else if (type == ELotteryType.GoldEgg)
     {
         return("ÔÒ½ðµ°");
     }
     else if (type == ELotteryType.Flap)
     {
         return("´ó·­ÅÆ");
     }
     else if (type == ELotteryType.YaoYao)
     {
         return("Ò¡Ò¡ÀÖ");
     }
     else
     {
         throw new Exception();
     }
 }
コード例 #8
0
        public List <LotteryWinnerInfo> GetWinnerInfoList(int publishmentSystemID, ELotteryType lotteryType, int lotteryID)
        {
            var winnerInfoList = new List <LotteryWinnerInfo>();

            string SQL_WHERE =
                $"WHERE {LotteryWinnerAttribute.PublishmentSystemID} = {publishmentSystemID} AND {LotteryWinnerAttribute.LotteryType} = '{ELotteryTypeUtils.GetValue(lotteryType)}'";

            if (lotteryID > 0)
            {
                SQL_WHERE =
                    $"WHERE {LotteryWinnerAttribute.PublishmentSystemID} = {publishmentSystemID} AND {LotteryWinnerAttribute.LotteryID} = {lotteryID}";
            }

            var SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, SqlUtils.Asterisk, SQL_WHERE, "ORDER BY ID DESC");

            using (var rdr = ExecuteReader(SQL_SELECT))
            {
                while (rdr.Read())
                {
                    var winnerInfo = new LotteryWinnerInfo(rdr);
                    winnerInfoList.Add(winnerInfo);
                }
                rdr.Close();
            }

            return(winnerInfoList);
        }
コード例 #9
0
ファイル: PageLottery.cs プロジェクト: skotbenben/cms
 public static string GetRedirectUrl(int publishmentSystemId, ELotteryType lotteryType)
 {
     return(PageUtils.GetWeiXinUrl(nameof(PageLottery), new NameValueCollection
     {
         { "publishmentSystemId", publishmentSystemId.ToString() },
         { "lotteryType", ELotteryTypeUtils.GetValue(lotteryType) }
     }));
 }
コード例 #10
0
ファイル: LotteryManager.cs プロジェクト: skotbenben/cms
        public static List <Article> Trigger(Model.KeywordInfo keywordInfo, ELotteryType lotteryType, string requestFromUserName)
        {
            var articleList = new List <Article>();

            DataProviderWx.CountDao.AddCount(keywordInfo.PublishmentSystemId, ECountType.RequestNews);

            var lotteryInfoList = DataProviderWx.LotteryDao.GetLotteryInfoListByKeywordId(keywordInfo.PublishmentSystemId, lotteryType, keywordInfo.KeywordId);

            var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(keywordInfo.PublishmentSystemId);

            foreach (var lotteryInfo in lotteryInfoList)
            {
                Article article = null;

                if (lotteryInfo != null && lotteryInfo.StartDate < DateTime.Now)
                {
                    var isEnd = false;

                    if (lotteryInfo.EndDate < DateTime.Now)
                    {
                        isEnd = true;
                    }

                    if (isEnd)
                    {
                        var endImageUrl = GetEndImageUrl(publishmentSystemInfo, lotteryType, lotteryInfo.EndImageUrl);

                        article = new Article()
                        {
                            Title       = lotteryInfo.EndTitle,
                            Description = lotteryInfo.EndSummary,
                            PicUrl      = endImageUrl
                        };
                    }
                    else
                    {
                        var imageUrl = GetImageUrl(publishmentSystemInfo, lotteryType, lotteryInfo.ImageUrl);
                        var pageUrl  = GetLotteryUrl(publishmentSystemInfo, lotteryInfo, requestFromUserName);

                        article = new Article()
                        {
                            Title       = lotteryInfo.Title,
                            Description = lotteryInfo.Summary,
                            PicUrl      = imageUrl,
                            Url         = pageUrl
                        };
                    }
                }

                if (article != null)
                {
                    articleList.Add(article);
                }
            }

            return(articleList);
        }
コード例 #11
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }
            lotteryType = ELotteryTypeUtils.GetEnumType(Request.QueryString["lotteryType"]);
            lotteryID   = TranslateUtils.ToInt(Request.QueryString["lotteryID"]);
            awardID     = TranslateUtils.ToInt(Request.QueryString["awardID"]);
            returnUrl   = StringUtils.ValueFromUrl(Request.QueryString["returnUrl"]);

            if (!string.IsNullOrEmpty(Request.QueryString["Delete"]))
            {
                var list = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);
                if (list.Count > 0)
                {
                    try
                    {
                        DataProviderWX.LotteryWinnerDAO.Delete(PublishmentSystemID, list);
                        SuccessMessage("删除成功!");
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, "删除失败!");
                    }
                }
            }

            spContents.ControlToPaginate = rptContents;
            spContents.ItemsPerPage      = 30;
            spContents.ConnectionString  = BaiRongDataProvider.ConnectionString;
            spContents.SelectCommand     = DataProviderWX.LotteryWinnerDAO.GetSelectString(PublishmentSystemID, lotteryType, lotteryID, awardID);
            spContents.SortField         = LotteryWinnerAttribute.ID;
            spContents.SortMode          = SortMode.DESC;
            rptContents.ItemDataBound   += new RepeaterItemEventHandler(rptContents_ItemDataBound);

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.CMS.LeftMenu.ID_Configration, "获奖名单查看", string.Empty);

                spContents.DataBind();

                var totalNum = 0;
                var wonNum   = 0;
                DataProviderWX.LotteryAwardDAO.GetCount(PublishmentSystemID, lotteryType, lotteryID, out totalNum, out wonNum);
                InfoMessage($"总奖品数:{totalNum},已中奖人数:{wonNum},剩余奖品数:{totalNum - wonNum}");

                var urlDelete = PageUtils.AddQueryString(GetRedirectUrl(PublishmentSystemID, lotteryType, lotteryID, awardID, returnUrl), "Delete", "True");
                btnDelete.Attributes.Add("onclick", JsUtils.GetRedirectStringWithCheckBoxValueAndAlert(urlDelete, "IDCollection", "IDCollection", "请选择需要删除的获奖项", "此操作将删除所选获奖项,确认吗?"));

                btnSetting.Attributes.Add("onclick", Modal.WinnerSetting.GetOpenWindowString(PublishmentSystemID));

                btnExport.Attributes.Add("onclick", Modal.Export.GetOpenWindowStringByLottery(PublishmentSystemID, lotteryType, lotteryID));

                btnReturn.Attributes.Add("onclick", $"location.href='{returnUrl}';return false");
            }
        }
コード例 #12
0
        public static string GetOpenWindowStringByLottery(int publishmentSystemID, ELotteryType lotteryType, int lotteryID)
        {
            var arguments = new NameValueCollection();

            arguments.Add("publishmentSystemID", publishmentSystemID.ToString());
            arguments.Add("lotteryType", ELotteryTypeUtils.GetValue(lotteryType));
            arguments.Add("lotteryID", lotteryID.ToString());

            return(JsUtils.OpenWindow.GetOpenWindowString("导出CSV", "modal_export.aspx", arguments, 400, 240, true));
        }
コード例 #13
0
ファイル: ELotteryType.cs プロジェクト: yankaics/cms-1
        public static ListItem GetListItem(ELotteryType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
コード例 #14
0
 public static string GetOpenWindowStringByLottery(int publishmentSystemId, ELotteryType lotteryType, int lotteryId)
 {
     return(PageUtils.GetOpenWindowString("导出CSV",
                                          PageUtils.GetWeiXinUrl(nameof(ModalExport), new NameValueCollection
     {
         { "publishmentSystemId", publishmentSystemId.ToString() },
         { "lotteryType", ELotteryTypeUtils.GetValue(lotteryType) },
         { "lotteryId", lotteryId.ToString() }
     }), 400, 240, true));
 }
コード例 #15
0
ファイル: PageLotteryWinner.cs プロジェクト: skotbenben/cms
 public static string GetRedirectUrl(int publishmentSystemId, ELotteryType lotteryType, int lotteryId, int awardId, string returnUrl)
 {
     return(PageUtils.GetWeiXinUrl(nameof(PageLotteryWinner), new NameValueCollection
     {
         { "publishmentSystemId", publishmentSystemId.ToString() },
         { "lotteryType", ELotteryTypeUtils.GetValue(lotteryType) },
         { "lotteryId", lotteryId.ToString() },
         { "awardId", awardId.ToString() },
         { "returnUrl", StringUtils.ValueToUrl(returnUrl) }
     }));
 }
コード例 #16
0
ファイル: ELotteryType.cs プロジェクト: yankaics/cms-1
 public static bool Equals(ELotteryType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
コード例 #17
0
        public int GetTotalNum(int publishmentSystemID, ELotteryType lotteryType, int lotteryID)
        {
            string sqlString =
                $"SELECT COUNT(*) FROM {TABLE_NAME} WHERE {LotteryWinnerAttribute.PublishmentSystemID} = {publishmentSystemID} AND {LotteryWinnerAttribute.LotteryType} = '{ELotteryTypeUtils.GetValue(lotteryType)}'";

            if (lotteryID > 0)
            {
                sqlString =
                    $"SELECT COUNT(*) FROM {TABLE_NAME} WHERE {LotteryWinnerAttribute.PublishmentSystemID} = {publishmentSystemID} AND {LotteryWinnerAttribute.LotteryID} = {lotteryID}";
            }

            return(BaiRongDataProvider.DatabaseDao.GetIntResult(sqlString));
        }
コード例 #18
0
        public string GetSelectString(int publishmentSystemID, ELotteryType lotteryType, int lotteryID, int awardID)
        {
            string whereString =
                $"WHERE {LotteryWinnerAttribute.PublishmentSystemID} = {publishmentSystemID} AND {LotteryWinnerAttribute.LotteryType} = '{ELotteryTypeUtils.GetValue(lotteryType)}'";

            if (lotteryID > 0)
            {
                whereString =
                    $"WHERE {LotteryWinnerAttribute.PublishmentSystemID} = {publishmentSystemID} AND {LotteryWinnerAttribute.LotteryID} = {lotteryID}";
            }
            if (awardID > 0)
            {
                whereString = $" AND {LotteryWinnerAttribute.AwardID} = {awardID}";
            }
            return(BaiRongDataProvider.TableStructureDao.GetSelectSqlString(TABLE_NAME, SqlUtils.Asterisk, whereString));
        }
コード例 #19
0
ファイル: LotteryDAO.cs プロジェクト: skotbenben/cms
        public List <int> GetLotteryIdList(int publishmentSystemId, ELotteryType lotteryType)
        {
            var lotteryIdList = new List <int>();

            string sqlWhere =
                $"WHERE {LotteryAttribute.PublishmentSystemId} = {publishmentSystemId} AND {LotteryAttribute.LotteryType} = '{ELotteryTypeUtils.GetValue(lotteryType)}'";
            var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, LotteryAttribute.Id, sqlWhere, null);

            using (var rdr = ExecuteReader(sqlSelect))
            {
                while (rdr.Read())
                {
                    lotteryIdList.Add(rdr.GetInt32(0));
                }
                rdr.Close();
            }

            return(lotteryIdList);
        }
コード例 #20
0
        public List <int> GetLotteryIDList(int publishmentSystemID, ELotteryType lotteryType)
        {
            var lotteryIDList = new List <int>();

            string SQL_WHERE =
                $"WHERE {LotteryAttribute.PublishmentSystemID} = {publishmentSystemID} AND {LotteryAttribute.LotteryType} = '{ELotteryTypeUtils.GetValue(lotteryType)}'";
            var SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, LotteryAttribute.ID, SQL_WHERE, null);

            using (var rdr = ExecuteReader(SQL_SELECT))
            {
                while (rdr.Read())
                {
                    lotteryIDList.Add(rdr.GetInt32(0));
                }
                rdr.Close();
            }

            return(lotteryIDList);
        }
コード例 #21
0
        public List <LotteryInfo> GetLotteryInfoListByKeywordID(int publishmentSystemID, ELotteryType lotteryType, int keywordID)
        {
            var lotteryInfoList = new List <LotteryInfo>();

            string SQL_WHERE =
                $"WHERE {LotteryAttribute.PublishmentSystemID} = {publishmentSystemID} AND {LotteryAttribute.LotteryType} = '{ELotteryTypeUtils.GetValue(lotteryType)}' AND {LotteryAttribute.IsDisabled} <> '{true}'";

            if (keywordID > 0)
            {
                SQL_WHERE += $" AND {LotteryAttribute.KeywordID} = {keywordID}";
            }
            var SQL_SELECT = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TABLE_NAME, 0, SqlUtils.Asterisk, SQL_WHERE, null);

            using (var rdr = ExecuteReader(SQL_SELECT))
            {
                while (rdr.Read())
                {
                    var lotteryInfo = new LotteryInfo(rdr);
                    lotteryInfoList.Add(lotteryInfo);
                }
                rdr.Close();
            }

            return(lotteryInfoList);
        }
コード例 #22
0
ファイル: LotteryManager.cs プロジェクト: skotbenben/cms
        public static string GetContentAwardImageUrl(PublishmentSystemInfo publishmentSystemInfo, ELotteryType lotteryType, string contentImageUrl, int awardCount)
        {
            if (!string.IsNullOrEmpty(contentImageUrl))
            {
                return(PageUtils.AddProtocolToUrl(PageUtility.ParseNavigationUrl(publishmentSystemInfo, contentImageUrl)));
            }
            var fileName = awardCount + ".png";

            if (awardCount < 2 || awardCount > 9)
            {
                fileName = "contentAward.png";
            }
            var directoryName = "img" + ELotteryTypeUtils.GetValue(lotteryType);

            return(PageUtils.AddProtocolToUrl(SiteFilesAssets.GetUrl(publishmentSystemInfo.Additional.ApiUrl, $"weixin/lottery/{directoryName}/{fileName}")));
        }
コード例 #23
0
ファイル: LotteryManager.cs プロジェクト: skotbenben/cms
        public static string GetEndImageUrl(PublishmentSystemInfo publishmentSystemInfo, ELotteryType lotteryType, string endImageUrl)
        {
            if (!string.IsNullOrEmpty(endImageUrl))
            {
                return(PageUtils.AddProtocolToUrl(PageUtility.ParseNavigationUrl(publishmentSystemInfo, endImageUrl)));
            }
            var directoryName = "img" + ELotteryTypeUtils.GetValue(lotteryType);

            return(PageUtils.AddProtocolToUrl(SiteFilesAssets.GetUrl(publishmentSystemInfo.Additional.ApiUrl, $"weixin/lottery/{directoryName}/end.jpg")));
        }
コード例 #24
0
 public static string GetRedirectUrl(int publishmentSystemID, ELotteryType lotteryType)
 {
     return(PageUtils.GetWXUrl(
                $"background_lottery.aspx?PublishmentSystemID={publishmentSystemID}&lotteryType={ELotteryTypeUtils.GetValue(lotteryType)}"));
 }
コード例 #25
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            lotteryType = ELotteryTypeUtils.GetEnumType(Request.QueryString["lotteryType"]);
            var lotteryName = ELotteryTypeUtils.GetText(lotteryType);

            if (!string.IsNullOrEmpty(Request.QueryString["Delete"]))
            {
                var list = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);
                if (list.Count > 0)
                {
                    try
                    {
                        DataProviderWX.LotteryDAO.Delete(PublishmentSystemID, list);

                        SuccessMessage(lotteryName + "删除成功!");
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, lotteryName + "删除失败!");
                    }
                }
            }

            spContents.ControlToPaginate = rptContents;
            spContents.ItemsPerPage      = 30;
            spContents.ConnectionString  = BaiRongDataProvider.ConnectionString;
            spContents.SelectCommand     = DataProviderWX.LotteryDAO.GetSelectString(PublishmentSystemID, lotteryType);
            spContents.SortField         = LotteryAttribute.ID;
            spContents.SortMode          = SortMode.ASC;
            rptContents.ItemDataBound   += new RepeaterItemEventHandler(rptContents_ItemDataBound);

            if (!IsPostBack)
            {
                if (lotteryType == ELotteryType.Scratch)
                {
                    BreadCrumb(AppManager.WeiXin.LeftMenu.ID_Function, AppManager.WeiXin.LeftMenu.Function.ID_Scratch, lotteryName, AppManager.WeiXin.Permission.WebSite.Scratch);
                }
                else if (lotteryType == ELotteryType.BigWheel)
                {
                    BreadCrumb(AppManager.WeiXin.LeftMenu.ID_Function, AppManager.WeiXin.LeftMenu.Function.ID_BigWheel, lotteryName, AppManager.WeiXin.Permission.WebSite.BigWheel);
                }
                else if (lotteryType == ELotteryType.GoldEgg)
                {
                    BreadCrumb(AppManager.WeiXin.LeftMenu.ID_Function, AppManager.WeiXin.LeftMenu.Function.ID_GoldEgg, lotteryName, AppManager.WeiXin.Permission.WebSite.GoldEgg);
                }
                else if (lotteryType == ELotteryType.Flap)
                {
                    BreadCrumb(AppManager.WeiXin.LeftMenu.ID_Function, AppManager.WeiXin.LeftMenu.Function.ID_Flap, lotteryName, AppManager.WeiXin.Permission.WebSite.Flap);
                }
                else if (lotteryType == ELotteryType.YaoYao)
                {
                    BreadCrumb(AppManager.WeiXin.LeftMenu.ID_Function, AppManager.WeiXin.LeftMenu.Function.ID_YaoYao, lotteryName, AppManager.WeiXin.Permission.WebSite.YaoYao);
                }

                spContents.DataBind();

                var urlAdd = string.Empty;
                if (lotteryType == ELotteryType.Scratch)
                {
                    urlAdd = BackgroundScratchAdd.GetRedirectUrl(PublishmentSystemID, 0);
                }
                else if (lotteryType == ELotteryType.BigWheel)
                {
                    urlAdd = BackgroundBigWheelAdd.GetRedirectUrl(PublishmentSystemID, 0);
                }
                else if (lotteryType == ELotteryType.GoldEgg)
                {
                    urlAdd = BackgroundGoldEggAdd.GetRedirectUrl(PublishmentSystemID, 0);
                }
                else if (lotteryType == ELotteryType.Flap)
                {
                    urlAdd = BackgroundFlapAdd.GetRedirectUrl(PublishmentSystemID, 0);
                }
                else if (lotteryType == ELotteryType.YaoYao)
                {
                    urlAdd = BackgroundYaoYaoAdd.GetRedirectUrl(PublishmentSystemID, 0);
                }
                btnAdd.Attributes.Add("onclick", $"location.href='{urlAdd}';return false");

                var urlDelete = PageUtils.AddQueryString(GetRedirectUrl(PublishmentSystemID, lotteryType), "Delete", "True");
                btnDelete.Attributes.Add("onclick", JsUtils.GetRedirectStringWithCheckBoxValueAndAlert(urlDelete, "IDCollection", "IDCollection", "请选择需要删除的" + lotteryName, "此操作将删除所选" + lotteryName + ",确认吗?"));
            }
        }
コード例 #26
0
 public static string GetRedirectUrl(int publishmentSystemID, ELotteryType lotteryType, int lotteryID, int awardID, string returnUrl)
 {
     return(PageUtils.GetWXUrl(
                $"background_lotteryWinner.aspx?publishmentSystemID={publishmentSystemID}&lotteryType={ELotteryTypeUtils.GetValue(lotteryType)}&lotteryID={lotteryID}&awardID={awardID}&returnUrl={StringUtils.ValueToUrl(returnUrl)}"));
 }
コード例 #27
0
ファイル: ELotteryType.cs プロジェクト: yankaics/cms-1
 public static bool Equals(string typeStr, ELotteryType type)
 {
     return(Equals(type, typeStr));
 }
コード例 #28
0
ファイル: LotteryDAO.cs プロジェクト: skotbenben/cms
        public List <LotteryInfo> GetLotteryInfoListByKeywordId(int publishmentSystemId, ELotteryType lotteryType, int keywordId)
        {
            var lotteryInfoList = new List <LotteryInfo>();

            string sqlWhere =
                $"WHERE {LotteryAttribute.PublishmentSystemId} = {publishmentSystemId} AND {LotteryAttribute.LotteryType} = '{ELotteryTypeUtils.GetValue(lotteryType)}' AND {LotteryAttribute.IsDisabled} <> '{true}'";

            if (keywordId > 0)
            {
                sqlWhere += $" AND {LotteryAttribute.KeywordId} = {keywordId}";
            }
            var sqlSelect = BaiRongDataProvider.TableStructureDao.GetSelectSqlString(ConnectionString, TableName, 0, SqlUtils.Asterisk, sqlWhere, null);

            using (var rdr = ExecuteReader(sqlSelect))
            {
                while (rdr.Read())
                {
                    var lotteryInfo = new LotteryInfo(rdr);
                    lotteryInfoList.Add(lotteryInfo);
                }
                rdr.Close();
            }

            return(lotteryInfoList);
        }