Esempio n. 1
0
        void GetHtmlPage()
        {
            MSProductOrderDAL orderDal = new MSProductOrderDAL();
            MyOrderList       myorderlistModel = new MyOrderList();
            string            strWhere = string.Empty; string payway = string.Empty;

            if (struid != null && struid != "")
            {
                struid = " and a.CustomerID='" + struid + "' ";
            }
            strWhere = struid + " and a.ID='" + oid + "'  ";
            DataSet orderds = orderDal.GetCustomerOrderList(strWhere);

            if (orderds != null && orderds.Tables.Count > 0 && orderds.Tables[0].Rows.Count > 0)
            {
                myorderlistModel = DataConvert.DataRowToModel <MyOrderList>(orderds.Tables[0].Rows[0]);
                payway           = myorderlistModel.PayWay;
                string[] way = payway.Split('|');
                try
                {
                    payway = way[1].ToString();
                }
                catch (Exception)
                {
                }
            }
            else
            {
                errormsg = JQDialog.alertOKMsgBox(5, "无效的请求方式",
                                                  "CustomerOrder.aspx", "error");
            }
            string text     = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/OrderDetail.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["errormsg"]    = errormsg;
            context.TempData["uid"]         = struid;
            context.TempData["payway"]      = payway;
            context.TempData["orderdetail"] = myorderlistModel;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Esempio n. 2
0
        void GetHtmlPage()
        {
            string strWhere = string.Empty; string productmodelid = string.Empty;
            string orderstate = string.Empty; string paystate = string.Empty; string receive = string.Empty;
            string oid = string.Empty;//支付成功返回订单

            #region -获取用户信息
            if (strOpenID != null && strOpenID != "")
            {
                MSCustomersDAL customerDal = new MSCustomersDAL();
                try
                {
                    customerid = customerDal.GetCustomerValueByOpenID("ID", strOpenID).ToString();
                }
                catch (Exception)
                {
                }
            }
            else
            {
                if (Session["customerID"] != null && Session["customerID"].ToString() != "")
                {
                    customerid = Session["customerID"].ToString();
                }
                else
                {
                    JQDialog.SetCookies("pageurl", "CustomerOrder.aspx", 2);
                    errormsg = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!",
                                                      "UserLogin.aspx", "error");
                }
            }
            #endregion
            List <MyOrderList> myorderlistModel = new List <MyOrderList>();
            if (customerid != null && customerid != "")
            {
                MSProductOrderDAL orderDal = new MSProductOrderDAL();
                #region -获取请求信息
                if (Request["oid"] != null && Request["oid"] != "")
                {
                    oid = Common.Common.NoHtml(Request["oid"]);
                }
                if (Request["orderstate"] != null && Request["orderstate"] != "")
                {
                    orderstate = Common.Common.NoHtml(Request["orderstate"]);
                }
                if (Request["paystate"] != null && Request["paystate"] != "")
                {
                    paystate = Common.Common.NoHtml(Request["paystate"]);
                }
                if (Request["receive"] != null && Request["receive"] != "")
                {
                    receive = Common.Common.NoHtml(Request["receive"]);
                }
                strWhere = " and a.CustomerID='" + customerid + "' ";
                if (orderstate.Trim() != null && orderstate.Trim() != "")
                {
                    strWhere += " and OrderState=" + orderstate;
                }
                if (paystate.Trim() != null && paystate.Trim() != "")
                {
                    strWhere += " and PayState=" + paystate;
                }
                else
                {
                    strWhere += " and PayState=1 ";
                }
                if (receive.Trim() != null && receive.Trim() != "")
                {
                    strWhere += " and IsReceive=" + receive;
                }
                else
                {
                    strWhere += " and IsReceive=0 ";
                }
                if (oid.Trim() != null && oid.Trim() != "")
                {
                    strWhere += " and a.ID='" + oid + "' ";
                }
                #endregion
                strWhere += " and a.CustomerID='" + customerid + "' ";
                DataSet orderds = orderDal.GetCustomerOrderList(strWhere);
                if (orderds != null && orderds.Tables.Count > 0 && orderds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow item in orderds.Tables[0].Rows)
                    {
                        MyOrderList ordermodel = DataConvert.DataRowToModel <MyOrderList>(item);
                        productmodelid = ordermodel.Mid;
                        if (ordermodel.Ptitle.Length > 10)
                        {
                            ordermodel.Ptitle = ordermodel.Ptitle.ToString().Substring(0, 10) + "..";
                        }
                        myorderlistModel.Add(ordermodel);
                    }
                }
            }
            else
            {
                JQDialog.SetCookies("pageurl", "CustomerOrder.aspx", 2);
                errormsg = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!",
                                                  "UserLogin.aspx", "error");
            }

            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/CustomerOrder.html"));
            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            //context.TempData["artList"] = liArtList;
            context.TempData["myorderlist"] = myorderlistModel;
            context.TempData["errormsg"]    = errormsg;
            context.TempData["customerid"]  = customerid;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
Esempio n. 3
0
        void GetHtmlPage()
        {
            string customerid = string.Empty; string strWhere = string.Empty;

            #region -获取用户信息
            if (strOpenID != null && strOpenID != "")
            {
                MSCustomersDAL customerDal = new MSCustomersDAL();
                try
                {
                    customerid = customerDal.GetCustomerValueByOpenID("ID", strOpenID).ToString();
                }
                catch (Exception)
                {
                }
            }
            else
            {
                if (Session["customerID"] != null && Session["customerID"].ToString() != "")
                {
                    customerid = Session["customerID"].ToString();
                }
                else
                {
                    JQDialog.SetCookies("pageurl", "CustomerOrder.aspx", 2);
                    errormsg = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!",
                                                      "UserLogin.aspx", "error");
                }
            }
            #endregion

            List <MyOrderList>   myorderlistModel = new List <MyOrderList>();
            List <MSProductPara> paralist         = new List <MSProductPara>();
            if (customerid != null && customerid != "")
            {
                MSProductOrderDAL orderDal = new MSProductOrderDAL();
                strWhere += " and a.CustomerID='" + customerid + "' and PayState=1 ";
                DataSet orderds = orderDal.GetCustomerOrderList(strWhere);
                if (orderds != null && orderds.Tables.Count > 0 && orderds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow item in orderds.Tables[0].Rows)
                    {
                        MyOrderList ordermodel = DataConvert.DataRowToModel <MyOrderList>(item);
                        myorderlistModel.Add(ordermodel);
                    }
                }
            }
            else
            {
                JQDialog.SetCookies("pageurl", "MyConsume.aspx", 2);
                errormsg = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!",
                                                  "UserLogin.aspx", "error");
            }

            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/MyConsume.html"));
            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            //context.TempData["artList"] = liArtList;
            context.TempData["errormsg"]    = errormsg;
            context.TempData["myorderlist"] = myorderlistModel;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }