⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 detailcoupon.aspx.cs

📁 易想商城系统
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using YXShop.Common;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Consumer
{
    public partial class Detailcoupon : System.Web.UI.Page
    {
        public PageSet ps; BasePage bp = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("008008000", PowerTree.PowerPanel.PowerType.look))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有查看此页面的权限!", "../index.aspx");
            }
            if (!Page.IsPostBack)
            {
                griddq();
                string strsqlxx =  " NoteType = 0 and BuckleOrAdd = 0";
                Label50.Text = gyfs(strsqlxx).ToString();
                string strsqlxxc = " NoteType = 0 and BuckleOrAdd = 1";
                Label51.Text = gyfs(strsqlxxc).ToString();
                Label52.Text = (Convert.ToDouble(Label50.Text.Trim()) - Convert.ToDouble(Label51.Text.Trim())).ToString();
            }
            if ((!IsPostBack) || ((Request["Event"] != null) && (Request["Event"] != "")))
            {
                griddq();
            }

        }
        public string gyfs(string strsqlz)
        {
            YXShop.BLL.UserInfoNote datab = new YXShop.BLL.UserInfoNote();
            List<YXShop.Model.UserInfoNote> datasz = datab.GetList(strsqlz);
            double strcgz = 0;
            foreach (YXShop.Model.UserInfoNote dd in datasz)
            {
                int i = datasz.Count;
   
                double cdm1 = Convert.ToDouble(dd.TicketCount.ToString());
              
       
                if (i == 0)
                {
                    strcgz = cdm1;
                }
                else
                {
                    strcgz = strcgz + cdm1;
                }

            }
            return strcgz.ToString();
        }
        #region 删除
        protected void Button1_Click(object sender, EventArgs e)
        {
            YXShop.BLL.UserInfoNote dataca = new YXShop.BLL.UserInfoNote();
            string strdel = "";
            if (sj.SelectedValue.ToString() == "0")
            {
                if (Request["typexx"].ToString() == "tj")
                {
                    strdel = "day(NoteDate) = day(getdate())-10 or Month(NoteDate)< Month(getdate()) or year(NoteDate)<year(getdate()) and  NoteType = 0 and BuckleOrAdd = 0";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "js")
                {
                    strdel = "day(NoteDate) = day(getdate())-10 or Month(NoteDate)< Month(getdate()) or year(NoteDate)<year(getdate()) and  NoteType = 0 and BuckleOrAdd = 1";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "all")
                {
                    strdel = "day(NoteDate) = day(getdate())-10 or Month(NoteDate)< Month(getdate()) or year(NoteDate)<year(getdate()) and  NoteType = 0";
                    dataca.Delecttj(strdel);
                }
            }
            if (sj.SelectedValue.ToString() == "1")
            {
                if (Request["typexx"].ToString() == "tj")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-1 or year(NoteDate)<year(getdate()) and  NoteType = 0 and BuckleOrAdd = 0";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "js")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-1 or year(NoteDate)<year(getdate()) and  NoteType = 0 and BuckleOrAdd = 1";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "all")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-1 or year(NoteDate)<year(getdate()) and  NoteType = 0";
                    dataca.Delecttj(strdel);
                }
            }

            if (sj.SelectedValue.ToString() == "2")
            {
                if (Request["typexx"].ToString() == "tj")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-2 or year(NoteDate)<year(getdate()) and  NoteType = 0 and BuckleOrAdd = 0";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "js")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-2  or year(NoteDate)<year(getdate()) and  NoteType = 0 and BuckleOrAdd = 1";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "all")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-2 or year(NoteDate)<year(getdate()) and  NoteType = 0";
                    dataca.Delecttj(strdel);
                }

            }
            if (sj.SelectedValue.ToString() == "3")
            {
                if (Request["typexx"].ToString() == "tj")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-3  or year(NoteDate)<year(getdate()) and  NoteType = 0 and BuckleOrAdd = 0";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "js")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-3  or year(NoteDate)<year(getdate()) and NoteType = 0 and BuckleOrAdd = 1";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "all")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-3  or year(NoteDate)<year(getdate()) and NoteType = 0";
                    dataca.Delecttj(strdel);
                }

            }
            if (sj.SelectedValue.ToString() == "4")
            {
                if (Request["typexx"].ToString() == "tj")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-6  or year(NoteDate)<year(getdate()) and  NoteType = 0 and BuckleOrAdd = 0";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "js")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-6  or year(NoteDate)<year(getdate()) and  NoteType = 0 and BuckleOrAdd = 1";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "all")
                {
                    strdel = "Month(NoteDate) = Month(getdate())-6  or year(NoteDate)<year(getdate()) and  NoteType = 0";
                    dataca.Delecttj(strdel);
                }
            }
            if (sj.SelectedValue.ToString() == "5")
            {
                if (Request["typexx"].ToString() == "tj")
                {
                    strdel = "year(NoteDate)<=year(getdate())-1 and  NoteType = 0 and BuckleOrAdd = 0";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "js")
                {
                    strdel = "year(NoteDate)<=year(getdate())-1 and  NoteType = 0 and BuckleOrAdd = 1";
                    dataca.Delecttj(strdel);
                }
                if (Request["typexx"].ToString() == "all")
                {
                    strdel = "year(NoteDate)<=year(getdate())-1 and  NoteType = 0";
                    dataca.Delecttj(strdel);
                }
            }
        }

        #endregion

        #region 点券列表
        private void griddq()
        {
            YXShop.BLL.UserInfoNote dataCAasd = new YXShop.BLL.UserInfoNote();
            int pageIndex = Request["pageIndex"] == null ? 0 : int.Parse(Request["pageIndex"]);
            if (pageIndex < 0)
            {
                pageIndex = 0;
            }
            if ((Request["Event"] == null) || (Request["Event"] == ""))
            {
                pageIndex = 0;
            }

            string strsql = "NoteType = 0";
            if (Request["type"] != null)
            {
                if (Request["type"] == "tj")
                {
                    strsql = "NoteType = 0 and BuckleOrAdd = 0";
                }
                if (Request["type"] == "js")
                {
                    strsql = "NoteType = 0 and BuckleOrAdd = 1";
                }
            }
            List<YXShop.Model.UserInfoNote> datas = dataCAasd.GetList(strsql);
            dg2.DataSource = datas;
            ps = new PageSet(datas.Count, PageSet.PageSize, pageIndex);
            if (ps.PageCount <= pageIndex + 1)
            {
                pageIndex = ps.PageCount - 1;
            }

            dg2.PageSize = PageSet.PageSize;

            dg2.PageIndex = pageIndex;

            if (datas.Count < 1)
            {
                dg2.BackColor = System.Drawing.Color.White;
            }
            
            dg2.DataBind();
        }
        #endregion

        protected void dg2_RowDataBound(object sender, GridViewRowEventArgs e)
        {

            if (!(e.Row.DataItem is YXShop.Model.UserInfoNote))
            {
                return;
            }
            YXShop.Model.UserInfoNote data = (e.Row.DataItem as YXShop.Model.UserInfoNote);
            if (data != null)
            {
                e.Row.Cells[1].Text = data.BuckleOrAdd.ToString() == "0" ? data.TicketCount.ToString() : string.Empty;
                e.Row.Cells[2].Text = data.BuckleOrAdd.ToString() == "1" ? data.TicketCount.ToString() : string.Empty;
            }

        }
        public string jiequ(string str)
        {
            string str1;
            if (str.Length <= 35)
            {
                str1 = str;
            }
            else
            {
                str1 = str.Substring(0, 34) + "...";
            }
            return str1;
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -