protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["fid"] != null && Request["fid"] != "") { errorscript = ""; strfid = Common.Common.NoHtml(Request["fid"]); } else { errorscript = JQDialog.alertOkMsgBoxClearBody(2, "操作失败<br/>请核对后再操作!"); } if (Session["customerID"] != null && Session["customerID"].ToString() != "") { strUID = Session["customerID"].ToString(); } if (Request["action"] != null && Request["action"] != "" && Request["tid"] != null && Request["tid"] != "") { action = Request["action"]; if (strUID != null && strUID != "") { TopicLoveOrLike(); Response.End(); } else { JQDialog.SetCookies("pageurl", "../../Comment/Index.aspx?fid=" + strfid, 2); errorscript = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!", "../PalmShop/ShopCode/UserLogin.aspx", "error"); } } GetTopicList(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["customerID"] != null && Session["customerID"].ToString() != "") { if (Request["action"] != null && Request["action"] != "") { action = Request["action"]; switch (action.Trim().ToLower()) { case "del": delProduct(); break; } } errorscript = ""; GetInfo(); } else { setCookies(); errorscript = JQDialog.alertOKMsgBox(2, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); GetInfo(); } } }
void GetHtmlPage() { string oid = string.Empty; MSOrderLogistics OLDetail = new MSOrderLogistics(); if (Request["oid"] != null && Request["oid"] != "") { oid = Common.Common.NoHtml(Request["oid"]); } if (oid != null && oid != "") { MSOrderLogisticsDAL OLdetail = new MSOrderLogisticsDAL(); DataSet ds = OLdetail.GetMSODetailByOID(oid); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { OLDetail = DataConvert.DataRowToModel <MSOrderLogistics>(ds.Tables[0].Rows[0]); } } else { errormsg = JQDialog.alertOKMsgBox(5, "无效的请求方式", "", "error"); } string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/CopyOrder.html")); JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext(); context.TempData["errormsg"] = errormsg; context.TempData["oldetail"] = OLDetail; JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text); t.Render(Response.Output); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["fid"] != null && Request["fid"] != "") { errorscript = ""; strfid = Common.Common.NoHtml(Request["fid"]); } else { errorscript = JQDialog.alertOkMsgBoxClearBody(2, "操作失败<br/>请核对后再操作!"); } if (Session["customerID"] != null && Session["customerID"].ToString() != "") { strUid = Common.Common.NoHtml(Session["customerID"].ToString()); if (Request["action"] != null && Request["action"] != "" && Request["action"].ToString().ToLower() == "edite") { editeCustomerinfo(); } } else { JQDialog.SetCookies("pageurl", "../../Comment/Customerinfo.aspx?fid=" + strfid, 2); errorscript = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!", "../PalmShop/ShopCode/UserLogin.aspx", "error"); } getTemplate(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { errorscript = ""; if (Request["sid"] != null && Request["sid"].ToString() != "") { sid = Request["sid"].ToString(); } if (Session["customerID"] != null && Session["customerID"].ToString() != "") { customerid = Session["customerID"].ToString(); if (Request["pid"] != null && Request["pid"].ToString() != "") { pid = Request["pid"].ToString(); } else { JQDialog.SetCookies("pageurl", "MyShop.aspx", 1); errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>请登录后再操作!", true); } if (Request["action"] != null && Request["action"] != "") { action = Request["action"]; } if (action.Trim() != null && action.Trim() != "") { switch (action.ToLower().Trim()) { case "getcateoption": GetOptionList(); break; case "edite": ProductEdite(); break; case "delimg": DelImg(); break; case "delpara": DelPara(); break; } } } else { JQDialog.SetCookies("pageurl", "MyShop.aspx", 1); errorscript = JQDialog.alertOKMsgBox(3, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); } GetHtmlInfo(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["customerID"] != null && Session["customerID"].ToString() != "") { if (Request["pid"] != null && Request["pid"] != "") { pid = Common.Common.NoHtml(Request["pid"]); if (Request["action"] != null && Request["action"] != "") { action = Request["action"]; } if (Request["ishand"] != null && Request["action"] != "") { try { ishand = Convert.ToInt32(Request["ishand"]); } catch (Exception) { } } if (action.Trim() != null && action.Trim() != "") { switch (action.ToLower().Trim()) { case "getcateoption": GetOptionList(); break; case "delimg": DelImg(); break; } } getinfo(); errorscript = ""; } else { JQDialog.SetCookies("pageurl", "PubSecHandEdit.aspx?ishand=" + ishand, 2); getinfo(); errorscript = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); return; } } else { JQDialog.SetCookies("pageurl", "PubSecHandEdit.aspx?ishand=" + ishand, 2); getinfo(); errorscript = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); return; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["mid"] != null && Request["mid"] != "") { mid = Common.Common.NoHtml(Request["mid"]); } if (Request["pid"] != null && Request["pid"] != "" && Request["num"] != null && Request["num"] != "") { errorscript = ""; strpid = Common.Common.NoHtml(Request["pid"]); quantity = Common.Common.NoHtml(Request["num"]); if (Session["customerID"] != null && Session["customerID"].ToString() != "") { customid = Session["customerID"].ToString(); GetOpenId(); if (Request["action"] != null && Request["action"] != "") { action = Request["action"]; action = action.ToLower().Trim(); switch (action) { case "setorder": setAddOrder(); return; case "setda": setUserAddress(); return; case "updalist": setUserAddress(); return; case "getdalist": GetUserAddress(); return; } } } else { setCookies(); errorscript = JQDialog.alertOKMsgBox(3, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); } } else { errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>您暂时没有权限访问!", true); } GetInfo(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { errormsg = ""; if (Session["customerID"] != null && Session["customerID"].ToString() != "") { customerid = Session["customerID"].ToString(); } if (Request["sid"] != null && Request["sid"] != "") { shopid = Common.Common.NoHtml(Request["sid"]); } else { if (Session["SID"] != null && Session["SID"].ToString() != "") { shopid = Session["SID"].ToString(); } else { GetShopID(); if (shopid == null || shopid == "") { JQDialog.SetCookies("pageurl", "MyShop.aspx", 1); errormsg = JQDialog.alertOKMsgBox(5, "您还没开通微店,请开通后再操作", "ApplyShop.aspx?action=apply", "error"); } } } if (Request["pid"] != null && Request["pid"] != "") { pid = Common.Common.NoHtml(Request["pid"]); } if (Request["action"] != null && Request["action"] != "") { action = Request["action"]; switch (action.ToLower().Trim()) { case "delproduct": DelProduct(); break; } } GetInfo(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["customerID"] == null || Session["customerID"].ToString() == "") { JQDialog.SetCookies("pageurl", "Vcoin.aspx", 2); errormsg = JQDialog.alertOKMsgBox(5, "您还没有登<br/>请登录后再操作!", "UserLogin.aspx", "error"); } else { struid = Session["customerID"].ToString(); } GetHtmlPage(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { errorscript = ""; if (Session["customerID"] != null && Session["customerID"].ToString() != "") { cuid = Session["customerID"].ToString(); } else { JQDialog.SetCookies("pageurl", "SaleManager.aspx", 2); errorscript = JQDialog.alertOKMsgBox(2, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); } GetHtmlPage(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { errowmsg = ""; try { if (Session["OpenID"] == null || Session["OpenID"].ToString() == "") { GetUserOpenID(); } else { strOpenID = Session["OpenID"].ToString(); } if (Session["customerID"] != null && Session["customerID"].ToString() != "") { uid = Common.Common.NoHtml(Session["customerID"].ToString()); if (Session["SID"] == null || Session["SID"].ToString() == "") { GetShopID(); if (sid != null && sid != "") { JQDialog.SetCookies("pageurl", "ShopIndex.aspx", 5); errowmsg = JQDialog.alertOKMsgBox(5, "您还没开通微店,请开通后再操作", "ApplyShop.aspx?action=reg", "error"); } } } else { JQDialog.SetCookies("pageurl", "ShopIndex.aspx", 2); errowmsg = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); } } catch (Exception ex) { errowmsg = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); } getHtmlpage(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { errorscript = ""; if (Session["SID"] != null && Session["SID"].ToString() != "") { sid = Session["SID"].ToString(); } else { JQDialog.SetCookies("pageurl", "MyShop.aspx", 5); errorscript = JQDialog.alertOKMsgBox(5, "您还没开通微店,请开通后再操作?", "ApplyShop.aspx?action=reg", "error"); } if (Session["customerID"] != null && Session["customerID"].ToString() != "") { customerid = Session["customerID"].ToString(); if (Request["action"] != null && Request["action"] != "") { action = Request["action"]; } if (action.Trim() != null && action.Trim() != "") { switch (action.ToLower().Trim()) { case "getcateoption": GetOptionList(); break; case "publish": PublicProduct(); break; } } } else { JQDialog.SetCookies("pageurl", "MyShop.aspx", 1); errorscript = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); } GetHtmlInfo(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["customerID"] != null && Session["customerID"].ToString() != "") { errorscript = ""; customerid = Session["customerID"].ToString(); GetOrderHandleList(); } else { setCookies(); errorscript = JQDialog.alertOKMsgBox(2, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); GetOrderHandleList(); return; } } }
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); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["oid"] != null && Request["oid"] != "") { oid = Common.Common.NoHtml(Request["oid"]); } else { errormsg = JQDialog.alertOKMsgBox(5, "无效的请求方式", "CustomerOrder.aspx", "error"); } if (oid != null && oid != "") { try { if (Session["customerID"] != null || Session["customerID"].ToString() != "") { struid = Session["customerID"].ToString(); } } catch (Exception) { } } if (Request["action"] != null && Request["action"] != "") { action = Common.Common.NoHtml(Request["action"]); } if (action != null && action != "") { action = action.Trim().ToLower(); switch (action) { case "edite": EditeOrder(); break; } } GetHtmlPage(); } }
void repcomment() { string commentdesc = string.Empty; StreamReader rd = new StreamReader(Server.MapPath("emotion/key.txt")); string keyword = rd.ReadLine(); try { commentdesc = HttpContext.Current.Request.Form.Get("commentdesc").ToString(); } catch (Exception) { commentdesc = ""; } if (commentdesc.Trim() != null && commentdesc.Trim() != "") { commentdesc = JQDialog.FilterKeyWord(commentdesc, keyword); commentdesc = JQDialog.GetTextFromHTML(commentdesc); MSForumComment commentModel = new MSForumComment(); MSForumCommentDAL commentDal = new MSForumCommentDAL(); commentModel.ID = Guid.NewGuid().ToString("N").ToUpper(); commentModel.Ctext = commentdesc; commentModel.Review = 1; commentModel.TID = strTid; commentModel.UID = strUid; commentModel.UpID = strupid; commentModel.Cstate = 0; if (commentDal.AddComment(commentModel)) { errorscript = JQDialog.alertOKMsgBox(3, "回复成功", "MyCommentList.aspx?fid=" + strfid, "error"); } else { errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>请核对后再操作!", true); } } else { errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>请重新再操作!", true); } }
void pubcomment() { string commentdesc = string.Empty; try { commentdesc = HttpContext.Current.Request.Form.Get("commentdesc").ToString(); } catch (Exception) { commentdesc = ""; } if (commentdesc.Trim() != null && commentdesc.Trim() != "") { MSForumComment commentModel = new MSForumComment(); MSForumCommentDAL commentDal = new MSForumCommentDAL(); strcommid = Guid.NewGuid().ToString("N").ToUpper(); commentModel.ID = strcommid; commentModel.Ctext = commentdesc; commentModel.Review = 1; commentModel.TID = strTid; commentModel.UID = strUid; commentModel.UpID = ""; commentModel.Cstate = 0; SaveImages(); if (commentDal.AddComment(commentModel)) { errorscript = JQDialog.alertOKMsgBox(3, "评论成功", "CommentList.aspx?fid=" + strfid + "&tid=" + strTid, "succeed"); } else { errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>请核对后再操作!", true); } } else { errorscript = JQDialog.alertOKMsgBoxGoBack(3, "操作失败<br/>请重新再操作!", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { errormsg = ""; if (Session["customerID"] != null && Session["customerID"].ToString() != "") { customerid = Session["customerID"].ToString(); GetOpenId(); } else { JQDialog.SetCookies("pageurl", "CustomerOrder.aspx", 2); errormsg = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); } if (Request["action"] != null && Request["action"] != "") { action = Request["action"]; action = action.ToLower().Trim(); switch (action) { case "receive": ReceiveOrder(); break; case "pubol": //submitOrder(); break; case "delorder": DelOrder(); break; } } GetHtmlPage(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["customerID"] != null && Session["customerID"].ToString() != "") { strUid = Common.Common.NoHtml(Session["customerID"].ToString()); } else { JQDialog.SetCookies("pageurl", "ShopIndex.aspx", 2); errorscript = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); } if (Request["sid"] != null && Request["sid"] != "") { strSID = Common.Common.NoHtml(Request["sid"]); } else { if (Session["SID"] != null && Session["SID"].ToString() != "") { strSID = Common.Common.NoHtml(Session["SID"].ToString()); } } if (Request["action"] != null && Request["action"] != "") { action = Common.Common.NoHtml(Request["action"]); action = action.Trim().ToLower(); } if (action == "uapply" || action == "uedite") { RegOrUpdateShop(); } GetHtmlPage(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { errorscript = ""; string pageurl = string.Empty; if (Request["sid"] != null && Request["sid"] != "") { shopid = Common.Common.NoHtml(Request["sid"]); pageurl = "?sid=" + shopid; } else { if (Session["SID"] != null && Session["SID"].ToString() != "") { shopid = Session["SID"].ToString(); pageurl = "?sid=" + shopid; } else { JQDialog.SetCookies("pageurl", "CustomerManager.aspx" + pageurl, 1); errorscript = JQDialog.alertOKMsgBox(3, "操作失败,请登录后再操作", "UserLogin.aspx", "error"); } } if (Session["customerID"] != null && Session["customerID"].ToString() != "") { cuid = Session["customerID"].ToString(); } else { JQDialog.SetCookies("pageurl", "CustomerManager.aspx" + pageurl, 2); errorscript = JQDialog.alertOKMsgBox(2, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); } GetHtmlPage(); } }
/// <summary> /// 提交订单 /// </summary> void submitOrder() { string oid = string.Empty; string cid = string.Empty; string cname = string.Empty; #region -获取页面请求值 try { oid = Request.Form.Get("ordernum").ToString(); } catch (Exception) { oid = ""; } try { cname = Request.Form.Get("cname").ToString(); } catch (Exception) { cname = ""; } try { cid = Request.Form.Get("cid").ToString(); } catch (Exception) { cid = ""; } #endregion strSiteCode = "VYIGO"; string customerid = string.Empty; string openid = string.Empty; if (oid != null && oid != "" && cid != null && cid != "") { MSOrderLogistics olModel = new MSOrderLogistics(); MSOrderLogisticsDAL olDal = new MSOrderLogisticsDAL(); MSProductOrderDAL OrderDal = new MSProductOrderDAL(); olModel.ID = cid; olModel.OID = oid; olModel.CName = cname; customerid = OrderDal.GetOrderValueByID("CustomerID", oid).ToString(); if (customerid != null && customerid != "") { MSCustomersDAL customerDal = new MSCustomersDAL(); openid = customerDal.GetCustomerValueByID("OpenID", customerid).ToString(); } if (olDal.AddOrderLogistics(olModel) && OrderDal.UpdateOrderState("IsSend", oid)) { string buyName = string.Empty; try { buyName = OrderDal.GetOrderValueByID("BuyName", oid).ToString(); WeiXinCore.WeiXin wx = WXHelper.CreateWeiXinInstanceBySiteCode(strSiteCode); List <TemplateMessageParam> paramList = new List <TemplateMessageParam>(); paramList.Add(new TemplateMessageParam("first", "亲,宝贝已经启程了,好想快点来到你身边")); paramList.Add(new TemplateMessageParam("delivername", cname)); paramList.Add(new TemplateMessageParam("ordername", cid)); paramList.Add(new TemplateMessageParam("remark", "请关注公众号【vgo2013】进入“快点我”查看完整物流信息")); SendTemplateMessageReturnObj temobj = wx.SendTemplateMessage(openid, "k4eMeEtKReeDvDRFAf8-Li9FuuHkaFPP1xQI6t3Jomo", "http://www.vgo2013.com/PalmShop/ShopCode/CopyOrder.aspx?oid=" + oid, paramList.ToArray(), ""); MSOrderLogDAL.AddMSOrderLog("提示客户订单【" + oid + "】已经发货,发送模板消息到客户OpenID【" + openid + "】"); bool flag = true; if (flag) { } } catch { } errormsg = JQDialog.alertOKMsgBox(3, "操作成功!", "OrderDelivery.aspx", "succeed"); } else { errormsg = JQDialog.alertOKMsgBoxGoBack(3, "操作失败,请重新操作!", false); } } else { errormsg = JQDialog.alertOKMsgBoxGoBack(3, "操作失败,请重新操作!", false); } }
/// <summary> /// 产品发布 /// </summary> void PublicProduct() { string cid = string.Empty; string ptitle = string.Empty; string pcontent = string.Empty; string price = string.Empty; string zipcode = string.Empty; string isnull = ""; #region --------------获取值-------------------- try { cid = HttpContext.Current.Request.Form.Get("setoptionvalue").ToString(); } catch (Exception) { cid = isnull; } try { ptitle = HttpContext.Current.Request.Form.Get("ptitle").ToString(); } catch (Exception) { ptitle = isnull; } try { pcontent = HttpContext.Current.Request.Form.Get("pdesc").ToString(); } catch (Exception) { pcontent = isnull; } try { price = HttpContext.Current.Request.Form.Get("price").ToString(); } catch (Exception) { price = isnull; } try { price = HttpContext.Current.Request.Form.Get("price").ToString(); } catch (Exception) { price = isnull; } try { zipcode = HttpContext.Current.Request.Form.Get("zipcode").ToString(); } catch (Exception) { zipcode = isnull; } #endregion Random random = new Random(); int r1 = (int)(random.Next(0, 9)); int r2 = (int)(random.Next(0, 9)); string now = DateTime.Now.ToString("yyMMddhhmmssf"); String paymentID = r1.ToString() + r2.ToString() + now; pid = "R" + paymentID; if (ptitle != null && ptitle != "") { MSProduct ProductModel = new MSProduct(); MSProductDAL ProductDal = new MSProductDAL(); ProductModel.ID = pid; ProductModel.Cid = cid; ProductModel.Ptitle = ptitle; ProductModel.Pcontent = pcontent; if (price != null && price != "") { ProductModel.Price = decimal.Parse(price); } ProductModel.CustomerID = customerid; ProductModel.SiteCode = ""; ProductModel.SID = sid; ProductModel.IsSecHand = 0; ProductModel.Pstate = 0; ProductModel.Review = 1; ProductModel.ZipCode = (zipcode == "" || zipcode == null ? "包邮" : zipcode); if (SaveImages() && AddProductModel() && ProductDal.AddMSProduct(ProductModel)) { errorscript = JQDialog.alertOKMsgBox(3, "操作成功!", "MyShop.aspx", "succeed"); } else { errorscript = JQDialog.alertOKMsgBox(3, "操作失败<br/>请核对后再操作!", "", "error"); } } }
protected void uploadbtn_Click(object sender, EventArgs e) { #region 信息判断 if (Session["customerID"] == null || Session["customerID"].ToString() == "") { JQDialog.SetCookies("pageurl", "PubSecHand.aspx?ishand=" + ishand, 2); errorscript = JQDialog.alertOKMsgBox(5, "操作失败<br/>请登录后再操作!", "UserLogin.aspx", "error"); return; } MSProduct productModel = new MSProduct(); if (setpvalue.Value.Trim() != null && setpvalue.Value.Trim() != "") { productModel.Cid = setpvalue.Value; } if (pdesc.Value.Trim() != null && pdesc.Value.Trim() != "") { productModel.Pcontent = pdesc.Value; } if (price.Value.Trim() != null && price.Value.Trim() != "") { productModel.Price = Convert.ToDecimal(price.Value); } if (ptitle.Value.Trim() != null && ptitle.Value.Trim() != "") { productModel.Ptitle = ptitle.Value; } if (price.Value.Trim() != null && price.Value.Trim() != "") { productModel.Price = Convert.ToDecimal(price.Value); } #endregion Random random = new Random(); int r1 = (int)(random.Next(0, 9)); //产生2个0-9的随机数 int r2 = (int)(random.Next(0, 9)); string now = DateTime.Now.ToString("yyMMddhhmmssf"); //一个13位的时间戳 String paymentID = r1.ToString() + r2.ToString() + now; pid = "R" + paymentID; productModel.ID = pid; productModel.IsSecHand = ishand; productModel.Pstate = 0; productModel.Review = 1; productModel.CustomerID = Session["customerID"].ToString(); MSProductDAL productDal = new MSProductDAL(); MSShopContacts contactModel = new MSShopContacts(); MSShopContactsDAL contactDal = new MSShopContactsDAL(); contactModel.ID = Guid.NewGuid().ToString("N").ToUpper(); contactModel.PID = pid; contactModel.IsDel = 0; contactModel.SID = ""; contactModel.NickName = UserName.Value; contactModel.Phone = UserPhone.Value; string pageurl = "NewProduct.aspx?ishand=" + ishand; if (productDal.AddMSProduct(productModel) && SaveImages() && contactDal.AddMSSContacts(contactModel)) { if (ishand == 1) { pageurl = "MySecHand.aspx"; } errorscript = JQDialog.alertOKMsgBox(5, "操作成功!", pageurl, "succeed"); } else { errorscript = JQDialog.alertOKMsgBox(3, "操作失败<br/>请核对后再操作!", "", "error"); return; } }
/// <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); } }
void topicpublish() { string topicdesc = string.Empty; #region --------获取标题和内容--------------- try { topictitle = HttpContext.Current.Request.Form.Get("topictitle").ToString(); } catch (Exception) { topictitle = ""; } try { topicdesc = HttpContext.Current.Request.Form.Get("topicdeschidden").ToString(); } catch (Exception) { topicdesc = ""; } #endregion MSForumTopicDAL forumtopicDal = new MSForumTopicDAL(); MSForumTopic forumtopicModel = new MSForumTopic(); StreamReader rd = new StreamReader(Server.MapPath("emotion/key.txt")); string keyword = rd.ReadLine(); if (topictitle != null && topictitle != "") { topictitle = JQDialog.FilterKeyWord(topictitle, keyword); topictitle = JQDialog.GetTextFromHTML(topictitle); forumtopicModel.TopicTitle = topictitle; } if (topicdesc != null && topicdesc != "") { topicdesc = JQDialog.FilterKeyWord(topicdesc, keyword); topicdesc = JQDialog.GetTextFromHTML(topicdesc); forumtopicModel.TopicDesc = topicdesc; } if (!forumtopicDal.ExistMSForumTopic(topictitle, strfid, strUid)) { strTid = Guid.NewGuid().ToString("N").ToUpper(); forumtopicModel.ID = strTid; forumtopicModel.TopicState = 0; forumtopicModel.FID = strfid; forumtopicModel.Treview = 1; forumtopicModel.UID = strUid; SaveImages(); if (forumtopicDal.AddMSForumTopic(forumtopicModel)) { errorscript = JQDialog.alertOKMsgBox(5, "操作成功", "MyTopicList.aspx?fid=" + strfid, "succeed"); } else { errorscript = JQDialog.alertOKMsgBoxGoBack(5, "操作失败<br/>请核对后再操作!", true); } } else { errorscript = JQDialog.alertOKMsgBoxGoBack(5, "操作失败<br/>请核对后再操作!", true); } }
void editeCustomerinfo() { string nickname = string.Empty; string modelimgurl = string.Empty; try { nickname = HttpContext.Current.Request.Form.Get("nickname").ToString(); } catch (Exception) { nickname = ""; } MSCustomers customerModel = new MSCustomers(); MSCustomersDAL customerDal = new MSCustomersDAL(); customerModel.ID = strUid; if (nickname != null && nickname != "") { #region -----------------头像上传------------------- HttpFileCollection files = HttpContext.Current.Request.Files; if (files.Count > 0) { //检查文件扩展名字 HttpPostedFile postedFile = files[0]; string fileName, fileExtension, file_oldid, file_id; //取出精确到毫秒的时间做文件的名称 string my_file_id = DateTime.Now.ToString("yyyyMMddHHmmssfff"); fileName = System.IO.Path.GetFileName(postedFile.FileName); fileExtension = System.IO.Path.GetExtension(fileName); file_id = my_file_id + fileExtension; if (fileName != "" && fileName != null && fileName.Length > 0) { fileExtension = System.IO.Path.GetExtension(fileName); string saveurl; modelimgurl = "HeadImg/"; saveurl = "../PalmShop/ShopCode/" + modelimgurl; saveurl = Server.MapPath(saveurl); if (!Directory.Exists(saveurl)) { Directory.CreateDirectory(saveurl); } int length = postedFile.ContentLength; if (length > 512000) { file_oldid = "old" + file_id; postedFile.SaveAs(saveurl + file_oldid); JQDialog.ystp(saveurl + file_oldid, saveurl + file_id, 15); File.Delete(saveurl + file_oldid); } else { postedFile.SaveAs(saveurl + file_id); } modelimgurl = modelimgurl + file_id; } } #endregion customerModel.NickName = nickname; if (modelimgurl != null && modelimgurl != "") { customerModel.HeadImg = modelimgurl; } customerModel.IsDel = 0; if (customerDal.UpdateCustomers(customerModel)) { if (modelimgurl != null && modelimgurl != "") { if (oldimgname != null && oldimgname != "") { File.Delete(String.Format(@"{0}PalmShop/ShopCode/{1}", Server.MapPath("~"), oldimgname)); } } errorscript = JQDialog.alertOKMsgBox(3, "操作成功", "MyTopicList.aspx?fid=" + strfid, "succeed"); } else { errorscript = JQDialog.alertOKMsgBox(3, "操作失败,请核对后再操作", "Customerinfo.aspx?fid=" + strfid, "error"); } } else { errorscript = JQDialog.alertOKMsgBox(3, "操作失败,请核对后再操作", "Customerinfo.aspx?fid=" + strfid, "error"); } }
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); }
void RegOrUpdateShop() { string shopname = string.Empty; string wxname = string.Empty; string wxnum = string.Empty; string isnull = ""; string ShopLogo = string.Empty; string ShopBackImg = string.Empty; string RealName = string.Empty; string IDnum = string.Empty; string IDimg = string.Empty; #region --------------------获取请求参数值------------------------------- try { shopname = Request.Form.Get("shopname").ToString(); } catch (Exception) { shopname = isnull; } try { wxname = Request.Form.Get("wxname").ToString(); } catch (Exception) { wxname = isnull; } try { wxnum = Request.Form.Get("wxnum").ToString(); } catch (Exception) { wxnum = isnull; } try { ShopLogo = Request.Files.Get("logoimg").FileName.ToString(); } catch (Exception) { ShopLogo = isnull; } try { ShopBackImg = Request.Files.Get("backimg").FileName.ToString(); } catch (Exception) { ShopBackImg = isnull; } try { RealName = Request.Files.Get("realname").FileName.ToString(); } catch (Exception) { RealName = isnull; } try { IDnum = Request.Form.Get("idnum").ToString(); } catch (Exception) { IDnum = isnull; } try { IDimg = Request.Files.Get("idimg").FileName.ToString(); } catch (Exception) { IDimg = isnull; } #endregion #region ---------------------获取图像--------------------------- if (ShopLogo != null && ShopLogo != "") { ShopLogo = "ShopLogo/" + UploadImg("logoimg"); } if (ShopBackImg != null && ShopBackImg != "") { ShopBackImg = "ShopLogo/" + UploadImg("backimg"); } if (IDimg != null && IDimg != "") { IDimg = "ShopLogo/" + UploadImg("idimg"); } #endregion MSShop shopModel = new MSShop(); MSShopDAL shopDal = new MSShopDAL(); #region ----------------------设置Model值----------------------------------- if (shopname != null && shopname != "") { shopModel.ShopName = shopname; } shopModel.WXName = wxname; shopModel.WXNum = wxnum; shopModel.ShopLogo = ShopLogo; shopModel.ShopBackImg = ShopBackImg; string regSid = string.Empty; if (strUid != null && strUid != "") { shopModel.UID = strUid; } if (strSID != null && strSID != "") { shopModel.ID = strSID; } else { regSid = Guid.NewGuid().ToString("N").ToUpper(); shopModel.ID = regSid; } #endregion #region ------------------更新注册店铺用户身份信息--------------------------- if (strUid != null && strUid != "") { MSCustomersDAL UserDal = new MSCustomersDAL(); UserDal.UpdateUserIDnum(strUid, RealName, IDnum, IDimg); } #endregion #region ---------------------更新或注册店铺信息-------------------------------------- if (strSID != null && strSID != "" && action == "uedite") { if (shopDal.UpdateMSShop(shopModel)) { errorscript = JQDialog.alertOKMsgBox(3, "操作成功!", "MyShop.aspx", "succeed"); } else { errorscript = JQDialog.alertOKMsgBox(3, "操作失败,请核对后再操作!", "ApplyShop.aspx", "error"); } } else { if (!shopDal.ExistMSShop(shopname, strUid)) { if (shopDal.AddMSShop(shopModel)) { Session["SID"] = regSid; errorscript = JQDialog.alertOKMsgBox(3, "操作成功!", "MyShop.aspx", "succeed"); } else { errorscript = JQDialog.alertOKMsgBox(3, "操作失败,请核对后再操作!", "ApplyShop.aspx", "error"); } } else { JQDialog.SetCookies("pageurl", "MyShop.aspx", 2); errorscript = JQDialog.alertOKMsgBox(3, "改店铺已经存在,请登录后操作", "UserLogin.aspx", "error"); } } #endregion }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { errormsg = ""; #region ------------获取请求信息---------------- if (Request["pname"] != null && Request["pname"] != "") { pname = Request["pname"]; } if (Request["ordernum"] != null && Request["ordernum"] != "") { ordernum = Request["ordernum"]; } if (Request["countcost"] != null && Request["countcost"] != "") { countcost = Request["countcost"]; } if (Request["customid"] != null && Request["customid"] != "") { customid = Request["customid"]; } #endregion #region -获取用户openid if (Session["OpenID"] == null || Session["OpenID"].ToString() == "") { if (customid != null && customid != "") { MSCustomersDAL customerDal = new MSCustomersDAL(); try { strOpenID = customerDal.GetCustomerValueByID("OpenID", customid).ToString(); } catch (Exception) { } } } else { strOpenID = Session["OpenID"].ToString(); } #endregion if (Request["action"] != null && Request["action"] != "") { action = Request["action"]; string strSiteCode = "VYIGO"; WXJSAPIPay wxpay = new WXJSAPIPay(strSiteCode); MSProductOrderDAL ptitleDal = new MSProductOrderDAL(); switch (action.Trim().ToLower()) { case "alipay": //ptitleDal.UpdateOrderPayWay(ordernum, "alipay"); //payway= WapPayHelper.BuildRequest(pname, ordernum, countcost, customid); AliWapPay pay = new AliWapPay("VYIGO"); string notify_url = "http://www.vgo2013.com/PalmShop/ShopCode/NotifyUrl.aspx"; string call_back_url = "http://www.vgo2013.com/PalmShop/ShopCode/Alipayreturn.aspx"; pay.DirectAliWayPay(this.Response, pname, ordernum, countcost, customid, call_back_url, notify_url); break; case "wxpay": ptitle = ptitleDal.GetOrderTitleByOID(ordernum); strIP = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; decimal countcostx = decimal.Parse(countcost); int v = (Int32)Math.Round(countcostx * 100, 0); try { wxpay.DirectWXJSAPIPay(this.Response, ptitle, ordernum, v, strIP, strOpenID, "http://www.vgo2013.com/PalmShop/ShopCode/PayState.aspx", null, ""); } catch (Exception emsg) { errormsg = JQDialog.alertOKMsgBox(5, emsg.Message, "", "error"); } break; } } GetHtmlPage(); } }
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); }