Пример #1
0
        /// <summary>
        /// 绑定信息
        /// </summary>
        private void BindData()
        {
            UserInfo user = Session["user"] as UserInfo;

            if (user != null)
            {
                DataSet ds = CartTempService.GetList("addUser = "******"lblTotal") as Label;
                total += Convert.ToDouble(lbl.Text.Trim());
            }
            ViewState["carTotal"] = total.ToString("0.00");
        }
Пример #2
0
        /// <summary>
        /// 绑定信息
        /// </summary>
        private void BindData()
        {
            UserInfo user = Session["user"] as UserInfo;

            if (user != null)
            {
                ViewState["nologinImg"] = "images/hasproduct.png";
                #region Log In状态下
                DataSet ds = CartTempService.GetList("addUser = "******"productCount"] = ds.Tables[0].Rows.Count;
                    repInfo.DataSource        = ds;
                    repInfo.DataBind();
                    double total = 0;
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        if (Convert.ToInt32(dr["sel"]) == 1)
                        {
                            total += Convert.ToDouble(dr["remark"]);
                        }
                    }
                    ViewState["carTotal"] = total.ToString("0.00");
                }
                else
                {
                    repInfo.DataSource = null;
                    repInfo.DataBind();
                    this.cartButton.Visible = false;
                    this.noList.Visible     = true;
                }
                #endregion
            }
            else
            {
                Response.Redirect("login.html");
            }
        }
Пример #3
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        private void BindData()
        {
            #region 生成订单
            UserInfo user = Session["user"] as UserInfo;
            if (user != null)
            {
                OrderInfo order = new OrderInfo();
                order.orderNo    = "";
                order.orderName  = user.relName + "在Plate-X订单";
                order.proTotal   = 0;
                order.sendTotal  = 0;
                order.orderTotal = 0;
                double  total = 0;
                DataSet ds    = CartTempService.GetList("addUser = "******"remark"]);
                    }
                }
                order.orderTotal = Math.Round(total, 2);

                order.orderDesc   = "";
                order.remark      = order.orderName + ",订单日期:" + DateTime.Now.ToString("yyyy-MM-dd");
                order.recieveUser = user.relName;
                order.pid         = 0;
                order.cid         = 0;
                order.regionId    = 0;
                order.PName       = "";
                order.CName       = "";
                order.ReginName   = "";
                order.address     = "";
                order.mobile      = user.mobile;
                order.tel         = "";
                order.status      = 0;
                order.addTime     = DateTime.Now;
                order.infoType    = 0;
                order.addUser     = user.id;
                int maxId = OrderService.Add(order);

                order.orderNo = maxId + DateTime.Now.ToString("yyyyMd") + DateTime.Now.ToString("hhmmss");
                int rows = OrderService.UpdateOrderNo(maxId, order.orderNo, order.orderDesc);
                if (rows > 0)
                {
                    #region 订单详细
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            int pid   = Convert.ToInt32(ds.Tables[0].Rows[i]["productId"]);
                            int count = Convert.ToInt32(ds.Tables[0].Rows[i]["productCount"]);
                            #region 订单详细
                            Product item = ProductService.GetModel(pid);
                            if (item != null)
                            {
                                #region 订单详细表
                                OrderDetail od = new OrderDetail();
                                od.orderId      = maxId;
                                od.orderNo      = order.orderNo;
                                od.productId    = pid;
                                od.productCount = count;
                                od.isActive     = 0;
                                od.activeCode   = "";
                                od.activeMoney  = 0;
                                od.total        = Convert.ToDouble(ds.Tables[0].Rows[i]["remark"]);
                                od.satus        = 0;
                                od.remark       = "";
                                od.infoType     = 0;
                                OrderDetailService.Add(od);
                                #endregion
                                //清空临时表信息
                                CartTempService.DeleteByUserId(user.id, pid);
                            }
                            #endregion
                        }
                    }
                    #endregion
                }
                Response.Redirect("/zhifu_" + maxId + ".html");
            }
            #endregion
        }
Пример #4
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        private void BindData()
        {
            #region 生成订单
            UserInfo user = Session["user"] as UserInfo;
            if (user != null)
            {
                OrderInfo order = new OrderInfo();
                order.orderNo    = "";
                order.orderName  = user.relName + "在Plate-X订单";
                order.proTotal   = 0;
                order.sendTotal  = 0;
                order.orderTotal = 0;
                double  total = 0;
                DataSet ds    = CartTempService.GetList("addUser = "******"remark"]);
                    }
                }
                order.orderTotal  = Math.Round(total, 2);
                order.orderDesc   = "";
                order.remark      = order.orderName + ",订单日期:" + DateTime.Now.ToString("yyyy-MM-dd");
                order.recieveUser = user.relName;
                order.pid         = 0;
                order.cid         = 0;
                order.regionId    = 0;
                order.PName       = "";
                order.CName       = "";
                order.ReginName   = "";
                order.address     = "";
                order.mobile      = user.mobile;
                order.tel         = "";
                order.status      = 0;
                order.addTime     = DateTime.Now;
                order.infoType    = 0;
                order.addUser     = user.id;
                int maxId = OrderService.Add(order);

                //生成二维码:
                //string ranStr = Rand.GetMixPwd(10);
                //string websiteUrl = BaseConfigService.GetById(12);
                //string userUrlStr = "";

                // websiteUrl + "/mychat.aspx?orderId=" + maxId;
                //weixin://wxpay/bizpayurl?appid=wx8a02513b182f68af&mch_id=1372977102&nonce_str=" + ranStr + "&product_id=" + maxId + "&time_stamp=" + DateTime.Now.ToString("yyyyMMddhhmm") + "&sign=
                string url = "";// create_two(userUrlStr, maxId);


                order.orderDesc = url;

                order.orderNo = maxId + DateTime.Now.ToString("yyyyMMdd") + user.id + DateTime.Now.ToString("hhmmss");
                int rows = OrderService.UpdateOrderNo(maxId, order.orderNo, order.orderDesc);
                if (rows > 0)
                {
                    #region 订单详细
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            int     productId = Convert.ToInt32(dr["productId"]);
                            Product item      = ProductService.GetModel(productId);
                            if (item != null)
                            {
                                #region 订单详细表
                                OrderDetail od = new OrderDetail();
                                od.orderId      = maxId;
                                od.orderNo      = order.orderNo;
                                od.productId    = productId;
                                od.productCount = Convert.ToInt32(dr["productCount"]);
                                od.isActive     = 0;
                                od.activeCode   = "";
                                od.activeMoney  = 0;
                                od.total        = Convert.ToDouble(dr["remark"]);
                                od.satus        = 0;
                                od.remark       = "";
                                od.infoType     = 0;
                                OrderDetailService.Add(od);
                                #endregion

                                //清空临时表信息
                                CartTempService.DeleteByUserId(user.id, productId);
                            }
                        }
                    }

                    #endregion
                }
                Response.Redirect("orders_99.html");
            }
            #endregion
        }