Пример #1
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);
        }
Пример #2
0
        /// <summary>
        /// 订单提交
        /// </summary>
        void submitOrder()
        {
            string ordernum = string.Empty; int imgcount = 0;
            string img1 = string.Empty; string img2 = string.Empty;
            string openid = string.Empty; string userid = string.Empty;

            if (Session["OpenID"] != null && Session["OpenID"].ToString() != "")
            {
                openid = Session["OpenID"].ToString();
            }
            if (openid != null && openid != "")
            {
                MSCustomersDAL customerDal = new MSCustomersDAL();
                try
                {
                    userid = customerDal.GetCustomerValueByOpenID("ID", openid).ToString();
                }
                catch (Exception)
                {
                }
            }
            #region -------------获取请求值------------
            try
            {
                ordernum = Request.Form.Get("ordernum").ToString();
            }
            catch (Exception)
            {
                ordernum = "";
            }
            #endregion
            try
            {
                imgcount = Request.Files.Count;
            }
            catch (Exception)
            {
            }
            if (imgcount == 2)
            {
                img1 = UploadImg(0, "printimg", ordernum);
                img2 = UploadImg(1, "shareimg", ordernum);
                if (userid == null || userid == "" && ordernum != null && ordernum != "")
                {
                    MSProductOrderDAL orderDal = new MSProductOrderDAL();
                    userid = orderDal.GetOrderValueByID("CustomerID", ordernum).ToString();
                }
                if (ordernum != null && ordernum != "")
                {
                    MSPhotoSubmit    photoModel = new MSPhotoSubmit();
                    MSPhotoSubmitDAL photoDal   = new MSPhotoSubmitDAL();
                    photoModel.OrderNum = ordernum;
                    photoModel.Img1     = img1;
                    photoModel.Img2     = img2;
                    photoModel.UID      = userid;
                    photoModel.ID       = Guid.NewGuid().ToString("N").ToUpper();
                    if (!photoDal.AddPhotoSubmit(photoModel))
                    {
                        errormsg = JQDialog.alertOKMsgBoxGoBack(3, "操作失败,请重新操作!", false);
                    }
                    else
                    {
                        errormsg = JQDialog.alertOKMsgBox(3, "操作成功,请等待审核!", "PrintImgOrder.aspx", "succeed");
                    }
                }
                else
                {
                    errormsg = JQDialog.alertOKMsgBoxGoBack(3, "请输入正确的订单!", false);
                }
            }
            else
            {
                errormsg = JQDialog.alertOKMsgBoxGoBack(3, "请选择您要打印的照片和分享的照片!", false);
            }
        }
Пример #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);
        }