protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                string  openid = MyCommFun.RequestOpenid();
                int id=MyCommFun.RequestInt("aid");
                BLL.wx_purchase_customer customerbll = new BLL.wx_purchase_customer();
                BLL.wx_purchase_base basebll = new BLL.wx_purchase_base();
                customermodel = customerbll.GetModelopenid(openid);
                basemodel=basebll.GetModel(id);

                if (basemodel!=null)
                {
                    totalCount = Convert.ToInt32(basemodel.totalCount);
                    limitCount = Convert.ToInt32(basemodel.limitCount);
                    count = totalCount- customerbll.GetRecordCount(id);//剩余
                    this.totalCount1.Value = totalCount.ToString();
                    this.limitCount1.Value = limitCount.ToString();
                    this.count1.Value = count.ToString();
                    huodname = basemodel.activityName;
                    tuangj = Convert.ToInt32( basemodel.groupPrice);

                   yg= customerbll.GetRecordyg(openid, id);
                   int aa = limitCount - yg;
                    if (aa<0)
                    {
                        aa = 0;
                    }
                   this.limit.Value = aa.ToString();
                    //
                }


                if (customermodel!=null && customermodel.status==0)
                {
                    this.sndiv.Visible = true;
                    this.sn.Visible = true;
                    this.sn.Value = customermodel.sn;
                    this.customerName.Value = customermodel.customerName;
                    this.tel.Value = customermodel.tel;
                 //   this.customerNum.Value = customermodel.customerNum.ToString();
                    customerNum = customermodel.customerNum.ToString();
                    this.address.Value = customermodel.address;
                    this.Remark.Value = customermodel.Remark;


                    this.pwddiv.Visible = true;

                    //this.pwd.Value = basemodel.shopsPwd;
                }

            }

        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string openid = MyCommFun.RequestOpenid();
                int    id     = MyCommFun.RequestInt("aid");
                BLL.wx_purchase_customer customerbll = new BLL.wx_purchase_customer();
                BLL.wx_purchase_base     basebll     = new BLL.wx_purchase_base();
                customermodel = customerbll.GetModelopenid(openid);
                basemodel     = basebll.GetModel(id);

                if (basemodel != null)
                {
                    totalCount             = Convert.ToInt32(basemodel.totalCount);
                    limitCount             = Convert.ToInt32(basemodel.limitCount);
                    count                  = totalCount - customerbll.GetRecordCount(id);//剩余
                    this.totalCount1.Value = totalCount.ToString();
                    this.limitCount1.Value = limitCount.ToString();
                    this.count1.Value      = count.ToString();
                    huodname               = basemodel.activityName;
                    tuangj                 = Convert.ToInt32(basemodel.groupPrice);

                    yg = customerbll.GetRecordyg(openid, id);
                    int aa = limitCount - yg;
                    if (aa < 0)
                    {
                        aa = 0;
                    }
                    this.limit.Value = aa.ToString();
                    //
                }


                if (customermodel != null && customermodel.status == 0)
                {
                    this.sndiv.Visible      = true;
                    this.sn.Visible         = true;
                    this.sn.Value           = customermodel.sn;
                    this.customerName.Value = customermodel.customerName;
                    this.tel.Value          = customermodel.tel;

                    //   this.customerNum.Value = customermodel.customerNum.ToString();
                    customerNum        = customermodel.customerNum.ToString();
                    this.address.Value = customermodel.address;
                    this.Remark.Value  = customermodel.Remark;


                    this.pwddiv.Visible = true;

                    //this.pwd.Value = basemodel.shopsPwd;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                openid = MyCommFun.RequestOpenid();
                wid = MyCommFun.RequestInt("wid");
                id = MyCommFun.RequestInt("aid");

             

                BLL.wx_purchase_base gbll = new BLL.wx_purchase_base();
                BLL.wx_purchase_customer customerbll = new BLL.wx_purchase_customer();
                // DataSet ds = gbll.GetList(id);
                 model = gbll.GetModel(id);



                if (model.activityTimebegin.Value > DateTime.Now)//活动未开始
                {
                    
                    TimeSpan ts3 = new TimeSpan(Convert.ToDateTime(model.activityTimebegin).Ticks);
                    TimeSpan ts4 = new TimeSpan(DateTime.Now.Ticks);
                    TimeSpan endtime = ts3.Subtract(ts4).Duration();
                    //活动未开始
                    Response.Write("距离团购开始还有"+endtime.Days.ToString() + "天" + endtime.Hours.ToString() + "小时" + endtime.Minutes.ToString() + "分" + endtime.Seconds.ToString() + "秒");
                    Response.End();
                    return;
                }

                if (model.activityTimeend.Value< DateTime.Now)//活动结束
                {
                    introduction = model.introduction;
                    this.specialRemind.Text = model.specialRemind;
                    this.activeDescription.Text = model.activeDescription;
                    shopstel = model.shopstel;
                    address = model.address;
                    if (model.txtLatXPoint != null && model.txtLngYPoint != null)
                    {
                        txtLatXPoint = (float)model.txtLatXPoint;
                        txtLatYPoint = (float)model.txtLngYPoint;
                    }
                    tel = model.shopstel;
                    activityName = model.activityName;
                    days = "";
                    groupPrice = Convert.ToInt32(model.groupPrice);
                    costPrice = Convert.ToInt32(model.costPrice);
                    copyrightSetup = model.copyrightSetup;
                    imageUrl = model.imageUrl;
                    status = "团购已结束";
                    return;
                    
                }


                purchaseCount = customerbll.GetRecordCount(id);
               // chengtuanCount = customerbll.GetRecord(id);
                chengtuanCount = Convert.ToInt32(model.virtualPerson);
                introduction = model.introduction;
                this.specialRemind.Text = model.specialRemind;
                this.activeDescription.Text = model.activeDescription;
                shopstel = model.shopstel;
                address = model.address;
                if (model.txtLatXPoint != null && model.txtLngYPoint != null)
                {
                txtLatXPoint = (float)model.txtLatXPoint;
                txtLatYPoint = (float)model.txtLngYPoint;
                }
                tel = model.shopstel;
                activityName = model.activityName;
                TimeSpan ts1 = new TimeSpan(Convert.ToDateTime(model.activityTimeend).Ticks);
                TimeSpan ts2 = new TimeSpan(Convert.ToDateTime(model.activityTimebegin).Ticks);
                TimeSpan endtime1 = ts1.Subtract(ts2).Duration();
                days ="团购结束还有"+ endtime1.Days.ToString()+"天"+endtime1.Hours.ToString()+"小时"+endtime1.Minutes.ToString()+"分"+endtime1.Seconds.ToString()+"秒";
                groupPrice = Convert.ToInt32(model.groupPrice);
                costPrice = Convert.ToInt32(model.costPrice);
                copyrightSetup = model.copyrightSetup;
                imageUrl = model.imageUrl;
                //if (customerbll.Exists(openid))
                //{
                //    status = "每人限购" + model.limitCount + "件";
                //}

                customermodel = customerbll.GetModelSN(openid);

                if (customermodel!=null)
                {
                    if (customermodel.status == 0)//未消费
                    {
                        status = customermodel.sn;
                    }
                    else if (customermodel.status == 2)
                    {
                        int count = customerbll.GetRecordCount(openid,id);
                        status = "已经抢购" + count + "件" + "  " + "继续抢购";
                    }
                }
                
                else
                {
                    status = "抢购";
                }
            }
        }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                openid = MyCommFun.RequestOpenid();
                wid    = MyCommFun.RequestInt("wid");
                id     = MyCommFun.RequestInt("aid");


                BLL.wx_purchase_base     gbll        = new BLL.wx_purchase_base();
                BLL.wx_purchase_customer customerbll = new BLL.wx_purchase_customer();
                // DataSet ds = gbll.GetList(id);
                model = gbll.GetModel(id);



                if (model.activityTimebegin.Value > DateTime.Now)//活动未开始
                {
                    TimeSpan ts3     = new TimeSpan(Convert.ToDateTime(model.activityTimebegin).Ticks);
                    TimeSpan ts4     = new TimeSpan(DateTime.Now.Ticks);
                    TimeSpan endtime = ts3.Subtract(ts4).Duration();
                    //活动未开始
                    Response.Write("距离团购开始还有" + endtime.Days.ToString() + "天" + endtime.Hours.ToString() + "小时" + endtime.Minutes.ToString() + "分" + endtime.Seconds.ToString() + "秒");
                    Response.End();
                    return;
                }

                if (model.activityTimeend.Value < DateTime.Now)//活动结束
                {
                    introduction                = model.introduction;
                    this.specialRemind.Text     = model.specialRemind;
                    this.activeDescription.Text = model.activeDescription;
                    shopstel = model.shopstel;
                    address  = model.address;
                    if (model.txtLatXPoint != null && model.txtLngYPoint != null)
                    {
                        txtLatXPoint = (float)model.txtLatXPoint;
                        txtLatYPoint = (float)model.txtLngYPoint;
                    }
                    tel            = model.shopstel;
                    activityName   = model.activityName;
                    days           = "";
                    groupPrice     = Convert.ToInt32(model.groupPrice);
                    costPrice      = Convert.ToInt32(model.costPrice);
                    copyrightSetup = model.copyrightSetup;
                    imageUrl       = model.imageUrl;
                    status         = "团购已结束";
                    return;
                }


                purchaseCount = customerbll.GetRecordCount(id);
                // chengtuanCount = customerbll.GetRecord(id);
                chengtuanCount              = Convert.ToInt32(model.virtualPerson);
                introduction                = model.introduction;
                this.specialRemind.Text     = model.specialRemind;
                this.activeDescription.Text = model.activeDescription;
                shopstel = model.shopstel;
                address  = model.address;
                if (model.txtLatXPoint != null && model.txtLngYPoint != null)
                {
                    txtLatXPoint = (float)model.txtLatXPoint;
                    txtLatYPoint = (float)model.txtLngYPoint;
                }
                tel          = model.shopstel;
                activityName = model.activityName;
                TimeSpan ts1      = new TimeSpan(Convert.ToDateTime(model.activityTimeend).Ticks);
                TimeSpan ts2      = new TimeSpan(Convert.ToDateTime(model.activityTimebegin).Ticks);
                TimeSpan endtime1 = ts1.Subtract(ts2).Duration();
                days           = "团购结束还有" + endtime1.Days.ToString() + "天" + endtime1.Hours.ToString() + "小时" + endtime1.Minutes.ToString() + "分" + endtime1.Seconds.ToString() + "秒";
                groupPrice     = Convert.ToInt32(model.groupPrice);
                costPrice      = Convert.ToInt32(model.costPrice);
                copyrightSetup = model.copyrightSetup;
                imageUrl       = model.imageUrl;
                //if (customerbll.Exists(openid))
                //{
                //    status = "每人限购" + model.limitCount + "件";
                //}

                customermodel = customerbll.GetModelSN(openid);

                if (customermodel != null)
                {
                    if (customermodel.status == 0)//未消费
                    {
                        status = customermodel.sn;
                    }
                    else if (customermodel.status == 2)
                    {
                        int count = customerbll.GetRecordCount(openid, id);
                        status = "已经抢购" + count + "件" + "  " + "继续抢购";
                    }
                }

                else
                {
                    status = "抢购";
                }
            }
        }