コード例 #1
0
ファイル: coupon.aspx.cs プロジェクト: liulizhiwoxin/Test
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page      = Vincent._DTcms.DTRequest.GetQueryInt("page", 1);
            ipt_Time.Value = this.keyDate;

            BLL.user_coupon_log bll = new BLL.user_coupon_log();
            this.rptList.DataSource = bll.GetList1(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Vincent._DTcms.Utils.CombUrlTxt("coupon.aspx", "keywords={0}&keyDate={1}&page={2}", this.keywords, this.keyDate, "__id__");

            PageContent.InnerHtml = Vincent._DTcms.Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 15);
        }
コード例 #2
0
ファイル: coupon.aspx.cs プロジェクト: liulizhiwoxin/Test
 /// <summary>
 /// 获取订单总金额
 /// </summary>
 /// <param name="total_amount"></param>
 protected void getTotalAmount()
 {
     coupon_amount = 0M;
     if (this.keyDate == "")
     {
         BLL.user_coupon_log bll = new BLL.user_coupon_log();
         DataTable           dt  = bll.GetList1(0, " 1=1", " use_time desc").Tables[0];
         foreach (DataRow row in dt.Rows)
         {
             Model.orders model = new BLL.orders().GetModel(int.Parse(row["order_id"].ToString()));
             if (model != null)
             {
                 if (decimal.Parse(row["amount"].ToString()) > model.order_amount)
                 {
                     coupon_amount += model.order_amount;
                 }
                 else
                 {
                     coupon_amount += decimal.Parse(row["amount"].ToString());
                 }
             }
         }
     }
     else
     {
         BLL.user_coupon_log bll = new BLL.user_coupon_log();
         DataTable           dt  = bll.GetList1(0, " 1=1 and datediff(dd,use_time,'" + this.keyDate + "')=0", " use_time desc").Tables[0];
         foreach (DataRow row in dt.Rows)
         {
             if (int.Parse(row["status"].ToString()) == 2)
             {
                 Model.orders model = new BLL.orders().GetModel(int.Parse(row["order_id"].ToString()));
                 if (model != null)
                 {
                     if (decimal.Parse(row["amount"].ToString()) > model.order_amount)
                     {
                         coupon_amount += model.order_amount;
                     }
                     else
                     {
                         coupon_amount += decimal.Parse(row["amount"].ToString());
                     }
                 }
             }
         }
     }
 }