コード例 #1
0
 private void btnLogin_Click(object sender, System.EventArgs e)
 {
     if (!Hidistro.Membership.Context.HiContext.Current.CheckVerifyCode(this.txtCode.Text.Trim()))
     {
         this.ShowMessage("验证码不正确", false);
     }
     else
     {
         Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(0, this.txtUserName.Text, false, true);
         if (user == null || user.IsAnonymous || user.UserRole != Hidistro.Membership.Core.Enums.UserRole.Distributor)
         {
             this.ShowMessage("无效的用户信息", false);
         }
         else
         {
             Hidistro.Membership.Context.Distributor distributor = user as Hidistro.Membership.Context.Distributor;
             distributor.Password = this.txtPassword.Text;
             if (Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings && user.UserId != Hidistro.Membership.Context.HiContext.Current.SiteSettings.UserId.Value)
             {
                 this.ShowMessage("分销商只能在自己的站点或主站上登录", false);
             }
             else
             {
                 Hidistro.Membership.Core.Enums.LoginUserStatus loginUserStatus = SubsiteStoreHelper.ValidLogin(distributor);
                 if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.Success)
                 {
                     System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(distributor.Username, false);
                     Hidistro.Membership.Core.IUserCookie userCookie = distributor.GetUserCookie();
                     userCookie.WriteCookie(authCookie, 30, false);
                     this.Page.Response.Cookies["hishopLoginStatus"].Value = "true";
                     Hidistro.Membership.Context.HiContext.Current.User    = distributor;
                     distributor.OnLogin();
                     Hidistro.Membership.Context.SiteSettings siteSettings = Hidistro.Membership.Context.SettingsManager.GetSiteSettings(Hidistro.Membership.Context.HiContext.Current.User.UserId);
                     if (siteSettings == null)
                     {
                         this.Page.Response.Redirect("nositedefault.aspx", true);
                     }
                     else
                     {
                         this.Page.Response.Redirect("default.aspx", true);
                     }
                 }
                 else
                 {
                     if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.AccountPending)
                     {
                         this.ShowMessage("用户账号还没有通过审核", false);
                     }
                     else
                     {
                         if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.AccountLockedOut)
                         {
                             this.ShowMessage("用户账号已被锁定,暂时不能登录系统", false);
                         }
                         else
                         {
                             if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.InvalidCredentials)
                             {
                                 this.ShowMessage("用户名或密码错误", false);
                             }
                             else
                             {
                                 this.ShowMessage("登录失败,未知错误", false);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: ManageMembers.cs プロジェクト: uvbs/eshopSanQiang
        private void btnSendEmail_Click(object sender, System.EventArgs e)
        {
            Hidistro.Membership.Context.SiteSettings siteSetting = this.GetSiteSetting();
            string text = siteSetting.EmailSender.ToLower();

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请先选择发送方式", false);
                return;
            }
            ConfigData configData = null;

            if (siteSetting.EmailEnabled)
            {
                configData = new ConfigData(HiCryptographer.Decrypt(siteSetting.EmailSettings));
            }
            if (configData == null)
            {
                this.ShowMsg("请先选择发送方式并填写配置信息", false);
                return;
            }
            if (!configData.IsValid)
            {
                string text2 = "";
                foreach (string current in configData.ErrorMsgs)
                {
                    text2 += Formatter.FormatErrorMessage(current);
                }
                this.ShowMsg(text2, false);
                return;
            }
            string text3 = this.txtemailcontent.Value.Trim();

            if (string.IsNullOrEmpty(text3))
            {
                this.ShowMsg("请先填写发送的内容信息", false);
                return;
            }
            string text4 = null;

            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdMemberList.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
                if (checkBox.Checked)
                {
                    string text5 = ((System.Web.UI.DataBoundLiteralControl)gridViewRow.Controls[3].Controls[0]).Text.Trim().Replace("<div></div>", "");
                    if (!string.IsNullOrEmpty(text5) && System.Text.RegularExpressions.Regex.IsMatch(text5, "([a-zA-Z\\.0-9_-])+@([a-zA-Z0-9_-])+((\\.[a-zA-Z0-9_-]{2,4}){1,2})"))
                    {
                        text4 = text4 + text5 + ",";
                    }
                }
            }
            if (text4 == null)
            {
                this.ShowMsg("请先选择要发送的会员或检测邮箱格式是否正确", false);
                return;
            }
            text4 = text4.Substring(0, text4.Length - 1);
            string[] array;
            if (text4.Contains(","))
            {
                array = text4.Split(new char[]
                {
                    ','
                });
            }
            else
            {
                array = new string[]
                {
                    text4
                };
            }
            System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage
            {
                IsBodyHtml      = true,
                Priority        = System.Net.Mail.MailPriority.High,
                SubjectEncoding = System.Text.Encoding.UTF8,
                BodyEncoding    = System.Text.Encoding.UTF8,
                Body            = text3,
                Subject         = "来自" + siteSetting.SiteName
            };
            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string addresses = array2[i];
                mailMessage.To.Add(addresses);
            }
            EmailSender emailSender = EmailSender.CreateInstance(text, configData.SettingsXml);

            try
            {
                if (emailSender.Send(mailMessage, System.Text.Encoding.GetEncoding(HiConfiguration.GetConfig().EmailEncoding)))
                {
                    this.ShowMsg("发送邮件成功", true);
                }
                else
                {
                    this.ShowMsg("发送邮件失败", false);
                }
            }
            catch (System.Exception)
            {
                this.ShowMsg("发送邮件成功,但存在无效的邮箱账号", true);
            }
            this.txtemailcontent.Value = "输入发送内容……";
        }
コード例 #3
0
 protected override void AttachChildControls()
 {
     this.dropRegions         = (RegionSelector)this.FindControl("dropRegions");
     this.txtShipTo           = (System.Web.UI.WebControls.TextBox) this.FindControl("txtShipTo");
     this.txtAddress          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtAddress");
     this.txtZipcode          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtZipcode");
     this.txtCellPhone        = (System.Web.UI.WebControls.TextBox) this.FindControl("txtCellPhone");
     this.txtTelPhone         = (System.Web.UI.WebControls.TextBox) this.FindControl("txtTelPhone");
     this.txtInvoiceTitle     = (System.Web.UI.WebControls.TextBox) this.FindControl("txtInvoiceTitle");
     this.drpShipToDate       = (System.Web.UI.HtmlControls.HtmlSelect) this.FindControl("drpShipToDate");
     this.litTaxRate          = (System.Web.UI.WebControls.Label) this.FindControl("litTaxRate");
     this.shippingModeList    = (Common_ShippingModeList)this.FindControl("Common_ShippingModeList");
     this.paymentModeList     = (Common_PaymentModeList)this.FindControl("grd_Common_PaymentModeList");
     this.inputPaymentModeId  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("inputPaymentModeId");
     this.inputShippingModeId = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("inputShippingModeId");
     this.hdbuytype           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hdbuytype");
     this.pannel_useraddress  = (System.Web.UI.WebControls.Panel) this.FindControl("pannel_useraddress");
     this.lblPaymentPrice     = (FormatedMoneyLabel)this.FindControl("lblPaymentPrice");
     this.lblShippModePrice   = (FormatedMoneyLabel)this.FindControl("lblShippModePrice");
     this.chkTax                = (System.Web.UI.HtmlControls.HtmlInputCheckBox) this.FindControl("chkTax");
     this.cartProductList       = (Common_SubmmintOrder_ProductList)this.FindControl("Common_SubmmintOrder_ProductList");
     this.cartGiftList          = (Common_SubmmintOrder_GiftList)this.FindControl("Common_SubmmintOrder_GiftList");
     this.litProductAmount      = (System.Web.UI.WebControls.Literal) this.FindControl("litProductAmount");
     this.litProductBundling    = (System.Web.UI.WebControls.Literal) this.FindControl("litProductBundling");
     this.litAllWeight          = (System.Web.UI.WebControls.Label) this.FindControl("litAllWeight");
     this.litPoint              = (System.Web.UI.WebControls.Label) this.FindControl("litPoint");
     this.hlkSentTimesPoint     = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkSentTimesPoint");
     this.lblOrderTotal         = (FormatedMoneyLabel)this.FindControl("lblOrderTotal");
     this.txtMessage            = (System.Web.UI.WebControls.TextBox) this.FindControl("txtMessage");
     this.hlkFeeFreight         = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkFeeFreight");
     this.hlkReducedPromotion   = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkReducedPromotion");
     this.lblTotalPrice         = (FormatedMoneyLabel)this.FindControl("lblTotalPrice");
     this.htmlCouponCode        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("htmlCouponCode");
     this.CmbCoupCode           = (System.Web.UI.HtmlControls.HtmlSelect) this.FindControl("CmbCoupCode");
     this.tbCoupon              = (System.Web.UI.HtmlControls.HtmlTable) this.FindControl("tbCoupon");
     this.litCouponAmout        = (FormatedMoneyLabel)this.FindControl("litCouponAmout");
     this.btnCreateOrder        = ButtonManager.Create(this.FindControl("btnCreateOrder"));
     this.btnCreateOrder.Click += new System.EventHandler(this.btnCreateOrder_Click);
     Hidistro.Membership.Context.SiteSettings masterSettings = Hidistro.Membership.Context.SettingsManager.GetMasterSettings(false);
     if (!this.Page.IsPostBack)
     {
         this.BindUserAddress();
         this.shippingModeList.DataSource = ShoppingProcessor.GetShippingModes();
         this.shippingModeList.DataBind();
         this.ReBindPayment();
         if (this.shoppingCart != null)
         {
             this.litTaxRate.Text = masterSettings.TaxRate.ToString(System.Globalization.CultureInfo.InvariantCulture);
             this.BindShoppingCartInfo(this.shoppingCart);
             if (this.isGroupBuy || this.isCountDown || this.isBundling || this.shoppingCart.LineItems.Count == 0)
             {
                 this.tbCoupon.Visible = false;
             }
             this.CmbCoupCode.DataTextField  = "DisplayText";
             this.CmbCoupCode.DataValueField = "ClaimCode";
             this.CmbCoupCode.DataSource     = ShoppingProcessor.GetCoupon(this.shoppingCart.GetTotal());
             this.CmbCoupCode.DataBind();
             System.Web.UI.WebControls.ListItem item = new System.Web.UI.WebControls.ListItem("", "0");
             this.CmbCoupCode.Items.Insert(0, item);
             this.hdbuytype.Value            = this.buytype;
             this.pannel_useraddress.Visible = (!Hidistro.Membership.Context.HiContext.Current.User.IsAnonymous && PersonalHelper.GetShippingAddressCount(Hidistro.Membership.Context.HiContext.Current.User.UserId) > 0);
         }
     }
 }
コード例 #4
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            string text  = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
            string str   = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
            string text2 = "";

            Hidistro.Membership.Context.SiteSettings masterSettings = Hidistro.Membership.Context.SettingsManager.GetMasterSettings(false);
            string format         = "<trade><Oid>{0}</Oid><SellerUid>{1}</SellerUid><BuyerNick>{2}</BuyerNick><BuyerEmail>{3}</BuyerEmail><ReceiverName>{4}</ReceiverName><ReceiverState>{5}</ReceiverState><ReceiverCity>{6}</ReceiverCity><ReceiverDistrict>{7}</ReceiverDistrict><ReceiverAddress>{8}</ReceiverAddress><ReceiverZip>{9}</ReceiverZip><ReceiverMobile>{10}</ReceiverMobile><ReceiverPhone>{11}</ReceiverPhone><BuyerMemo>{12}</BuyerMemo><OrderMark>{13}</OrderMark><SellerMemo>{14}</SellerMemo><Nums>{15}</Nums><Price>{16}</Price><Payment>{17}</Payment><PostFee>{18}</PostFee><Profit>{19}</Profit><PurchaseTotal>{20}</PurchaseTotal><PaymentTs>{21}</PaymentTs><SentTs>{22}</SentTs><RefundStatus>{23}</RefundStatus><RefundAmount>{24}</RefundAmount><RefundRemark>{25}</RefundRemark><Status>{26}</Status><orders list=\"{27}\">{28}</orders></trade>";
            string orderitemfomat = "<order><Tid>{0}</Tid><Oid>{1}</Oid><GoodsIid>{2}</GoodsIid><Title>{3}</Title><OuterId>{4}</OuterId><SKUContent>{5}</SKUContent><Nums>{6}</Nums><Price>{7}</Price><Payment>{8}</Payment><CostPrice>{9}</CostPrice></order>";

            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            string text3     = context.Request.QueryString["action"].ToString();
            string sign      = context.Request.Form["sign"];
            string checkCode = masterSettings.CheckCode;
            string text4     = context.Request.Form["format"];

            System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();
            System.Collections.Generic.SortedDictionary <string, string> sortedDictionary = new System.Collections.Generic.SortedDictionary <string, string>();
            string a;

            if ((a = text3) != null)
            {
                if (!(a == "tradelist"))
                {
                    if (!(a == "tradedetails"))
                    {
                        if (!(a == "send"))
                        {
                            if (a == "mark")
                            {
                                string value = context.Request.Form["order_mark"].Trim();
                                string text5 = context.Request.Form["seller_memo"].Trim();
                                if (!string.IsNullOrEmpty(context.Request.Form["tid"].Trim()) && !string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(text5))
                                {
                                    if (System.Convert.ToInt32(value) > 0 && System.Convert.ToInt32(value) < 7)
                                    {
                                        string text6 = context.Request.Form["tid"].Trim();
                                        sortedDictionary.Add("tid", text6);
                                        sortedDictionary.Add("order_mark", value);
                                        sortedDictionary.Add("seller_memo", text5);
                                        sortedDictionary.Add("format", text4);
                                        if (APIHelper.CheckSign(sortedDictionary, checkCode, sign))
                                        {
                                            PurchaseOrderInfo purchaseOrder = SalesHelper.GetPurchaseOrder(text6);
                                            purchaseOrder.ManagerMark   = new OrderMark?((OrderMark)System.Enum.Parse(typeof(OrderMark), value, true));
                                            purchaseOrder.ManagerRemark = Globals.HtmlEncode(text5);
                                            if (SalesHelper.SaveAPIPurchaseOrderRemark(purchaseOrder))
                                            {
                                                stringBuilder.Append("<trade_get_response>");
                                                stringBuilder.Append(this.GetOrderDetails(format, orderitemfomat, purchaseOrder).ToString());
                                                stringBuilder.Append("</trade_get_response>");
                                                this.message = text + stringBuilder.ToString();
                                            }
                                            else
                                            {
                                                text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Paramter_Error, "save is failure ");
                                            }
                                        }
                                        else
                                        {
                                            text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Signature_Error, "sign");
                                        }
                                    }
                                    else
                                    {
                                        text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Format_Eroor, "order_mark");
                                    }
                                }
                                else
                                {
                                    text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "tid or order_mark or seller_memo");
                                }
                            }
                        }
                        else
                        {
                            string text7 = context.Request.Form["tid"].Trim();
                            string text8 = context.Request.Form["out_sid"].Trim();
                            string text9 = context.Request.Form["company_code"].Trim();
                            if (!string.IsNullOrEmpty(text7) && !string.IsNullOrEmpty(text9) && !string.IsNullOrEmpty(text8))
                            {
                                sortedDictionary.Add("tid", text7);
                                sortedDictionary.Add("out_sid", text8);
                                sortedDictionary.Add("company_code", text9);
                                sortedDictionary.Add("format", text4);
                                if (APIHelper.CheckSign(sortedDictionary, checkCode, sign))
                                {
                                    ExpressCompanyInfo expressCompanyInfo = ExpressHelper.FindNodeByCode(text9);
                                    if (!string.IsNullOrEmpty(expressCompanyInfo.Name))
                                    {
                                        ShippingModeInfo  shippingModeByCompany = SalesHelper.GetShippingModeByCompany(expressCompanyInfo.Name);
                                        PurchaseOrderInfo purchaseOrder2        = SalesHelper.GetPurchaseOrder(text7);
                                        if (purchaseOrder2 != null)
                                        {
                                            ApiErrorCode apiErrorCode = this.SendOrders(purchaseOrder2, shippingModeByCompany, text8, expressCompanyInfo);
                                            if (apiErrorCode == ApiErrorCode.Success)
                                            {
                                                stringBuilder.Append("<trade_get_response>");
                                                purchaseOrder2 = SalesHelper.GetPurchaseOrder(text7);
                                                stringBuilder.Append(this.GetOrderDetails(format, orderitemfomat, purchaseOrder2).ToString());
                                                stringBuilder.Append("</trade_get_response>");
                                                this.message = text + stringBuilder.ToString();
                                            }
                                            else
                                            {
                                                text2 = MessageInfo.ShowMessageInfo(apiErrorCode, "It");
                                            }
                                        }
                                        else
                                        {
                                            text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.NoExists_Error, "tid");
                                        }
                                    }
                                    else
                                    {
                                        text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.NoExists_Error, "company_code");
                                    }
                                }
                                else
                                {
                                    text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Signature_Error, "sign");
                                }
                            }
                            else
                            {
                                text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "paramters");
                            }
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(context.Request.Form["tid"].Trim()))
                        {
                            string text6 = context.Request.Form["tid"].Trim();
                            if (APIHelper.CheckSign(new System.Collections.Generic.SortedDictionary <string, string>
                            {
                                {
                                    "tid",
                                    context.Request.Form["tid"]
                                },

                                {
                                    "format",
                                    text4
                                }
                            }, checkCode, sign))
                            {
                                string text10 = context.Request.Form["tid"].Replace("\r\n", "\n");
                                if (!string.IsNullOrEmpty(text10))
                                {
                                    text6 = text10;
                                    PurchaseOrderInfo purchaseOrder3 = SalesHelper.GetPurchaseOrder(text6);
                                    stringBuilder.Append("<trade_get_response>");
                                    stringBuilder.Append(this.GetOrderDetails(format, orderitemfomat, purchaseOrder3).ToString());
                                    stringBuilder.Append("</trade_get_response>");
                                    this.message = text + stringBuilder.ToString();
                                }
                                else
                                {
                                    text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Format_Eroor, "tid");
                                }
                            }
                            else
                            {
                                text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Signature_Error, "signature");
                            }
                        }
                        else
                        {
                            text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "tid");
                        }
                    }
                }
                else
                {
                    PurchaseOrderQuery purchaseOrderQuery = new PurchaseOrderQuery
                    {
                        PageSize = 100
                    };
                    int    num    = 0;
                    string value2 = context.Request.Form["status"].Trim();
                    string text11 = context.Request.Form["buynick"].Trim();
                    string value3 = context.Request.Form["pageindex"].Trim();
                    string value4 = context.Request.Form["starttime"].Trim();
                    string value5 = context.Request.Form["endtime"].Trim();
                    if (!string.IsNullOrEmpty(value2) && System.Convert.ToInt32(value2) >= 0)
                    {
                        purchaseOrderQuery.PurchaseStatus = (OrderStatus)System.Enum.Parse(typeof(OrderStatus), value2, true);
                    }
                    else
                    {
                        text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "status");
                    }
                    if (!string.IsNullOrEmpty(value3) && System.Convert.ToInt32(value3) > 0)
                    {
                        purchaseOrderQuery.PageIndex = System.Convert.ToInt32(value3);
                    }
                    else
                    {
                        text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "pageindex");
                    }
                    if (string.IsNullOrEmpty(text2))
                    {
                        sortedDictionary.Add("status", value2);
                        sortedDictionary.Add("buynick", text11);
                        sortedDictionary.Add("pageindex", value3);
                        sortedDictionary.Add("starttime", value4);
                        sortedDictionary.Add("endtime", value5);
                        sortedDictionary.Add("format", text4);
                        if (APIHelper.CheckSign(sortedDictionary, checkCode, sign))
                        {
                            if (!string.IsNullOrEmpty(text11))
                            {
                                purchaseOrderQuery.DistributorName = text11;
                            }
                            if (!string.IsNullOrEmpty(value4))
                            {
                                purchaseOrderQuery.StartDate = new System.DateTime?(System.Convert.ToDateTime(value4));
                            }
                            if (!string.IsNullOrEmpty(value5))
                            {
                                purchaseOrderQuery.EndDate = new System.DateTime?(System.Convert.ToDateTime(value5));
                            }
                            purchaseOrderQuery.SortOrder = SortAction.Desc;
                            purchaseOrderQuery.SortBy    = "PurchaseDate";
                            stringBuilder.Append("<trade_get_response>");
                            stringBuilder.Append(this.GetOrderList(purchaseOrderQuery, format, orderitemfomat, out num));
                            stringBuilder.Append("<totalrecord>" + num + "</totalrecord>");
                            stringBuilder.Append("</trade_get_response>");
                            this.message = text + stringBuilder.ToString();
                        }
                        else
                        {
                            text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Signature_Error, "sign");
                        }
                    }
                    else
                    {
                        text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "paramter");
                    }
                }
            }
            if (this.message == "")
            {
                this.message = this.message + str + text2;
            }
            context.Response.ContentType = "text/xml";
            if (text4 == "json")
            {
                this.message = this.message.Replace(text, "");
                xmlDocument.Load(new System.IO.MemoryStream(System.Text.Encoding.GetEncoding("UTF-8").GetBytes(this.message)));
                this.message = JavaScriptConvert.SerializeXmlNode(xmlDocument);
                context.Response.ContentType = "text/json";
            }
            context.Response.Write(this.message);
        }
コード例 #5
0
ファイル: ManageMembers.cs プロジェクト: uvbs/eshopSanQiang
        private void btnSendMessage_Click(object sender, System.EventArgs e)
        {
            Hidistro.Membership.Context.SiteSettings siteSetting = this.GetSiteSetting();
            string sMSSender = siteSetting.SMSSender;

            if (string.IsNullOrEmpty(sMSSender))
            {
                this.ShowMsg("请先选择发送方式", false);
                return;
            }
            ConfigData configData = null;

            if (siteSetting.SMSEnabled)
            {
                configData = new ConfigData(HiCryptographer.Decrypt(siteSetting.SMSSettings));
            }
            if (configData == null)
            {
                this.ShowMsg("请先选择发送方式并填写配置信息", false);
                return;
            }
            if (!configData.IsValid)
            {
                string text = "";
                foreach (string current in configData.ErrorMsgs)
                {
                    text += Formatter.FormatErrorMessage(current);
                }
                this.ShowMsg(text, false);
                return;
            }
            string text2 = this.txtmsgcontent.Value.Trim();

            if (string.IsNullOrEmpty(text2))
            {
                this.ShowMsg("请先填写发送的内容信息", false);
                return;
            }
            int    num   = System.Convert.ToInt32(this.litsmscount.Text);
            string text3 = null;

            foreach (System.Web.UI.WebControls.GridViewRow gridViewRow in this.grdMemberList.Rows)
            {
                System.Web.UI.WebControls.CheckBox checkBox = (System.Web.UI.WebControls.CheckBox)gridViewRow.FindControl("checkboxCol");
                if (checkBox.Checked)
                {
                    string text4 = ((System.Web.UI.DataBoundLiteralControl)gridViewRow.Controls[2].Controls[0]).Text.Trim().Replace("<div></div>", "");
                    if (!string.IsNullOrEmpty(text4) && System.Text.RegularExpressions.Regex.IsMatch(text4, "^(13|14|15|18)\\d{9}$"))
                    {
                        text3 = text3 + text4 + ",";
                    }
                }
            }
            if (text3 == null)
            {
                this.ShowMsg("请先选择要发送的会员或检测所选手机号格式是否正确", false);
                return;
            }
            text3 = text3.Substring(0, text3.Length - 1);
            string[] array;
            if (text3.Contains(","))
            {
                array = text3.Split(new char[]
                {
                    ','
                });
            }
            else
            {
                array = new string[]
                {
                    text3
                };
            }
            if (num < array.Length)
            {
                this.ShowMsg("发送失败,您的剩余短信条数不足", false);
                return;
            }
            SMSSender sMSSender2 = SMSSender.CreateInstance(sMSSender, configData.SettingsXml);
            string    string_;
            bool      success = sMSSender2.Send(array, text2, out string_);

            this.ShowMsg(string_, success);
            this.txtmsgcontent.Value = "输入发送内容……";
            this.litsmscount.Text    = (num - array.Length).ToString();
        }
コード例 #6
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            string str  = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
            string str2 = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
            string str3 = "";
            string text = "";

            Hidistro.Membership.Context.SiteSettings masterSettings = Hidistro.Membership.Context.SettingsManager.GetMasterSettings(false);
            new System.Text.StringBuilder();
            string text2     = context.Request.QueryString["action"].ToString();
            string sign      = context.Request.Form["sign"];
            string text3     = context.Request.Form["format"];
            string checkCode = masterSettings.CheckCode;

            System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();
            new System.Collections.Generic.Dictionary <string, string>();
            System.Collections.Generic.SortedDictionary <string, string> sortedDictionary = new System.Collections.Generic.SortedDictionary <string, string>();
            try
            {
                string a;
                if ((a = text2) != null && a == "distribution_list")
                {
                    string text4 = context.Request.Form["parma"].Trim();
                    str3 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "parma");
                    if (!string.IsNullOrEmpty(text4))
                    {
                        str3 = MessageInfo.ShowMessageInfo(ApiErrorCode.Signature_Error, "sign");
                        DistributorQuery query = new DistributorQuery();
                        query            = (DistributorQuery)JavaScriptConvert.DeserializeObject(text4, typeof(DistributorQuery));
                        sortedDictionary = this.GetDistriubots(query);
                        sortedDictionary.Add("action", "distribution_list");
                        sortedDictionary.Add("format", text3);
                        if (APIHelper.CheckSign(sortedDictionary, checkCode, sign))
                        {
                            DbQueryResult distributors = DistributorHelper.GetDistributors(query);
                            string        format       = str + "<response_distributors>{0}<totalcount>{1}</totalcount></response_distributors>";
                            if (distributors.Data != null)
                            {
                                text = string.Format(format, this.ConvertTableToXml((System.Data.DataTable)distributors.Data), distributors.TotalRecords.ToString());
                            }
                            else
                            {
                                text = string.Format(format, "", "0");
                            }
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                str3 = MessageInfo.ShowMessageInfo(ApiErrorCode.Unknown_Error, ex.Message);
            }
            if (text == "")
            {
                text = text + str2 + str3;
            }
            context.Response.ContentType = "text/xml";
            if (text3 == "json")
            {
                text = text.Replace("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>", "");
                xmlDocument.Load(new System.IO.MemoryStream(System.Text.Encoding.GetEncoding("UTF-8").GetBytes(text)));
                text = JavaScriptConvert.SerializeXmlNode(xmlDocument);
                context.Response.ContentType = "text/json";
            }
            context.Response.Write(text);
        }
コード例 #7
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            int num = 0;

            System.Collections.Generic.SortedDictionary <string, string> requestPost = this.GetRequestPost();
            if (requestPost.Count > 0)
            {
                string             openIdType     = "hishop.plugins.openid.alipay.alipayservice";
                OpenIdSettingsInfo openIdSettings = OpenIdHelper.GetOpenIdSettings(openIdType);
                if (openIdSettings == null)
                {
                    base.Response.Write("登录失败,没有找到对应的插件配置信息。");
                    return;
                }
                System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();
                xmlDocument.LoadXml(HiCryptographer.Decrypt(openIdSettings.Settings));
                AliPayNotify aliPayNotify = new AliPayNotify(requestPost, base.Request.Form["notify_id"], xmlDocument.FirstChild.SelectSingleNode("Partner").InnerText, xmlDocument.FirstChild.SelectSingleNode("Key").InnerText);
                string       responseTxt  = aliPayNotify.ResponseTxt;
                string       a            = base.Request.Form["sign"];
                string       mysign       = aliPayNotify.Mysign;
                if (responseTxt == "true" && a == mysign)
                {
                    string text = base.Request.Form["receive_address"];
                    if (!string.IsNullOrEmpty(text))
                    {
                        System.Xml.XmlDocument xmlDocument2 = new System.Xml.XmlDocument();
                        xmlDocument2.LoadXml(text);
                        ShippingAddressInfo shippingAddressInfo = new ShippingAddressInfo();
                        shippingAddressInfo.UserId = Hidistro.Membership.Context.HiContext.Current.User.UserId;
                        if (xmlDocument2.SelectSingleNode("/receiveAddress/address") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/address").InnerText))
                        {
                            shippingAddressInfo.Address = Globals.HtmlEncode(xmlDocument2.SelectSingleNode("/receiveAddress/address").InnerText);
                        }
                        if (xmlDocument2.SelectSingleNode("/receiveAddress/fullname") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/fullname").InnerText))
                        {
                            shippingAddressInfo.ShipTo = Globals.HtmlEncode(xmlDocument2.SelectSingleNode("/receiveAddress/fullname").InnerText);
                        }
                        if (xmlDocument2.SelectSingleNode("/receiveAddress/post") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/post").InnerText))
                        {
                            shippingAddressInfo.Zipcode = xmlDocument2.SelectSingleNode("/receiveAddress/post").InnerText;
                        }
                        if (xmlDocument2.SelectSingleNode("/receiveAddress/mobile_phone") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/mobile_phone").InnerText))
                        {
                            shippingAddressInfo.CellPhone = xmlDocument2.SelectSingleNode("/receiveAddress/mobile_phone").InnerText;
                        }
                        if (xmlDocument2.SelectSingleNode("/receiveAddress/phone") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/phone").InnerText))
                        {
                            shippingAddressInfo.TelPhone = xmlDocument2.SelectSingleNode("/receiveAddress/phone").InnerText;
                        }
                        string text2 = string.Empty;
                        string text3 = string.Empty;
                        string text4 = string.Empty;
                        if (xmlDocument2.SelectSingleNode("/receiveAddress/area") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/area").InnerText))
                        {
                            text2 = xmlDocument2.SelectSingleNode("/receiveAddress/area").InnerText;
                        }
                        if (xmlDocument2.SelectSingleNode("/receiveAddress/city") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/city").InnerText))
                        {
                            text3 = xmlDocument2.SelectSingleNode("/receiveAddress/city").InnerText;
                        }
                        if (xmlDocument2.SelectSingleNode("/receiveAddress/prov") != null && !string.IsNullOrEmpty(xmlDocument2.SelectSingleNode("/receiveAddress/prov").InnerText))
                        {
                            text4 = xmlDocument2.SelectSingleNode("/receiveAddress/prov").InnerText;
                        }
                        if (string.IsNullOrEmpty(text2) && string.IsNullOrEmpty(text3) && string.IsNullOrEmpty(text4))
                        {
                            shippingAddressInfo.RegionId = 0;
                        }
                        else
                        {
                            shippingAddressInfo.RegionId = RegionHelper.GetRegionId(text2, text3, text4);
                        }
                        Hidistro.Membership.Context.SiteSettings arg_371_0 = Hidistro.Membership.Context.HiContext.Current.SiteSettings;
                        if (PersonalHelper.GetShippingAddressCount(Hidistro.Membership.Context.HiContext.Current.User.UserId) < Hidistro.Membership.Context.HiContext.Current.Config.ShippingAddressQuantity)
                        {
                            num = PersonalHelper.AddShippingAddress(shippingAddressInfo);
                        }
                    }
                }
            }
            this.Page.Response.Redirect(Globals.ApplicationPath + "/SubmmitOrder.aspx?shippingId=" + num);
        }
コード例 #8
0
        private string WritePurchaseOrderInfo(System.Data.DataRow order, ShippersInfo shipper, System.Data.DataTable dtLine, System.Data.DataSet ds)
        {
            string[] array = order["shippingRegion"].ToString().Split(new char[]
            {
                ','
            });
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            stringBuilder.AppendLine("<order>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>收货人-姓名</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", order["ShipTo"]);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>收货人-电话</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", order["TelPhone"]);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>收货人-手机</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", order["CellPhone"]);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>收货人-邮编</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", order["ZipCode"]);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>收货人-地址</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", order["Address"]);
            stringBuilder.AppendLine("</item>");
            string arg = string.Empty;

            if (array.Length > 0)
            {
                arg = array[0];
            }
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>收货人-地区1级</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", arg);
            stringBuilder.AppendLine("</item>");
            arg = string.Empty;
            if (array.Length > 1)
            {
                arg = array[1];
            }
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>收货人-地区2级</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", arg);
            stringBuilder.AppendLine("</item>");
            arg = string.Empty;
            if (array.Length > 2)
            {
                arg = array[2];
            }
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>收货人-地区3级</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", arg);
            stringBuilder.AppendLine("</item>");
            int          num          = 0;
            string       arg2         = string.Empty;
            string       arg3         = string.Empty;
            string       arg4         = string.Empty;
            string       arg5         = string.Empty;
            string       arg6         = string.Empty;
            ShippersInfo shippersInfo = this.ForDistorShipper(ds, order);

            if (shippersInfo != null)
            {
                arg2 = shippersInfo.ShipperName;
                arg3 = shippersInfo.CellPhone;
                arg4 = shippersInfo.TelPhone;
                arg5 = shippersInfo.Address;
                arg6 = shippersInfo.Zipcode;
                num  = shippersInfo.RegionId;
            }
            else
            {
                if (shipper != null)
                {
                    arg2 = shipper.ShipperName;
                    arg3 = shipper.CellPhone;
                    arg4 = shipper.TelPhone;
                    arg5 = shipper.Address;
                    arg6 = shipper.Zipcode;
                    num  = shipper.RegionId;
                }
            }
            string[] array2 = new string[]
            {
                "",
                "",
                ""
            };
            if (num > 0)
            {
                array2 = RegionHelper.GetFullRegion(num, "-").Split(new char[]
                {
                    '-'
                });
            }
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>发货人-姓名</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", arg2);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>发货人-手机</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", arg3);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>发货人-电话</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", arg4);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>发货人-地址</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", arg5);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>发货人-邮编</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", arg6);
            stringBuilder.AppendLine("</item>");
            string arg7 = string.Empty;

            if (array2.Length > 0)
            {
                arg7 = array2[0];
            }
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>发货人-地区1级</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", arg7);
            stringBuilder.AppendLine("</item>");
            arg7 = string.Empty;
            if (array2.Length > 1)
            {
                arg7 = array2[1];
            }
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>发货人-地区2级</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", arg7);
            stringBuilder.AppendLine("</item>");
            arg7 = string.Empty;
            if (array2.Length > 2)
            {
                arg7 = array2[2];
            }
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>发货人-地区3级</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", arg7);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>订单-订单号</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", order["OrderId"]);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>订单-总金额</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", order["OrderTotal"]);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>订单-物品总重量</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", order["Weight"]);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>订单-备注</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", order["Remark"]);
            stringBuilder.AppendLine("</item>");
            System.Data.DataRow[] array3 = dtLine.Select(" PurchaseOrderId='" + order["PurchaseOrderId"] + "'");
            string text = string.Empty;

            if (array3.Length > 0)
            {
                System.Data.DataRow[] array4 = array3;
                for (int i = 0; i < array4.Length; i++)
                {
                    System.Data.DataRow dataRow = array4[i];
                    text = string.Concat(new object[]
                    {
                        text,
                        "货号 ",
                        dataRow["SKU"],
                        " ×",
                        dataRow["Quantity"],
                        "\n"
                    });
                }
                text = text.Replace(";", "");
            }
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>订单-详情</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", text);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>订单-送货时间</name>");
            stringBuilder.AppendFormat("<rename></rename>", new object[0]);
            stringBuilder.AppendLine("</item>");
            Hidistro.Membership.Context.SiteSettings siteSettings = Hidistro.Membership.Context.SettingsManager.GetSiteSettings((int)order["DistributorId"]);
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>网店名称</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", (siteSettings != null) ? siteSettings.SiteName : Hidistro.Membership.Context.HiContext.Current.SiteSettings.SiteName);
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("<item>");
            stringBuilder.AppendLine("<name>自定义内容</name>");
            stringBuilder.AppendFormat("<rename>{0}</rename>", "null");
            stringBuilder.AppendLine("</item>");
            stringBuilder.AppendLine("</order>");
            return(stringBuilder.ToString());
        }
コード例 #9
0
ファイル: SiteRequests.cs プロジェクト: uvbs/eshopSanQiang
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            SiteRequestInfo siteRequestInfo = DistributorHelper.GetSiteRequestInfo(int.Parse(this.hidRequestId.Value));

            if (siteRequestInfo == null)
            {
                base.GotoResourceNotFound();
                return;
            }
            Hidistro.Membership.Context.SiteSettings siteSettings = new Hidistro.Membership.Context.SiteSettings(siteRequestInfo.FirstSiteUrl, new int?(siteRequestInfo.UserId));
            siteSettings.Disabled    = false;
            siteSettings.CreateDate  = new System.DateTime?(System.DateTime.Now);
            siteSettings.RequestDate = new System.DateTime?(siteRequestInfo.RequestTime);
            siteSettings.LogoUrl     = "/utility/pics/agentlogo.jpg";
            bool flag;
            bool flag2;
            int  siteQty;

            Hidistro.Membership.Context.LicenseChecker.Check(out flag, out flag2, out siteQty);
            if (!DistributorHelper.AddSiteSettings(siteSettings, siteRequestInfo.RequestId, siteQty))
            {
                this.ShowMsg("开通分销商站点失败,可能是您能够开启的数量已经达到了授权的上限或是授权已过有效期!", false);
                return;
            }
            System.Collections.Generic.IList <ManageThemeInfo> list = this.LoadThemes();
            string text    = this.Page.Request.MapPath(Globals.ApplicationPath + "/Storage/sites/") + siteSettings.UserId.ToString();
            string text2   = this.Page.Request.MapPath(Globals.ApplicationPath + "/Templates/sites/") + siteSettings.UserId.ToString() + "\\" + list[0].ThemeName;
            string srcPath = this.Page.Request.MapPath(Globals.ApplicationPath + "/Templates/library/") + list[0].ThemeName;

            if (!System.IO.Directory.Exists(text))
            {
                try
                {
                    System.IO.Directory.CreateDirectory(text);
                    System.IO.Directory.CreateDirectory(text + "/article");
                    System.IO.Directory.CreateDirectory(text + "/brand");
                    System.IO.Directory.CreateDirectory(text + "/fckfiles");
                    System.IO.Directory.CreateDirectory(text + "/help");
                    System.IO.Directory.CreateDirectory(text + "/link");
                    System.IO.Directory.CreateDirectory(text + "/category");
                }
                catch
                {
                    this.ShowMsg("开通分销商站点失败", false);
                    return;
                }
            }
            if (!System.IO.Directory.Exists(text2))
            {
                try
                {
                    this.CopyDir(srcPath, text2);
                    siteSettings.Theme = list[0].ThemeName;
                    Hidistro.Membership.Context.SettingsManager.Save(siteSettings);
                }
                catch
                {
                    this.ShowMsg("开通分销商站点失败", false);
                    return;
                }
            }
            this.BindRequests();
            this.ShowMsg("成功开通了分销商的站点", true);
        }
コード例 #10
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            string text  = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
            string str   = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
            string text2 = "";

            Hidistro.Membership.Context.SiteSettings masterSettings = Hidistro.Membership.Context.SettingsManager.GetMasterSettings(false);
            string format         = "<trade><Oid>{0}</Oid><SellerUid>{1}</SellerUid><BuyerNick>{2}</BuyerNick><BuyerEmail>{3}</BuyerEmail><ReceiverName>{4}</ReceiverName><ReceiverState>{5}</ReceiverState><ReceiverCity>{6}</ReceiverCity><ReceiverDistrict>{7}</ReceiverDistrict><ReceiverAddress>{8}</ReceiverAddress><ReceiverZip>{9}</ReceiverZip><ReceiverMobile>{10}</ReceiverMobile><ReceiverPhone>{11}</ReceiverPhone><BuyerMemo>{12}</BuyerMemo><OrderMark>{13}</OrderMark><SellerMemo>{14}</SellerMemo><Nums>{15}</Nums><Price>{16}</Price><Payment>{17}</Payment><PostFee>{18}</PostFee><DiscountFee>{19}</DiscountFee><AdjustFee>{20}</AdjustFee><PaymentTs>{21}</PaymentTs><SentTs>{22}</SentTs><RefundStatus>{23}</RefundStatus><RefundAmount>{24}</RefundAmount><RefundRemark>{25}</RefundRemark><Status>{26}</Status><orders list=\"{27}\">{28}</orders></trade>";
            string orderitemfomat = "<order><Tid>{0}</Tid><Oid>{1}</Oid><GoodsIid>{2}</GoodsIid><Title>{3}</Title><OuterId>{4}</OuterId><SKUContent>{5}</SKUContent><Nums>{6}</Nums><Price>{7}</Price><Payment>{8}</Payment></order>";

            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            string text3     = context.Request.QueryString["action"].ToString();
            string sign      = context.Request.Form["sign"];
            string checkCode = masterSettings.CheckCode;
            string value     = context.Request.Form["format"];

            new System.Collections.Generic.Dictionary <string, string>();
            System.Collections.Generic.SortedDictionary <string, string> sortedDictionary = new System.Collections.Generic.SortedDictionary <string, string>();
            try
            {
                if (!string.IsNullOrEmpty(text3))
                {
                    string a;
                    if ((a = text3) != null)
                    {
                        if (!(a == "tradelist"))
                        {
                            if (!(a == "tradedetails"))
                            {
                                if (!(a == "send"))
                                {
                                    if (a == "mark")
                                    {
                                        string value2 = context.Request.Form["order_mark"].Trim();
                                        string text4  = context.Request.Form["seller_memo"].Trim();
                                        if (string.IsNullOrEmpty(context.Request.Form["tid"].Trim()) || string.IsNullOrEmpty(value2) || string.IsNullOrEmpty(text4))
                                        {
                                            text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "tid or order_mark or seller_memo");
                                            goto IL_7CA;
                                        }
                                        if (System.Convert.ToInt32(value2) <= 0 || System.Convert.ToInt32(value2) >= 7)
                                        {
                                            text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Format_Eroor, "order_mark");
                                            goto IL_7CA;
                                        }
                                        string text5 = context.Request.Form["tid"].Trim();
                                        sortedDictionary.Add("tid", text5);
                                        sortedDictionary.Add("order_mark", value2);
                                        sortedDictionary.Add("seller_memo", text4);
                                        sortedDictionary.Add("format", value);
                                        if (!APIHelper.CheckSign(sortedDictionary, checkCode, sign))
                                        {
                                            text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Signature_Error, "sign");
                                            goto IL_7CA;
                                        }
                                        OrderInfo orderInfo = OrderHelper.GetOrderInfo(text5);
                                        orderInfo.ManagerMark   = new OrderMark?((OrderMark)System.Enum.Parse(typeof(OrderMark), value2, true));
                                        orderInfo.ManagerRemark = Globals.HtmlEncode(text4);
                                        if (OrderHelper.SaveRemarkAPI(orderInfo))
                                        {
                                            stringBuilder.Append("<trade_get_response>");
                                            stringBuilder.Append(this.GetOrderDetails(format, orderitemfomat, orderInfo).ToString());
                                            stringBuilder.Append("</trade_get_response>");
                                            goto IL_7CA;
                                        }
                                        text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Paramter_Error, "save is failure ");
                                        goto IL_7CA;
                                    }
                                }
                                else
                                {
                                    string text6 = context.Request.Form["tid"].Trim();
                                    string text7 = context.Request.Form["out_sid"].Trim();
                                    string text8 = context.Request.Form["company_code"].Trim();
                                    if (string.IsNullOrEmpty(text6) || string.IsNullOrEmpty(text8) || string.IsNullOrEmpty(text7))
                                    {
                                        text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "paramters");
                                        goto IL_7CA;
                                    }
                                    sortedDictionary.Add("tid", text6);
                                    sortedDictionary.Add("out_sid", text7);
                                    sortedDictionary.Add("company_code", text8);
                                    sortedDictionary.Add("format", value);
                                    if (!APIHelper.CheckSign(sortedDictionary, checkCode, sign))
                                    {
                                        text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Signature_Error, "sign");
                                        goto IL_7CA;
                                    }
                                    ExpressCompanyInfo expressCompanyInfo = ExpressHelper.FindNodeByCode(text8);
                                    if (string.IsNullOrEmpty(expressCompanyInfo.Name))
                                    {
                                        text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.NoExists_Error, "company_code");
                                        goto IL_7CA;
                                    }
                                    ShippingModeInfo shippingModeByCompany = SalesHelper.GetShippingModeByCompany(expressCompanyInfo.Name);
                                    OrderInfo        orderInfo2            = OrderHelper.GetOrderInfo(text6);
                                    if (orderInfo2 == null)
                                    {
                                        text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.NoExists_Error, "tid");
                                        goto IL_7CA;
                                    }
                                    ApiErrorCode apiErrorCode = this.SendOrders(orderInfo2, shippingModeByCompany, text7, expressCompanyInfo);
                                    if (apiErrorCode == ApiErrorCode.Success)
                                    {
                                        stringBuilder.Append("<trade_get_response>");
                                        orderInfo2 = OrderHelper.GetOrderInfo(text6);
                                        stringBuilder.Append(this.GetOrderDetails(format, orderitemfomat, orderInfo2).ToString());
                                        stringBuilder.Append("</trade_get_response>");
                                        goto IL_7CA;
                                    }
                                    text2 = MessageInfo.ShowMessageInfo(apiErrorCode, "It");
                                    goto IL_7CA;
                                }
                            }
                            else
                            {
                                if (string.IsNullOrEmpty(context.Request.Form["tid"].Trim()))
                                {
                                    text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "tid");
                                    goto IL_7CA;
                                }
                                string text5 = context.Request.Form["tid"].Trim();
                                if (!APIHelper.CheckSign(new System.Collections.Generic.SortedDictionary <string, string>
                                {
                                    {
                                        "tid",
                                        context.Request.Form["tid"]
                                    },

                                    {
                                        "format",
                                        value
                                    }
                                }, checkCode, sign))
                                {
                                    text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Signature_Error, "signature");
                                    goto IL_7CA;
                                }
                                string text9 = context.Request.Form["tid"].Replace("\r\n", "\n");
                                if (!string.IsNullOrEmpty(text9))
                                {
                                    text5 = text9;
                                    OrderInfo orderInfo3 = OrderHelper.GetOrderInfo(text5);
                                    stringBuilder.Append("<trade_get_response>");
                                    stringBuilder.Append(this.GetOrderDetails(format, orderitemfomat, orderInfo3).ToString());
                                    stringBuilder.Append("</trade_get_response>");
                                    goto IL_7CA;
                                }
                                text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Format_Eroor, "tid");
                                goto IL_7CA;
                            }
                        }
                        else
                        {
                            OrderQuery orderQuery = new OrderQuery
                            {
                                PageSize = 100
                            };
                            int    num    = 0;
                            string value3 = context.Request.Form["status"].Trim();
                            string text10 = context.Request.Form["buyernick"].Trim();
                            string value4 = context.Request.Form["pageindex"].Trim();
                            string value5 = context.Request.Form["starttime"].Trim();
                            string value6 = context.Request.Form["endtime"].Trim();
                            if (!string.IsNullOrEmpty(value3) && System.Convert.ToInt32(value3) >= 0)
                            {
                                orderQuery.Status = (OrderStatus)System.Enum.Parse(typeof(OrderStatus), value3, true);
                            }
                            else
                            {
                                text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "status");
                            }
                            if (!string.IsNullOrEmpty(value4) && System.Convert.ToInt32(value4) > 0)
                            {
                                orderQuery.PageIndex = System.Convert.ToInt32(value4);
                            }
                            else
                            {
                                text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "pageindex");
                            }
                            if (!string.IsNullOrEmpty(text2))
                            {
                                text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Empty_Error, "paramter");
                                goto IL_7CA;
                            }
                            sortedDictionary.Add("status", value3);
                            sortedDictionary.Add("buyernick", text10);
                            sortedDictionary.Add("pageindex", value4);
                            sortedDictionary.Add("starttime", value5);
                            sortedDictionary.Add("endtime", value6);
                            sortedDictionary.Add("format", value);
                            if (APIHelper.CheckSign(sortedDictionary, checkCode, sign))
                            {
                                if (!string.IsNullOrEmpty(text10))
                                {
                                    orderQuery.UserName = text10;
                                }
                                if (!string.IsNullOrEmpty(value5))
                                {
                                    orderQuery.StartDate = new System.DateTime?(System.Convert.ToDateTime(value5));
                                }
                                if (!string.IsNullOrEmpty(value6))
                                {
                                    orderQuery.EndDate = new System.DateTime?(System.Convert.ToDateTime(value6));
                                }
                                stringBuilder.Append("<trade_get_response>");
                                stringBuilder.Append(this.GetOrderList(orderQuery, format, orderitemfomat, out num).ToString());
                                stringBuilder.Append("<totalrecord>" + num + "</totalrecord>");
                                stringBuilder.Append("</trade_get_response>");
                                goto IL_7CA;
                            }
                            text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Signature_Error, "sign");
                            goto IL_7CA;
                        }
                    }
                    text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Paramter_Error, "paramters");
IL_7CA:
                    text += stringBuilder.ToString();
                }
                else
                {
                    text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Paramter_Error, "sign");
                }
            }
            catch (System.Exception ex)
            {
                text2 = MessageInfo.ShowMessageInfo(ApiErrorCode.Unknown_Error, ex.Message);
            }
            if (!string.IsNullOrEmpty(text2))
            {
                text = str + text2;
            }
            context.Response.ContentType = "text/xml";
            context.Response.Write(text);
        }