Exemplo n.º 1
0
        public void ExportLotteryCSV(string filePath, List <LotteryWinnerInfo> winnerInfoList)
        {
            var head = new List <string>();

            head.Add("序号");
            head.Add("奖项");
            head.Add("姓名");
            head.Add("手机");
            head.Add("邮箱");
            head.Add("地址");
            head.Add("状态");
            head.Add("中奖时间");
            head.Add("兑奖码");
            head.Add("兑奖时间");

            var rows = new List <List <string> >();

            var index = 1;

            foreach (var winnerInfo in winnerInfoList)
            {
                LotteryAwardInfo awardInfo = null;
                if (awardInfoMap.ContainsKey(winnerInfo.AwardID))
                {
                    awardInfo = awardInfoMap[winnerInfo.AwardID];
                }
                else
                {
                    awardInfo = DataProviderWX.LotteryAwardDAO.GetAwardInfo(winnerInfo.AwardID);
                    awardInfoMap.Add(winnerInfo.AwardID, awardInfo);
                }

                var award = string.Empty;
                if (awardInfo != null)
                {
                    award = awardInfo.AwardName + ":" + awardInfo.Title;
                }

                var row = new List <string>();

                row.Add((index++).ToString());
                row.Add(award);
                row.Add(winnerInfo.RealName);
                row.Add(winnerInfo.Mobile);
                row.Add(winnerInfo.Email);
                row.Add(winnerInfo.Address);
                row.Add(EWinStatusUtils.GetText(EWinStatusUtils.GetEnumType(winnerInfo.Status)));
                row.Add(DateUtils.GetDateAndTimeString(winnerInfo.AddDate));
                row.Add(winnerInfo.CashSN);
                row.Add(DateUtils.GetDateAndTimeString(winnerInfo.CashDate));

                rows.Add(row);
            }

            CSVUtils.Export(filePath, head, rows);
        }
Exemplo n.º 2
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var winnerInfo = new LotteryWinnerInfo(e.Item.DataItem);

                var ltlItemIndex = e.Item.FindControl("ltlItemIndex") as Literal;
                var ltlAward     = e.Item.FindControl("ltlAward") as Literal;
                var ltlRealName  = e.Item.FindControl("ltlRealName") as Literal;
                var ltlMobile    = e.Item.FindControl("ltlMobile") as Literal;
                var ltlEmail     = e.Item.FindControl("ltlEmail") as Literal;
                var ltlAddress   = e.Item.FindControl("ltlAddress") as Literal;
                var ltlStatus    = e.Item.FindControl("ltlStatus") as Literal;
                var ltlAddDate   = e.Item.FindControl("ltlAddDate") as Literal;
                var ltlCashSN    = e.Item.FindControl("ltlCashSN") as Literal;
                var ltlCashDate  = e.Item.FindControl("ltlCashDate") as Literal;

                ltlItemIndex.Text = (e.Item.ItemIndex + 1).ToString();

                LotteryAwardInfo awardInfo = null;
                if (awardInfoMap.ContainsKey(winnerInfo.AwardID))
                {
                    awardInfo = awardInfoMap[winnerInfo.AwardID];
                }
                else
                {
                    awardInfo = DataProviderWX.LotteryAwardDAO.GetAwardInfo(winnerInfo.AwardID);
                    awardInfoMap.Add(winnerInfo.AwardID, awardInfo);
                }
                if (awardInfo != null)
                {
                    ltlAward.Text =
                        $@"<a href=""{GetRedirectUrl(PublishmentSystemID,
                            ELotteryTypeUtils.GetEnumType(winnerInfo.LotteryType), winnerInfo.LotteryID, winnerInfo.AwardID,
                            returnUrl)}"">{awardInfo.AwardName + ":" + awardInfo.Title}</a>";
                }

                ltlRealName.Text = winnerInfo.RealName;
                ltlMobile.Text   = winnerInfo.Mobile;
                ltlEmail.Text    = winnerInfo.Email;
                ltlAddress.Text  = winnerInfo.Address;
                ltlStatus.Text   = EWinStatusUtils.GetText(EWinStatusUtils.GetEnumType(winnerInfo.Status));
                ltlAddDate.Text  = DateUtils.GetDateAndTimeString(winnerInfo.AddDate);
                ltlCashSN.Text   = winnerInfo.CashSN;
                ltlCashDate.Text = DateUtils.GetDateAndTimeString(winnerInfo.CashDate);
            }
        }
Exemplo n.º 3
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                DataProviderWX.LotteryWinnerDAO.UpdateStatus(EWinStatusUtils.GetEnumType(ddlStatus.SelectedValue), TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]));

                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, "失败:" + ex.Message);
            }

            if (isChanged)
            {
                JsUtils.OpenWindow.CloseModalPage(Page);
            }
        }