예제 #1
0
        private void lkbtnDownloadCheck_Click(object sender, EventArgs e)
        {
            int num = 0;

            foreach (GridViewRow row in grdGift.Rows)
            {
                CheckBox box = (CheckBox)row.FindControl("checkboxCol");
                if ((box != null) && box.Checked)
                {
                    num++;
                }
            }
            if (num == 0)
            {
                ShowMsg("请先选择要下载的礼品", false);
            }
            else
            {
                foreach (GridViewRow row2 in grdGift.Rows)
                {
                    CheckBox box2 = (CheckBox)row2.FindControl("checkboxCol");
                    if (box2.Checked)
                    {
                        int giftId = (int)grdGift.DataKeys[row2.RowIndex].Value;
                        SubsiteGiftHelper.DownLoadGift(GiftHelper.GetGiftDetails(giftId));
                    }
                }
                ShowMsg("下载的礼品成功", true);
                ReloadGiftsList(true);
            }
        }
예제 #2
0
        private void lkbtnDownloadCheck_Click(object sender, System.EventArgs e)
        {
            int num = 0;

            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdGift.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
                if (checkBox != null && checkBox.Checked)
                {
                    num++;
                }
            }
            if (num == 0)
            {
                this.ShowMsg("请先选择要下载的礼品", false);
                return;
            }
            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow2 in this.grdGift.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox2 = (System.Web.UI.WebControls.CheckBox)gridViewRow2.FindControl("checkboxCol");
                if (checkBox2.Checked)
                {
                    int      giftId      = (int)this.grdGift.DataKeys[gridViewRow2.RowIndex].Value;
                    GiftInfo giftDetails = GiftHelper.GetGiftDetails(giftId);
                    SubsiteGiftHelper.DownLoadGift(giftDetails);
                }
            }
            this.ShowMsg("下载的礼品成功", true);
            this.ReloadGiftsList(true);
        }
예제 #3
0
 private void DownLoad()
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["oper"]) && base.Request.QueryString["oper"].Trim() == "download" && !string.IsNullOrEmpty(base.Request.QueryString["GiftId"]) && int.Parse(base.Request.QueryString["GiftId"].Trim()) > 0)
     {
         int      giftId      = int.Parse(base.Request.QueryString["GiftId"].Trim());
         GiftInfo giftDetails = GiftHelper.GetGiftDetails(giftId);
         if (giftDetails.IsDownLoad && giftDetails.PurchasePrice > 0m)
         {
             if (SubsiteGiftHelper.DownLoadGift(giftDetails))
             {
                 this.ReloadGiftsList(true);
                 this.ShowMsg("下载礼品" + giftDetails.Name + "成功!", true);
                 return;
             }
             this.ShowMsg("下载礼品" + giftDetails.Name + "失败!", false);
         }
     }
 }
예제 #4
0
 private void DownLoad()
 {
     if ((!string.IsNullOrEmpty(base.Request.QueryString["oper"]) && (base.Request.QueryString["oper"].Trim() == "download")) && (!string.IsNullOrEmpty(base.Request.QueryString["GiftId"]) && (int.Parse(base.Request.QueryString["GiftId"].Trim()) > 0)))
     {
         GiftInfo giftDetails = GiftHelper.GetGiftDetails(int.Parse(base.Request.QueryString["GiftId"].Trim()));
         if (giftDetails.IsDownLoad && (giftDetails.PurchasePrice > 0M))
         {
             if (SubsiteGiftHelper.DownLoadGift(giftDetails))
             {
                 ReloadGiftsList(true);
                 ShowMsg("下载礼品" + giftDetails.Name + "成功!", true);
             }
             else
             {
                 ShowMsg("下载礼品" + giftDetails.Name + "失败!", false);
             }
         }
     }
 }