예제 #1
0
    protected void StartRecord_click(object sender, EventArgs e)
    {
        ConsigneeInfo cinfo  = null;
        var           member = Session["Member"];

        if (member != null)
        {
            cinfo = MemberInfoModifyBll.getconsigneeInfo(member.ToString(), true);
            if (cinfo == null)
            {
                ScriptHelper.SetAlert(Page, "请先选择收货地址!", "PhoneSettings/SetConAddress.aspx?type=" + type + "&&url=AddLsOrder");
                return;
            }
        }
        else
        {
            Response.Redirect("~/MemberMobile/Index.aspx");
            return;
        }
        string count = DBHelper.ExecuteScalar("select count(*) from MemShopCart where memBh='" + luo.MemBh + "' and mType=" + Session["UserType"].ToString() + " and odType=" + luo.OrderType).ToString();

        if (count == "0" && Session["UserType"].ToString() != "1")
        {
            ScriptHelper.SetAlert(Page, GetTran("007430", "您至少要选择一种产品") + "!", "ShopingList.aspx");
            return;
        }
        else
        {
            IList <MemberDetailsModel> choseProList = new List <MemberDetailsModel>();

            OrderDeal od = new OrderDeal();

            OrderFinalModel ofm = new OrderFinalModel();

            ofm.SendWay = 1;//收货途径  会员收货
            if (Session["EditOrderID"] != null)
            {
                OrderFinalModel model = new OrderFinalModel();
                ofm          = od.GetDataModelFx(Convert.ToInt32(Session["UserType"]), luo.OrderType, out choseProList, ofm.SendWay);
                ofm.Assister = "";
            }
            else
            {
                if (luo.OrderType == 21 || luo.OrderType == 11 || luo.OrderType == 31)
                {
                    ofm = od.GetDataModel(Convert.ToInt32(Session["UserType"]), luo.OrderType, out choseProList, ofm.SendWay);

                    if (new RegistermemberBLL().CheckNumberTwice(ofm.Number) != null)
                    {
                        ScriptHelper.SetAlert(Page, GetTran("007432", "会员编号已存在") + "!");
                        AgainTime.Value = "0";
                        DAL.DBHelper.ExecuteNonQuery("delete from MemShopCart where memBh='" + luo.MemBh + "' and mType=" + Session["UserType"].ToString());
                        return;
                    }

                    string placement = new RegistermemberBLL().GetHavePlacedOrDriect(ofm.Number, "", ofm.Placement, ofm.Direct);
                    if (placement != null)
                    {
                        ScriptHelper.SetAlert(Page, placement);
                        AgainTime.Value = "0";
                        DAL.DBHelper.ExecuteNonQuery("delete from MemShopCart where memBh='" + luo.MemBh + "' and mType=" + Session["UserType"].ToString());
                        return;
                    }

                    if (ofm.Placement != "8888888888")
                    {
                        if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + ofm.Placement + "' and District=" + ofm.District + "").ToString() != "0")
                        {
                            ScriptHelper.SetAlert(Page, GetTran("007433", "安置人所选区位已有人安置") + "!");
                            AgainTime.Value = "0";
                            DAL.DBHelper.ExecuteNonQuery("delete from MemShopCart where memBh='" + luo.MemBh + "' and mType=" + Session["UserType"].ToString());
                            return;
                        }
                    }
                }
                else
                {
                    ofm = od.GetDataModelFx(Convert.ToInt32(Session["UserType"]), luo.OrderType, out choseProList, ofm.SendWay);
                    if (!MemberInfoDAL.IsMemberExist(ofm.Number))
                    {
                        ScriptHelper.SetAlert(Page, GetTran("000725", "会员编号不存在") + "!");
                        AgainTime.Value = "0";
                        return;
                    }
                    ofm.Assister = "";
                }
                if (luo.OrderType == 21 || luo.OrderType == 11)
                {
                    if (Convert.ToDouble(ofm.TotalMoney) < SetParametersBLL.GetMemOrderLineOrderBaseLine())
                    {
                        ScriptHelper.SetAlert(Page, GetTran("000000", "会员注册金额不能低于") + SetParametersBLL.GetMemOrderLineOrderBaseLine().ToString("f2") + "!");
                        AgainTime.Value = "0";
                        return;
                    }
                }
            }

            ofm.StoreID = "8888888888";
            ofm.Type    = 2;// 运货方式 邮寄 //Convert.ToInt32(this.ddth.SelectedValue);


            //if (lblOdType.Text == GetTran("004008", "注册报单"))
            //{
            //    ofm.IsAgain = 0;
            //}
            //else
            //{
            ofm.IsAgain = 1;
            //}
            ofm.OrderType = 12;

            double yfStr = 0;

            //地址

            if (cinfo != null)
            {
                ofm.CCPCCode      = cinfo.CPCCode;
                ofm.ConTelPhone   = cinfo.MoblieTele;
                ofm.ConMobilPhone = cinfo.MoblieTele;
                ofm.ConPost       = "";
                ofm.Consignee     = Encryption.Encryption.GetEncryptionName(cinfo.Consignee);
                ofm.ConZipCode    = cinfo.ConZipCode;
                ofm.ConAddress    = Encryption.Encryption.GetEncryptionAddress(cinfo.Address);
            }
            //ofm.ConCity.Country = this.CountryCity2.Country;
            //ofm.ConCity.Province = this.CountryCity2.Province;
            //ofm.ConCity.City = this.CountryCity2.City;
            //ofm.ConCity.Xian = this.CountryCity2.Xian;
            //ofm.ConAddress = Encryption.Encryption.GetEncryptionAddress(this.Txtdz.Text);
            //ofm.CCPCCode = DAL.CommonDataDAL.GetCPCCode(CountryCity2.Country, CountryCity2.Province, CountryCity2.City, CountryCity2.Xian);

            yfStr = 0;

            //ofm.ConTelPhone = txtOtherPhone.Text.Trim();
            //ofm.ConMobilPhone = txtOtherPhone.Text.Trim(); //Txtyddh.Text.Trim();
            //ofm.CarryMoney = Convert.ToDecimal(yfStr);
            //ofm.ConPost = "";
            //ofm.Consignee = Encryption.Encryption.GetEncryptionName(txtConName.Text.Trim());
            //ofm.ConZipCode = txtPostCode.Text;

            //ofm.Number = txtMemBh.Text;

            //产品总费用、年费、运费、应付总金额
            double pdtMoney = 0;      //double.Parse(this.ltPrice.Text);

            double CarriageMoney = 0; //运费

            ofm.CarryMoney = decimal.Parse("0.00");
            var     dayPrice = CommonDataBLL.GetMaxDayPrice();
            decimal yfje     = Convert.ToDecimal(ofm.TotalMoney / Convert.ToDecimal(dayPrice));

            ofm.TotalMoney = yfje + Convert.ToDecimal(CarriageMoney);
            //运费类型
            //if (ddth.SelectedValue == "1")//自提
            //{
            //    ofm.CarryMoney = decimal.Parse("0.00");
            //    this.txtYunfei.Text = ofm.CarryMoney.ToString();
            //}
            //else
            //{
            //    this.txtYunfei.Text = ofm.CarryMoney.ToString();
            //    ofm.TotalMoney = Convert.ToDecimal(ofm.TotalMoney) + Convert.ToDecimal(CarriageMoney);//加运费
            //}

            ofm.OrderExpect           = CommonDataBLL.getMaxqishu();
            ofm.StandardcurrencyMoney = yfje;
            ofm.TotalPv      = 0;
            ofm.PaymentMoney = yfje;
            ofm.LevelInt     = 1;
            ofm.StoreID      = "8888888888";


            ofm.InvestJB = yfje;                        //投资石斛积分币数量
            ofm.PriceJB  = Convert.ToDecimal(dayPrice); //石斛积分当前市价

            ofm.OrderID = registermemberBLL.GetOrderInfo("add", null);

            if (Session["EditOrderID"] != null)
            {
                int zhifuZt = Convert.ToInt32(DBHelper.ExecuteScalar("select defraystate from memberorder where orderid='" + Session["EditOrderID"] + "'"));

                if (zhifuZt == 1)
                {
                    ScriptHelper.SetAlert(Page, "该单已支付!不能修改!");
                    return;
                }

                SqlConnection conn = new SqlConnection(DBHelper.connString);
                conn.Open();
                SqlTransaction tran = conn.BeginTransaction();
                ofm.OrderID = Session["EditOrderID"].ToString();
                new AddOrderDataDAL().Del_Horder(Session["EditOrderID"].ToString(), tran);

                Boolean flag = new DAL.AddOrderDataDAL().AddFinalOrderNoInfo(ofm, tran);

                if (flag)
                {
                    //p_content.Visible = false;
                    Session.Remove("mbreginfo");
                    Session.Remove("fxMemberModel");
                    Session.Remove("LUOrder");
                    Session.Remove("OrderType");
                    Session.Remove("EditOrderID");
                    Session.Remove("MemberUpgradeStore");
                    Session["MemberInfo_NP"] = ofm.Number + "," + ofm.Number; //储存会员的编号

                    tran.Commit();
                    conn.Close();
                    conn.Dispose();

                    DAL.DBHelper.ExecuteNonQuery("delete from MemShopCart where memBh='" + ofm.Number + "' and mType=" + Session["UserType"].ToString());//订单提交成功后,删除购物车

                    if (Session["UserType"].ToString() == "1")
                    {
                        int val = AddOrderDataDAL.OrderPayment(ofm.StoreID, ofm.OrderID, ofm.OperateIp, 1, 1, 1, "管理员", "", 4, -1, 1, 1, "", 0, "");
                        if (val == 0)
                        {
                            ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("000222", "修改成功") + "');location.href='../company/BrowseMemberOrders.aspx';</script>", false);
                        }
                        else
                        {
                            ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("007435", "修改成功自动支付失败") + "!');location.href='../company/BrowseMemberOrders.aspx';</script>", false);
                        }
                    }
                    else if (Session["UserType"].ToString() == "2")
                    {
                        if (ofm.IsAgain == 0)
                        {
                            //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');"
                            //    + "formobj.action='../payserver/chosepay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" +
                            //    "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../store/browsememberorders.aspx';</script>", false);
                            //ScriptManager.RegisterStartupScript(this, GetType(), "mag", "var formobj=document.createElement('form');"
                            //    + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" +
                            //    "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../store/browsememberorders.aspx';", true);
                        }
                        else
                        {
                            //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');"
                            //    + "formobj.action='../payserver/chosepay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" +
                            //    "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../store/viewfuxiao.aspx';</script>", false);
                            //ScriptManager.RegisterStartupScript(this, GetType(), "mag", "var formobj=document.createElement('form');"
                            //    + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" +
                            //    "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../store/browsememberorders.aspx';", true);
                        }
                    }
                    else
                    {
                        if (ofm.IsAgain == 0)
                        {
                            //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');"
                            //    + "formobj.action='../payserver/chosepay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" +
                            //    "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../member/browsememberorders.aspx';</script>", false);
                            //ScriptManager.RegisterStartupScript(this, GetType(), "mag", "var formobj=document.createElement('form');"
                            //    + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" +
                            //    "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../member/browsememberorders.aspx';", true);
                        }
                        else
                        {
                            //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');"
                            //    + "formobj.action='../payserver/chosepay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" +
                            //    "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../member/memberorder.aspx';</script>", false);
                            //ScriptManager.RegisterStartupScript(this, GetType(), "mag", "var formobj=document.createElement('form');"
                            //    + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" +
                            //    "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../member/browsememberorders.aspx';", true);
                            Response.Redirect("../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "");
                        }
                    }
                }
                else
                {
                    tran.Rollback();
                    conn.Close();
                    conn.Dispose();
                    ScriptHelper.SetAlert(Page, GetTran("000225", "修改失败"));
                }
            }
            else
            {
                Boolean flag = new DAL.AddOrderDataDAL().AddFinalOrder(ofm);

                if (flag)
                {
                    //p_content.Visible = false;
                    Session.Remove("mbreginfo");
                    Session.Remove("fxMemberModel");
                    Session.Remove("LUOrder");
                    Session.Remove("OrderType");
                    Session.Remove("EditOrderID");
                    Session.Remove("MemberUpgradeStore");
                    Session["MemberInfo_NP"] = ofm.Number + "," + ofm.Number;                                                                            //储存会员的编号

                    DAL.DBHelper.ExecuteNonQuery("delete from MemShopCart where memBh='" + luo.MemBh + "' and mType=" + Session["UserType"].ToString()); //订单提交成功后,删除购物车

                    if (Session["UserType"].ToString() == "1")
                    {
                        int val = AddOrderDataDAL.OrderPayment(ofm.StoreID, ofm.OrderID, ofm.OperateIp, 1, 1, 1, "管理员", "", 5, -1, 1, 1, "", 0, "");
                        if (val == 0)
                        {
                            PublicClass.SendMsg(1, ofm.OrderID, "");
                            ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("000000", "购买成功") + "');location.href='../company/BrowseMemberOrders.aspx';</script>", false);
                        }
                        else
                        {
                            ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("000000", "报单成功,支付失败,店铺账户余额不足") + "!');location.href='../company/BrowseMemberOrders.aspx';</script>", false);
                        }
                    }
                    else if (Session["UserType"].ToString() == "2")
                    {
                        if (ofm.IsAgain == 0)
                        {
                            //Response.Redirect("../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1), true);
                            Response.Redirect("../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "");
                        }
                        else
                        {
                            Response.Redirect("../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "");
                            //Response.Redirect("../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1), true);
                            //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');"
                            //    + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';</script>" , false);//+
                            // "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../store/viewfuxiao.aspx';"
                        }
                    }
                    else
                    {
                        if (ofm.IsAgain == 0)
                        {
                            Response.Redirect("../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "");
                            //Response.Redirect("../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1), true);
                            //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');"
                            //    + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" +
                            //    "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../membermobile/browsememberorders.aspx';</script>", false);
                        }
                        else
                        {
                            Response.Redirect("../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "");
                            //Response.Redirect("../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1), true);
                            //ClientScript.RegisterStartupScript(GetType(), "msg", "<script>var formobj=document.createElement('form');"
                            //    + "formobj.action='../payserver/chosepaysj.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID, 1, 1) + "';" +
                            //    "formobj.method='post';formobj.target='_blank';document.body.appendChild(formobj); formobj.submit();location.href='../membermobile/memberorder.aspx';</script>", false);
                        }
                    }
                }
                else
                {
                    ScriptHelper.SetAlert(Page, GetTran("001557", "报单失败!"));
                }
            }
        }
    }
예제 #2
0
    /// <summary>
    /// 注册报单流程(包括判断)
    /// 调用逻辑层中的所有方法
    /// </summary>
    public void AddOrderAndInfoProcess(string access_token)
    {
        try
        {
            string xx = "https://oauth.factorde.com/api/sns/user/info";
            Dictionary <String, String> myD = new Dictionary <String, String>();
            myD.Add("app_id", PublicClass.app_id);
            myD.Add("access_token", access_token);
            myD.Add("lang", "zh_CN");
            myD.Add("version", "1.0");
            myD.Add("charset", "utf8");
            myD.Add("openid", Session["Member"].ToString());
            //string jsonStr = PublicClass.GetSignContent(myD);
            //jsonStr = HttpUtility.UrlEncode(jsonStr);//字符串进行编码,参数中有中文时一定需要这一步转换,否则接口接收的到参数会乱码
            string hz = PublicClass.GetFunction(xx, myD);
            //ck.Text = hz;
            JObject studentsJson = JObject.Parse(hz);
            Session["Member"] = studentsJson["data"]["openid"].ToString();
            //if (studentsJson["data"]["nickname"].ToString() == null || studentsJson["data"]["nickname"].ToString() == "")
            //{
            //    ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("000000", "请先实名认证") + "');</script>", false);
            //    return;

            //}
            int countdls = Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select count(0) from memberinfo where number='" + Session["Member"].ToString() + "'"));

            if (countdls <= 0)
            {
                string number = Session["Member"].ToString();

                string name                 = studentsJson["data"]["nickname"].ToString();
                string mobile_number        = studentsJson["data"]["mobile_number"].ToString();
                string email                = studentsJson["data"]["email"].ToString();
                string parent_mobile_number = studentsJson["data"]["parent_mobile_number"].ToString();
                string parent_email         = studentsJson["data"]["parent_email"].ToString();

                if (mobile_number == "")
                {
                    mobile_number = email;
                }
                if (parent_mobile_number == "")
                {
                    parent_mobile_number = parent_email;
                }
                DataTable dtdr = DAL.DBHelper.ExecuteDataTable("select number from memberinfo where MobileTele='" + parent_mobile_number + "'");
                if (dtdr.Rows != null && dtdr.Rows.Count > 0)
                {
                    parent_mobile_number = dtdr.Rows[0]["number"].ToString();//投资金额
                }
                MemberInfoModel mi = AddUserInfo(number, name, mobile_number, email, parent_mobile_number);

                Session["mbreginfo"] = mi;
                //Session["OrderType"] = 22;
                Session["UserType"]     = 3;
                Session["LUOrder"]      = Session["Member"].ToString() + ",12";
                Session["languageCode"] = "L001";

                if (Session["mbreginfo"] != null)
                {
                    decimal totalmoeny = 0.00M;
                    decimal bili       = 0.00M;

                    OrderFinalModel ofm      = new OrderFinalModel();
                    var             dayPrice = CommonDataBLL.GetMaxDayPrice();

                    var     value   = 0;//投资金额换化石斛积分
                    decimal totalpv = 0.0M;
                    var     expect  = CommonDataBLL.getMaxqishu();


                    totalpv       = 0;
                    ofm.InvestJB  = 0;                           //投资石斛积分币数量
                    ofm.PriceJB   = Convert.ToDecimal(dayPrice); //石斛积分当前市价
                    ofm.SendWay   = 1;
                    ofm.Number    = mi.Number;
                    ofm.Placement = mi.Placement;
                    ofm.Direct    = mi.Direct;
                    ofm.ExpectNum = expect;
                    ofm.OrderID   = registermemberBLL.GetOrderInfo("add", null);
                    ofm.StoreID   = mi.StoreID;
                    ofm.Name      = mi.Name;
                    ofm.PetName   = mi.PetName;
                    ofm.LoginPass = mi.LoginPass;
                    ofm.AdvPass   = mi.AdvPass;
                    ofm.LevelInt  = mi.LevelInt;

                    ofm.RegisterDate            = mi.RegisterDate;
                    ofm.Birthday                = mi.Birthday;
                    ofm.Sex                     = mi.Sex;
                    ofm.HomeTele                = mi.HomeTele;
                    ofm.OfficeTele              = mi.OfficeTele;
                    ofm.MobileTele              = mi.MobileTele;
                    ofm.FaxTele                 = mi.FaxTele;
                    ofm.CPCCode                 = mi.CPCCode;
                    ofm.Address                 = mi.Address;
                    ofm.PostalCode              = mi.PostalCode;
                    ofm.PaperType.PaperTypeCode = mi.PaperType.PaperTypeCode;
                    ofm.PaperNumber             = mi.PaperNumber;
                    ofm.BankCode                = mi.BankCode;
                    ofm.BankAddress             = mi.BankAddress;
                    ofm.BankCard                = mi.BankCard;
                    ofm.BCPCCode                = mi.BCPCCode;
                    ofm.BankBook                = mi.BankBook;
                    ofm.Remark                  = mi.Remark;
                    ofm.ChangeInfo              = mi.ChangeInfo;
                    ofm.PhotoPath               = mi.PhotoPath;
                    ofm.Email                   = mi.Email;
                    ofm.IsBatch                 = mi.IsBatch;
                    ofm.Language                = mi.Language;
                    ofm.OperateIp               = mi.OperateIp;
                    ofm.OperaterNum             = mi.OperaterNum;
                    ofm.Answer                  = mi.Answer;
                    ofm.Question                = mi.Question;
                    ofm.Error                   = mi.Error;
                    ofm.Bankbranchname          = mi.Bankbranchname;
                    ofm.Flag                    = mi.Flag;
                    ofm.Assister                = mi.Assister;
                    ofm.District                = mi.District;

                    ofm.TotalMoney            = Convert.ToDecimal(totalmoeny);
                    ofm.TotalPv               = Convert.ToDecimal(totalpv);//投资金额兑换成石斛积分
                    ofm.OrderType             = mi.OrderType;
                    ofm.OrderExpect           = expect;
                    ofm.StandardcurrencyMoney = ofm.TotalMoney;
                    ofm.PaymentMoney          = ofm.TotalMoney;
                    ofm.OrderDate             = DateTime.UtcNow;
                    ofm.RemittancesId         = "";
                    ofm.ElectronicaccountId   = "";
                    ofm.Type = 0;


                    ofm.ConCity.Country  = "";
                    ofm.ConCity.Province = "";
                    ofm.ConCity.City     = "";
                    ofm.ConCity.Xian     = "";
                    ofm.ConAddress       = "";
                    ofm.CCPCCode         = "";



                    ofm.ConTelPhone   = "";
                    ofm.ConMobilPhone = "";
                    ofm.CarryMoney    = 0;
                    ofm.ConPost       = "";
                    ofm.Consignee     = "";
                    ofm.ConZipCode    = "";

                    ofm.ProductIDList        = "";
                    ofm.QuantityList         = "";
                    ofm.NotEnoughProductList = "";
                    ofm.PhotoPath            = "";
                    Boolean flag = new AddOrderDataDAL().AddFinalOrder(ofm);
                    if (flag)
                    {
                        string sqljs = "exec dbo.js_addnew '" + Session["Member"].ToString() + "','','" + mi.Direct + "',0,1,0";
                        DBHelper.ExecuteNonQuery(sqljs);
                        int val = AddOrderDataDAL.OrderPayment(ofm.StoreID, ofm.OrderID, ofm.OperateIp, 3, 1, 10, "管理员", "", 1, -1, 1, 1, "", 0, "");
                        if (val == 0)
                        {
                            //PublicClass.SendMsg(1, ofm.OrderID, "");
                            DataTable dt = ChangeTeamBLL.GetMemberInfoDataTable(Session["Member"].ToString());
                            if (dt.Rows.Count > 0)
                            {
                                if (dt.Rows[0][0].ToString() != "" && dt.Rows[0][0].ToString() != null)
                                {
                                    string    sqlqq = "select  Number from memberinfo  where MobileTele='" + dt.Rows[0][0].ToString() + "'";
                                    DataTable dtt   = DBHelper.ExecuteDataTable(sqlqq);
                                    if (dtt.Rows.Count > 0)
                                    {
                                        string sql = "update memberinfo set Direct='" + dt.Rows[0][0].ToString() + "' where number='" + Session["Member"].ToString() + "'";
                                        DBHelper.ExecuteNonQuery(sql);
                                        string sqll = "update MemberInfoBalance" + CommonDataBLL.getMaxqishu() + " set Direct='" + dt.Rows[0][0].ToString() + "' where number='" + Session["Member"].ToString() + "'";
                                        DBHelper.ExecuteNonQuery(sqll);
                                        string sqljss = "exec dbo.js_addnew '" + Session["Member"].ToString() + "','','" + dt.Rows[0][0].ToString() + "',0,1,0";
                                        DBHelper.ExecuteNonQuery(sqljss);
                                    }
                                }
                            }
                            Response.Redirect("First.aspx");
                            ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("000436", "注册成功") + "');location.href='index.aspx';</script>", false);
                        }
                        else
                        {
                            ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("000000", "登陆失败,请联系管理员") + "');</script>", false);
                        }
                    }
                }
            }
            else
            {
                string mobile_number        = studentsJson["data"]["mobile_number"].ToString();
                string email                = studentsJson["data"]["email"].ToString();
                string parent_mobile_number = studentsJson["data"]["parent_mobile_number"].ToString();
                string parent_email         = studentsJson["data"]["parent_email"].ToString();

                DataTable dt = ChangeTeamBLL.GetMemberInfoDataTable(Session["Member"].ToString());
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0][0].ToString() != "" && dt.Rows[0][0].ToString() != null)
                    {
                        if (dt.Rows[0][0].ToString() == parent_mobile_number || dt.Rows[0][0].ToString() == parent_email)
                        {
                            string    sqlqq = "select  Number,Direct,name from memberinfo  where MobileTele='" + dt.Rows[0][0].ToString() + "'";
                            DataTable dtt   = DBHelper.ExecuteDataTable(sqlqq);
                            if (dtt.Rows.Count > 0)
                            {
                                if (dtt.Rows[0]["Direct"].ToString() != null && dtt.Rows[0]["Direct"].ToString() != "")
                                {
                                    string sql = "update memberinfo set Direct='" + dtt.Rows[0][0].ToString() + "' where number='" + Session["Member"].ToString() + "'";
                                    DBHelper.ExecuteNonQuery(sql);
                                    string sqll = "update MemberInfoBalance" + CommonDataBLL.getMaxqishu() + " set Direct='" + dtt.Rows[0][0].ToString() + "' where number='" + Session["Member"].ToString() + "'";
                                    DBHelper.ExecuteNonQuery(sqll);
                                    string sqljs = "exec dbo.js_addnew '" + Session["Member"].ToString() + "','','" + dtt.Rows[0][0].ToString() + "',0,1,0";
                                    DBHelper.ExecuteNonQuery(sqljs);
                                }
                                if (dtt.Rows[0]["name"].ToString() == "" || dtt.Rows[0]["name"].ToString() == null)
                                {
                                    string name = studentsJson["data"]["nickname"].ToString();
                                    string sql  = "update memberinfo set name='" + name + "' where number='" + Session["Member"].ToString() + "'";
                                    DBHelper.ExecuteNonQuery(sql);
                                }
                            }
                        }
                    }
                }


                Response.Redirect("First.aspx");
            }
        }
        catch (Exception)
        {
            ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('" + GetTran("000000", "登陆失败,请确认云端钱包是否登录") + "');</script>", false);
        }
    }
예제 #3
0
    /// <summary>
    /// 购买矿机
    /// </summary>
    /// <param name="chosenum"></param>
    /// <returns></returns>
    public void GetRegSendPost()
    {
        int chosenum = Convert.ToInt32(hidetp.Value);

        if (Session["Member"] == null)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('未登录!');</script>", false);
            return;  //未登录
        }
        string number = Session["Member"].ToString();

        int cc = Convert.ToInt32(DBHelper.ExecuteScalar("select  count(0)  from memberorder where  DefrayState=1   and  isactive=0 and ordertype<>0  and  number='" + number + "' "));

        if (cc > 0)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('您有未激活的矿机,请激活后再升级!'); setTimeout(function(){ window.location.href='orderlist.aspx'},2000);  </script>", false);
            return;
        }

        int re = 0;
        ///获取usdt账户
        int lv = 0;

        //檢測是否有未支付的單子 如果有則走未支付的訂單

        double ddmm    = 0;
        string orderid = "";

        //DataTable ddt = DBHelper.ExecuteDataTable("select  top 1 OrderID,TotalMoney from memberorder where  DefrayState=0 order by id  ");
        //if (ddt != null && ddt.Rows.Count > 0)
        //{
        //    DataRow dr = ddt.Rows[0];
        //    ddmm = Convert.ToDouble(dr["TotalMoney"]);
        //    orderid =  dr["orderid"].ToString();



        //    return;
        //}

        //清除未支付订单
        DBHelper.ExecuteNonQuery(@" insert  into   memberorderdel(id,[Number],[OrderID],[StoreID],[TotalMoney]
           ,[TotalPv],[CarryMoney],[OrderExpectNum],[PayExpectNum]
           ,[IsAgain],[OrderDate],[Error],[Remark],[DefrayState],[Consignee]
           ,[CCPCCode],[ConCity],[ConAddress]
           ,[ConZipCode],[ConTelphone]
           ,[ConMobilPhone],[ConPost]
           ,[DefrayType],[PayMoney]
           ,[PayCurrency],[StandardCurrency]
           ,[StandardCurrencyMoney],[OperateIP]
           ,[OperateNum],[RemittancesID],[ElectronicAccountID],[ordertype]
           ,[IsReceivables],[PayMentMoney],[ReceivablesDate],[EnoughProductMoney]
           ,[LackProductMoney],[IsReturn],[SendType],[SendWay],[TotalMoneyReturned]
           ,[TotalPvReturned],[OrderStatus],[TotalMoneyReturning],[TotalPvReturning]
           ,[OrderStatus_NR],[Isjjff],[trackingnum],[InvestJB]
           ,[PriceJB],[isSend],[xjpay],[xfpay],[bdpay],[ISSettle])
 select id,[Number],[OrderID],[StoreID],[TotalMoney]
           ,[TotalPv],[CarryMoney],[OrderExpectNum],[PayExpectNum]
           ,[IsAgain],[OrderDate],[Error],[Remark],[DefrayState],[Consignee]
           ,[CCPCCode],[ConCity],[ConAddress]
           ,[ConZipCode],[ConTelphone]
           ,[ConMobilPhone],[ConPost]
           ,[DefrayType],[PayMoney]
           ,[PayCurrency],[StandardCurrency]
           ,[StandardCurrencyMoney],[OperateIP]
           ,[OperateNum],[RemittancesID],[ElectronicAccountID],[ordertype]
           ,[IsReceivables],[PayMentMoney],[ReceivablesDate],[EnoughProductMoney]
           ,[LackProductMoney],[IsReturn],[SendType],[SendWay],[TotalMoneyReturned]
           ,[TotalPvReturned],[OrderStatus],[TotalMoneyReturning],[TotalPvReturning]
           ,[OrderStatus_NR],[Isjjff],[trackingnum],[InvestJB]
           ,[PriceJB],[isSend],[xjpay],[xfpay],[bdpay],[ISSettle]
 from MemberOrder where DefrayState = 0
 and number ='" + number + "'   ");
        //删除未支付的订单
        DBHelper.ExecuteNonQuery("delete  from   memberorder where  DefrayState=0 and number='" + number + "'   ");


        DataTable dt_one = DAL.DBHelper.ExecuteDataTable("select LevelInt from memberinfo where Number='" + number + "'");

        if (dt_one.Rows != null && dt_one.Rows.Count > 0)
        {
            lv = Convert.ToInt32(dt_one.Rows[0]["LevelInt"]);//获取账户等级
        }
        double zhye = 0;
        int    jd   = Common.GetcurJieDuan();//获取阶段状态

        if ((lv == 1 || (lv == 0 && chosenum > 1)) && jd == 1)
        {
            zhye = CommandAPI.GetActMoney();
        }
        if (chosenum < 0 || chosenum > 8 || lv > chosenum)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('请选择矿机!');</script>", false);
            return;
        } //选择购买的矿机

        ConfigModel cm        = ConfigDAL.GetConfig();
        double      ttmoney   = 0;
        double      ttpv      = 0;
        int         ordertype = 22; // 0 第一次购买 1 补差升级
        int         isagain   = 0;
        double      yymoney   = 0;

        //   int ispay = 0; ///支付状态
        if (lv == 0)
        {
            ordertype = 22; //抢购20u
        }
        if (lv == 1 || (lv == 0 && chosenum > 1))
        {
            ordertype = 23; //购买
        }
        if (lv == 2)
        {
            yymoney = cm.Para2;
        }
        if (lv == 3)
        {
            yymoney = cm.Para3;
        }
        if (lv == 4)
        {
            yymoney = cm.Para4;
        }
        if (lv == 5)
        {
            yymoney = cm.Para5;
        }
        if (lv == 6)
        {
            yymoney = cm.Para6;
        }
        if (lv == 7)
        {
            yymoney = cm.Para7;
        }
        if (lv == 7)
        {
            ordertype = 25;           //复投
        }
        if (chosenum == 1)
        {
            ttmoney = cm.Para1; ttpv = 0;
        }                                                   //20u 不计算业绩
        if (chosenum == 2)
        {
            ttmoney = cm.Para2 - yymoney; ttpv = cm.Para2 - yymoney;
        }
        if (chosenum == 3)
        {
            ttmoney = cm.Para3 - yymoney; ttpv = cm.Para3 - yymoney;
        }
        if (chosenum == 4)
        {
            ttmoney = cm.Para4 - yymoney; ttpv = cm.Para4 - yymoney;
        }
        if (chosenum == 5)
        {
            ttmoney = cm.Para5 - yymoney; ttpv = cm.Para5 - yymoney;
        }
        if (chosenum == 6)
        {
            ttmoney = cm.Para6 - yymoney; ttpv = cm.Para6 - yymoney;
        }
        if (chosenum == 7)
        {
            ttmoney = cm.Para7 - yymoney; ttpv = cm.Para7 - yymoney;
        }
        //if (chosenum == 8) { ttmoney = cm.Para28 - yymoney; ttpv = cm.Para28 - yymoney; }
        if (yymoney > 0)
        {
            isagain = 1; ordertype = 24;
        }                                                //升级

        DataTable dtmb = DBHelper.ExecuteDataTable("select pointAin-pointAout  as  ablc,pointbin-pointbout  as  bblc,pointcin-pointcout  as  cblc,pointdin-pointdout  as  dblc,pointein-pointeout  as  eblc  from memberinfo where number='" + number + "'");
        DataTable conp = DBHelper.ExecuteDataTable("select CoinIndex ,coinnewprice  from CoinPlant  order by id ");
        double    ablc = 0; double bblc = 0; double cblc = 0; double dblc = 0; double eblc = 0;
        double    cap = 0; double cbp = 0; double ccp = 0; double cdp = 0; double cep = 0;

        if (dtmb != null && dtmb.Rows.Count > 0)
        {
            DataRow dr = dtmb.Rows[0];
            ablc = Convert.ToDouble(dr["ablc"]);
            bblc = Convert.ToDouble(dr["bblc"]);
            cblc = Convert.ToDouble(dr["cblc"]);
            dblc = Convert.ToDouble(dr["dblc"]);
            eblc = Convert.ToDouble(dr["eblc"]);
        }
        else
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false);
            return;
        }
        if (conp != null && conp.Rows.Count > 0)
        {
            foreach (DataRow item in conp.Rows)
            {
                string s = item["CoinIndex"].ToString();
                if (s == "CoinA")
                {
                    cap = Convert.ToDouble(item["coinnewprice"]);
                }
                if (s == "CoinB")
                {
                    cbp = Convert.ToDouble(item["coinnewprice"]);
                }
                if (s == "CoinC")
                {
                    ccp = Convert.ToDouble(item["coinnewprice"]);
                }
                if (s == "CoinD")
                {
                    cdp = Convert.ToDouble(item["coinnewprice"]);
                }
                if (s == "CoinE")
                {
                    cep = Convert.ToDouble(item["coinnewprice"]);
                }
            }
        }
        else
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false);
            return;
        }


        double aneed = 0;
        double bneed = 0;
        double cneed = 0;
        double eneed = 0;

        if (lv > 0)
        {
            if (jd == 1)
            {
                if (zhye < ttmoney)
                {
                    //ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false);
                    //return;
                }//余额不足
                else if (jd == 2 || jd == 3)
                {
                    aneed = ttmoney / cap;
                    if (aneed > ablc)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false);
                        return;
                    }
                    ; //余额不足
                }
                else if (jd == 4 || jd == 5)
                {
                    aneed = (ttmoney * 0.5) / cap;
                    bneed = (ttmoney * 0.5) / cbp;
                    if (aneed > ablc || bneed > bblc)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('账户余额不足!');</script>", false);
                        return;
                    }//余额不足
                }
                else if (jd == 6 || jd == 7)
                {
                    aneed = (ttmoney * 0.2) / cap;
                    bneed = (ttmoney * 0.3) / cbp;
                    cneed = (ttmoney * 0.5) / ccp;
                    if (aneed > ablc || bneed > bblc || cneed > cblc)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>  showsuc('账户余额不足!');</script>", false);
                        return;
                    }//余额不足
                }
            }

            if (jd > 0 && chosenum > 1) ///  如果是20u以上 则需要额外支付 5% 的E
            {
                eneed = (ttmoney * 0.05) / cep;
                //if (eneed > eblc)
                //{
                //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('火星币余额不足,请先去抢购兑换!');</script>", false);
                //    return;
                //}
                //余额不足

                Session["Eneed"] = eneed;
            }
        }

        RegistermemberBLL registermemberBLL = new RegistermemberBLL();

        orderid = registermemberBLL.GetOrderInfo("add", null);
        int maxexpt = ConfigDAL.GetMaxExpectNum();

        Boolean flag = new AddOrderDataDAL().AddOrderInfo(number, orderid, maxexpt, isagain, ttmoney, ttpv, ordertype);

        Session["choselv"] = chosenum;   //保存当前选中级别
        if (flag)                        //插入订单成功 开始支付
        {
            if (jd == 1 && chosenum > 1) //说明是第一阶段的所有购买都 必须使用USDT买
            {
                Session["orderid"] = orderid;
                string postf = CommandAPI.GetFunction(orderid, ttmoney.ToString(), "recast.aspx", RadioButtonList1.SelectedValue);
                ClientScript.RegisterStartupScript(this.GetType(), "", postf, false);
                return;
            }

            else
            {
                //本地支付开始
                int r = MemberOrderDAL.PayOrder(number, orderid, aneed, bneed, cneed, eneed, chosenum, "使用本地币种账户支付");
                if (r == 1)
                {
                    //销毁
                    if (aneed > 0)
                    {
                        CommandAPI.Destruction("A", aneed);
                    }
                    if (bneed > 0)
                    {
                        CommandAPI.Destruction("B", bneed);
                    }
                    if (cneed > 0)
                    {
                        CommandAPI.Destruction("C", cneed);
                    }
                    // if (eneed > 0) CommandAPI.Destruction("E", eneed);
                    if (eneed > 0)
                    {
                        int ee = MemberOrderDAL.payOrderEcoin(number, orderid, eneed, "E币支付,激活成功");
                        if (ee == 1)
                        {
                            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('购买矿机激活成功!');</script>", false);
                        }
                        else
                        {
                            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('支付成功,请使用E币激活矿机!'); setTimeout(function(){ window.location.href='orderlist.aspx'},3000); </script>", false);
                        }
                    }


                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('购买成功!');</script>", false);
                    return;
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>showsuc('购买失败!');</script>", false);
                    return;
                }
            }
        }
    }
예제 #4
0
    /// <summary>
    /// 注册报单流程(包括判断)
    /// 调用逻辑层中的所有方法
    /// </summary>
    public void AddOrderAndInfoProcess()
    {
        string number = CommonDataBLL.quanjiao(txtNumber.Text.Trim());

        number         = number.Remove(0, number.Length - 8);
        txtNumber.Text = number.Remove(0, number.Length - 8);
        //会员名是否小于6位
        if (!registermemberBLL.NumberLength(number))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('抱歉!您输入的会员编号小于6位!');</script>", false);
            return;
        }
        if (!registermemberBLL.NumberCheckAgain(number))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('编号请输入字母,数字,横线!');</script>", false);
            return;
        }
        //验证手机号码是否重复
        if (registermemberBLL.CheckTeleTwice(txtTele.Text.Trim()) != null)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('抱歉!该手机号码已被注册!');</script>", false);
            return;
        }
        string name = CommonDataBLL.quanjiao(txtNamee.Text.Trim());

        if (name == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('真实姓名不能为空');</script>", false);
            return;
        }
        //判断用胡地址是否输入
        if (this.CountryCity2.Country == "请选择" || this.CountryCity2.Province == "请选择" || this.CountryCity2.City == "请选择" || this.CountryCity2.Xian == "请选择" || this.CountryCity2.Country == "" || this.CountryCity2.Province == "" || this.CountryCity2.City == "" || this.CountryCity2.Xian == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('对不起,请选择国家省份城市!');</script>", false);
            return;
        }
        if (DAL.CommonDataDAL.GetCPCCode(this.CountryCity2.Country, this.CountryCity2.Province, this.CountryCity2.City, this.CountryCity2.Xian) == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('对不起,请选择国家省份城市!');</script>", false);
            return;
        }
        MemberInfoModel mi = AddUserInfo();

        //if (mi.Placement != "8888888888")
        //{
        //    if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + mi.Placement + "' and District=" + mi.District + "").ToString() != "0")
        //    {
        //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('安置人所选区位已有人安置!');</script>", false);
        //        return;
        //    }
        //}

        Session["mbreginfo"] = mi;
        Session["OrderType"] = mi.OrderType;
        Session["UserType"]  = 1;

        if (Session["mbreginfo"] != null)
        {
            decimal   totalmoeny = 0.00M;
            decimal   bili       = 0.00M;
            DataTable dts        = DAL.DBHelper.ExecuteDataTable("select top 1 * from config order by createdate desc");
            if (dts.Rows != null && dts.Rows.Count > 0)
            {
                totalmoeny = Convert.ToDecimal(dts.Rows[0]["para1"]);//投资金额
                bili       = Convert.ToDecimal(dts.Rows[0]["para4"]);
            }
            OrderFinalModel ofm      = new OrderFinalModel();
            var             dayPrice = CommonDataBLL.GetMaxDayPrice();

            var     value   = Convert.ToDecimal(totalmoeny) / Convert.ToDecimal(dayPrice);//投资金额换化石斛积分
            decimal totalpv = 0.0M;
            var     expect  = CommonDataBLL.getMaxqishu();


            totalpv       = Convert.ToDecimal(value);
            ofm.InvestJB  = Convert.ToDecimal(value * bili); //投资石斛积分币数量
            ofm.PriceJB   = Convert.ToDecimal(dayPrice);     //石斛积分当前市价
            ofm.SendWay   = 1;
            ofm.Number    = mi.Number;
            ofm.Placement = mi.Placement;
            ofm.Direct    = mi.Direct;
            ofm.ExpectNum = expect;
            ofm.OrderID   = registermemberBLL.GetOrderInfo("add", null);
            ofm.StoreID   = mi.StoreID;
            ofm.Name      = mi.Name;
            ofm.PetName   = mi.PetName;
            ofm.LoginPass = mi.LoginPass;
            ofm.AdvPass   = mi.AdvPass;
            ofm.LevelInt  = mi.LevelInt;

            ofm.RegisterDate            = mi.RegisterDate;
            ofm.Birthday                = mi.Birthday;
            ofm.Sex                     = mi.Sex;
            ofm.HomeTele                = mi.HomeTele;
            ofm.OfficeTele              = mi.OfficeTele;
            ofm.MobileTele              = mi.MobileTele;
            ofm.FaxTele                 = mi.FaxTele;
            ofm.CPCCode                 = mi.CPCCode;
            ofm.Address                 = mi.Address;
            ofm.PostalCode              = mi.PostalCode;
            ofm.PaperType.PaperTypeCode = mi.PaperType.PaperTypeCode;
            ofm.PaperNumber             = mi.PaperNumber;
            ofm.BankCode                = mi.BankCode;
            ofm.BankAddress             = mi.BankAddress;
            ofm.BankCard                = mi.BankCard;
            ofm.BCPCCode                = mi.BCPCCode;
            ofm.BankBook                = mi.BankBook;
            ofm.Remark                  = mi.Remark;
            ofm.ChangeInfo              = mi.ChangeInfo;
            ofm.PhotoPath               = mi.PhotoPath;
            ofm.Email                   = mi.Email;
            ofm.IsBatch                 = mi.IsBatch;
            ofm.Language                = mi.Language;
            ofm.OperateIp               = mi.OperateIp;
            ofm.OperaterNum             = mi.OperaterNum;
            ofm.Answer                  = mi.Answer;
            ofm.Question                = mi.Question;
            ofm.Error                   = mi.Error;
            ofm.Bankbranchname          = mi.Bankbranchname;
            ofm.Flag                    = mi.Flag;
            ofm.Assister                = mi.Assister;
            ofm.District                = mi.District;

            ofm.TotalMoney            = Convert.ToDecimal(totalmoeny);
            ofm.TotalPv               = Convert.ToDecimal(totalpv);//投资金额兑换成石斛积分
            ofm.OrderType             = mi.OrderType;
            ofm.OrderExpect           = expect;
            ofm.StandardcurrencyMoney = ofm.TotalMoney;
            ofm.PaymentMoney          = ofm.TotalMoney;
            ofm.OrderDate             = DateTime.UtcNow;
            ofm.RemittancesId         = "";
            ofm.ElectronicaccountId   = "";
            ofm.Type = Convert.ToInt32(rbltotaltype.SelectedValue);


            ofm.ConCity.Country  = "";
            ofm.ConCity.Province = "";
            ofm.ConCity.City     = "";
            ofm.ConCity.Xian     = "";
            ofm.ConAddress       = "";
            ofm.CCPCCode         = "";



            ofm.ConTelPhone   = "";
            ofm.ConMobilPhone = "";
            ofm.CarryMoney    = 0;
            ofm.ConPost       = "";
            ofm.Consignee     = "";
            ofm.ConZipCode    = "";

            ofm.ProductIDList        = "";
            ofm.QuantityList         = "";
            ofm.NotEnoughProductList = "";
            ofm.PhotoPath            = "";
            Boolean flag = new AddOrderDataDAL().AddFinalOrder(ofm);
            if (flag)
            {
                ClientScript.RegisterStartupScript(GetType(), "msg", "<script>alert('注册成功');location.href='index.aspx';</script>", false);
                //if (Session["UserType"].ToString() == "1")
                //{
                //    int val = AddOrderDataDAL.OrderPayment(ofm.StoreID, ofm.OrderID, ofm.OperateIp, 3, 1, 10, "管理员", "", 1, -1, 1, 1, "", 0, "");
                //    if (val == 0)
                //    {
                //        PublicClass.SendMsg(1, ofm.OrderID, "");

                //    }
                //}
            }
        }
        //string CheckMember = registermemberBLL.CheckMemberInProc1(mi.Number, mi.LoginPass, mi.Direct, mi.MobileTele);
        //CheckMember = new GroupRegisterBLL().GerCheckErrorInfo(CheckMember);


        //if(CheckMember=="1")
        //{
        // ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('注册成功!');</script>", false);
        //   return;
        //}
    }
예제 #5
0
    public void GetFunction()
    {
        SqlDataReader sdr = DAL.DBHelper.ExecuteReader("select  Name,MobileTele from MemberInfo where Number='" + Session["Member"] + "'");

        if (sdr.Read())
        {
            string num = GenerateCheckCodeNum(32);
            string ddh = registermemberBLL.GetOrderInfo("add", null);

            Session["ddje"] = "";
            decimal mony = Convert.ToDecimal(money.Text.Trim());
            Session["ddje"] = mony;
            string yum = "https://oauth.factorde.com/api/pay/preOrder";
            Dictionary <String, String> myDictionary = new Dictionary <String, String>();
            Dictionary <String, Object> data         = new Dictionary <String, Object>
            {
                { "openid", Session["Member"].ToString() },
                { "body", Convert.ToString(sdr["MobileTele"]) + "购买配套" },
                { "subject", "购买配套" },
                { "out_trade_no", ddh },
                { "total_amount", mony *100000000 },
                { "settle_currency", RadioButtonList1.SelectedValue },

                { "trade_type", "H5" },
                { "trade_timeout_express", "600" },
                { "return_url", "http://sp.factorde.com/MemberMobile/MemberCashXF.aspx" }
            };

            String json = JsonConvert.SerializeObject(data, Formatting.Indented);

            myDictionary.Add("nonce_str", num);
            myDictionary.Add("biz_content", json);
            myDictionary.Add("app_id", PublicClass.app_id);
            myDictionary.Add("access_token", Session["access_token"].ToString());
            myDictionary.Add("lang", "zh_CN");
            myDictionary.Add("version", "1.0");
            myDictionary.Add("charset", "utf8");
            myDictionary.Add("openid", Session["Member"].ToString());

            string signjs  = PublicClass.GetSignContent(myDictionary);
            string jsonStr = PublicClass.HmacSHA256(signjs + "&key=cd310d4c38d3b27dd9dfc069e559f73f", "cd310d4c38d3b27dd9dfc069e559f73f");

            myDictionary.Add("sign", jsonStr);



            string rsp = PublicClass.doHttpPost(yum, myDictionary);


            JObject studentsJson = JObject.Parse(rsp);
            string  bh           = studentsJson["data"]["out_trade_no"].ToString();
            ddbh             = bh;
            Session["zfddh"] = ddbh;
            if (bh == ddh)
            {
                string ddhbm = "prepay_id%3D" + studentsJson["data"]["trade_no"].ToString();
                string sjc   = GetTimeStamp();
                string zfqm  = PublicClass.HmacSHA256("appId=58b7824b8b4f5c339bddf6079d153145&nonceStr=2K426TILTKCH16CQ25145I8ZNMTM67VS&package=" + ddhbm + "&signType=HMAC-SHA256&timeStamp=" + sjc + "&key=cd310d4c38d3b27dd9dfc069e559f73f", "cd310d4c38d3b27dd9dfc069e559f73f");
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>window.location.href = 'https://api.hicoin.vip/hicoinfe/payment?appId=58b7824b8b4f5c339bddf6079d153145&nonceStr=2K426TILTKCH16CQ25145I8ZNMTM67VS&package=" + ddhbm + "&signType=HMAC-SHA256&timeStamp=" + sjc + "&paySign=" + zfqm + "';</script>");
                return;
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('支付失败请联系管理员。');</script>");
                return;
            }
        }
        sdr.Close();
        sdr.Dispose();
    }
예제 #6
0
    public OrderFinalModel GetDataModel(int mType, int OType, out IList <MemberDetailsModel> choseProList, int sendway)
    {
        OrderFinalModel ofm = new OrderFinalModel();

        RegistermemberBLL registermemberBLL = new RegistermemberBLL();

        MemberInfoModel mim = ((MemberInfoModel)HttpContext.Current.Session["mbreginfo"]);

        ofm.SendWay   = sendway;
        ofm.Number    = mim.Number;
        ofm.Placement = mim.Placement;
        ofm.Direct    = mim.Direct;
        ofm.ExpectNum = CommonDataBLL.getMaxqishu();
        ofm.OrderID   = registermemberBLL.GetOrderInfo("add", null);
        ofm.StoreID   = mim.StoreID;
        ofm.Name      = mim.Name;
        ofm.PetName   = mim.PetName;
        ofm.LoginPass = mim.LoginPass;
        ofm.AdvPass   = mim.AdvPass;
        ofm.LevelInt  = mim.LevelInt;

        ofm.RegisterDate            = mim.RegisterDate;
        ofm.Birthday                = mim.Birthday;
        ofm.Sex                     = mim.Sex;
        ofm.HomeTele                = mim.HomeTele;
        ofm.OfficeTele              = mim.OfficeTele;
        ofm.MobileTele              = mim.MobileTele;
        ofm.FaxTele                 = mim.FaxTele;
        ofm.CPCCode                 = mim.CPCCode;
        ofm.Address                 = mim.Address;
        ofm.PostalCode              = mim.PostalCode;
        ofm.PaperType.PaperTypeCode = mim.PaperType.PaperTypeCode;
        ofm.PaperNumber             = mim.PaperNumber;
        ofm.BankCode                = mim.BankCode;
        ofm.BankAddress             = mim.BankAddress;
        ofm.BankCard                = mim.BankCard;
        ofm.BCPCCode                = mim.BCPCCode;
        ofm.BankBook                = mim.BankBook;
        ofm.Remark                  = mim.Remark;
        ofm.ChangeInfo              = mim.ChangeInfo;
        ofm.PhotoPath               = mim.PhotoPath;
        ofm.Email                   = mim.Email;
        ofm.IsBatch                 = mim.IsBatch;
        ofm.Language                = mim.Language;
        ofm.OperateIp               = mim.OperateIp;
        ofm.OperaterNum             = mim.OperaterNum;
        ofm.Answer                  = mim.Answer;
        ofm.Question                = mim.Question;
        ofm.Error                   = mim.Error;
        ofm.Bankbranchname          = mim.Bankbranchname;
        ofm.Flag                    = mim.Flag;
        ofm.Assister                = mim.Assister;
        ofm.District                = mim.District;

        //memberorder开始
        DataTable dt11 = GetMoneyAndProMess(mim.Number, mType, OType);

        if (dt11.Rows.Count > 0)
        {
            ofm.TotalMoney = Convert.ToDecimal(MemberOrderAgainBLL.GetBzMoney(mim.StoreID, Convert.ToDouble(dt11.Rows[0]["TotalPriceAll"])));
            ofm.TotalPv    = Convert.ToDecimal(dt11.Rows[0]["TotalPvAll"]);
        }
        else
        {
            ofm.TotalMoney = 0;
            ofm.TotalPv    = 0;
        }

        ofm.PayExpect   = -1;
        ofm.OrderExpect = CommonDataBLL.getMaxqishu();
        ofm.IsAgain     = OType;
        ofm.OrderDate   = DateTime.Now.ToUniversalTime();
        ofm.DefrayState = 0; //未支付
        ofm.OrderType   = OType;
        //   ofm.Type
        //ofm.OrderType  ofm.CCPCCode  ofm.ConAddress ofm.ConTelPhone ofm.ConMobilPhone  ofm.ConPost
        //ofm.Consignee ofm.ConZipCode ofm.SendWay 不在此处理
        ofm.RemittancesId         = "";
        ofm.ElectronicaccountId   = "";
        ofm.DefrayType            = -1;
        ofm.PayCurrency           = 1;
        ofm.PayMoney              = 0;
        ofm.StandardCurrency      = MemberOrderAgainBLL.GetBzTypeId(mim.StoreID);
        ofm.StandardcurrencyMoney = Convert.ToDecimal(dt11.Rows[0]["TotalPriceAll"]);
        ofm.CarryMoney            = 0;
        ofm.IsreceiVables         = 0;
        ofm.IsRetail              = 0;
        ofm.DeclareMoney          = 0;
        ofm.PaymentMoney          = 0;

        DataTable dt22 = GetProMess(mim.Number, mType, OType);

        choseProList = AddMemberDetails(dt22);

        if (ofm.SendWay == 0)
        {
            ofm.EnoughProductMoney = Convert.ToDecimal(registermemberBLL.getEnoughProductMoney(choseProList, mim.StoreID));
            double notEnoughmoney = registermemberBLL.CheckMoneyIsEnough(choseProList, mim.StoreID);
            ofm.LackProductMoney = Convert.ToDecimal(registermemberBLL.ChangeNotEnoughMoney(mim.StoreID, notEnoughmoney));
        }
        else
        {
            ofm.EnoughProductMoney = 0;
            ofm.LackProductMoney   = ofm.TotalMoney;
        }

        if (dt22.Rows.Count > 0)
        {
            string proNum     = "";
            string proId      = "";
            string notProList = "";
            for (int i = 0; i < dt22.Rows.Count; i++)
            {
                proNum     += dt22.Rows[i]["proNum"].ToString() + ",";
                proId      += dt22.Rows[i]["proId"].ToString() + ",";
                notProList += choseProList[i].NotEnoughProduct.ToString() + ",";
            }

            ofm.ProductIDList        = proId;
            ofm.QuantityList         = proNum;
            ofm.NotEnoughProductList = notProList;
        }
        else
        {
            ofm.ProductIDList        = ",";
            ofm.QuantityList         = ",";
            ofm.NotEnoughProductList = ",";
        }

        return(ofm);
    }
예제 #7
0
    /// <summary>
    /// 控件翻译方法
    /// </summary>
    //public void Translate()
    //{
    //    this.TranControls(this.dplCardType, new string[][] {
    //     new string[] { "005898", "无" },
    //     new string[] { "005776", "身份证" },
    //     new string[] { "005775", "护照" },
    //     new string[] { "005774", "港澳台证" },

    //    });
    //}

    /// <summary>
    /// 注册报单流程(包括判断)
    /// 调用逻辑层中的所有方法
    /// </summary>
    public void AddOrderAndInfoProcess()
    {
        string number = CommonDataBLL.quanjiao(HFNumber.Value.Trim());
        string direct = txtDirect.Text.Trim();

        //会员名是否小于6位
        if (!registermemberBLL.NumberLength(number))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000306", "抱歉!您输入的会员编号小于6位!") + "');</script>", false);
            return;
        }
        if (!registermemberBLL.NumberCheckAgain(number))
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000309", "编号请输入字母,数字,横线!") + "');</script>", false);
            return;
        }

        string name = CommonDataBLL.quanjiao(txtName.Text.Trim());

        if (name == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("008360", "真实姓名不能为空") + "!" + "');</script>", false);
            return;
        }
        string tel = CommonDataBLL.quanjiao(txtTele.Text.Trim());

        if (tel == "" || tel.Length != 11)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('手机号格式不正确!');</script>", false);
            return;
        }

        //string storeid = CommonDataBLL.quanjiao(txtStore.Text.Trim());
        //if (storeid == "")
        //{
        //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("008361", "所属店铺不能为空") + "!" + "');</script>", false);
        //    return;
        //}
        //else
        //{
        //    if (!StoreInfoDAL.CheckStoreId(storeid))
        //    {
        //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("008362", "所属店铺编号不存在!") + "');</script>", false);
        //        return;
        //    }
        //}

        //判断用胡地址是否输入
        if (this.CountryCity2.Country == "请选择" || this.CountryCity2.Province == "请选择" || this.CountryCity2.City == "请选择" || this.CountryCity2.Xian == "请选择" || this.CountryCity2.Country == "" || this.CountryCity2.Province == "" || this.CountryCity2.City == "" || this.CountryCity2.Xian == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001548", "对不起,请选择国家省份城市!") + "');</script>", false);
            return;
        }
        if (DAL.CommonDataDAL.GetCPCCode(this.CountryCity2.Country, this.CountryCity2.Province, this.CountryCity2.City, this.CountryCity2.Xian) == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001548", "对不起,请选择国家省份城市!") + "');</script>", false);
            return;
        }

        //string direct = CommonDataBLL.quanjiao(txtDirect.Text.Trim());

        string placement = hidplacemnet.Value;// CommonDataBLL.quanjiao(SearchPlacement_DoubleLines1.Placement);

        //if (direct == "" || placement == "")
        //{
        //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000716", "推荐编号和安置编号不能为空!") + "');</script>", false);
        //    return;
        //}

        //if (direct == number)
        //{
        //    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("006700", "推荐编号不能与会员编号相同") + "');</script>", false);
        //    return;
        //}

        if (placement == number)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("001650", "安置编号不能与会员编号相同") + "');</script>", false);
            return;
        }

        //验证年龄是否大于18岁
        //string birthDate = CommonDataBLL.quanjiao(txtBirthDate.Text.Trim());
        //if (this.dplCardType.SelectedValue != "2")
        //{
        //    string alert = registermemberBLL.AgeIs18(birthDate);
        //    if (alert != null)
        //    {
        //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + alert + "');</script>", false);
        //        return;
        //    }
        //}

        ////检查会员生日
        //if (this.dplCardType.SelectedValue != "2")
        //{
        //    if (registermemberBLL.CheckBirthDay(birthDate) == "error")
        //    {
        //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000148", "对不起,请选择正确的出生日期!") + "');</script>", false);
        //        return;
        //    }
        //}


        ////检测身份证需要新方法
        //string CardResult = "";
        //if (this.dplCardType.SelectedValue == "2")
        //{
        //    string papernumber = CommonDataBLL.quanjiao(this.txtPapernumber.Text.Trim());
        //    string result = BLL.Registration_declarations.CheckMemberInfo.CHK_IdentityCard(papernumber);
        //    if (result.IndexOf(",") <= 0)
        //    {

        //        return;
        //    }
        //    else
        //    {
        //        CardResult = result;
        //    }
        //    DateTime birthday = Convert.ToDateTime(CardResult.Substring(0, CardResult.IndexOf(",")));
        //    string alerta = registermemberBLL.AgeIs18(birthday.ToString());
        //    if (alerta != null)
        //    {
        //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + alerta + "');</script>", false);
        //        return;
        //    }
        //}

        //ViewState["CardResult"] = CardResult;
        //验证会员编号是否重复
        if (registermemberBLL.CheckNumberTwice(number) != null)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000406", "抱歉!该会员编号重复!") + "');</script>", false);
            if (Request.QueryString["Much"] == null)
            {
                string bb = BLL.CommonClass.CommonDataBLL.GetMemberNumber();
                this.txtNumber.Text     = bb;
                this.HFNumber.Value     = bb;
                this.txtNumber.ReadOnly = true;
            }
            return;
        }
        //验证手机号码是否重复
        if (registermemberBLL.CheckTeleTwice(txtTele.Text.Trim()) != null)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('抱歉!该手机号码已被注册!');</script>", false);
            return;
        }


        MemberInfoModel mi = AddUserInfo();

        if (mi.Placement != "8888888888")
        {
            if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + mi.Placement + "' and District=" + mi.District + "  and  memberstate=1 ").ToString() != "0")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("007433", "安置人所选区位已有人安置!") + "');</script>", false);
                return;
            }
        }



        //注册会员检错1.无上级  2.无此店  3..死循环
        string CheckMember = registermemberBLL.CheckMemberInProc(mi.Number, mi.Placement, mi.Direct, mi.StoreID);

        CheckMember        = new GroupRegisterBLL().GerCheckErrorInfo(CheckMember);
        ViewState["Error"] = CheckMember;
        if (Request.QueryString["Much"] == null)
        {
            if (CheckMember != null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + CheckMember + "');</script>", false);
                return;
            }

            string placement_check = registermemberBLL.GetHavePlacedOrDriect(mi.Number, "", mi.Placement, mi.Direct);
            if (placement_check != null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + placement_check + "');</script>", false);
                return;
            }



            //判断该编号是否有安置,推荐
            string GetError = registermemberBLL.GetError(mi.Direct, mi.Placement);
            if (GetError != null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetError + "');</script>", false);

                return;
            }
            string GetError1 = new AjaxClass().CheckNumberNetAn(direct, placement);
            if (GetError1 != null && GetError1 != "")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("005986", "安置编号必须在推荐编号的安置网络下面!") + "');</script>", false);
                return;
            }
            string GetError2 = new AjaxClass().CheckNumberNetAn(Session["Member"].ToString(), direct);
            if (GetError2 != null && GetError2 != "")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "推荐编号必须在自己的安置网络下面!") + "');</script>", false);
                return;
            }


            #region 安置推荐人必须要激活


            if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where   MemberState=0 and Number='" + CommonDataBLL.quanjiao(Session["Member"].ToString()) + "'")) != 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "推荐编号未激活!") + "');</script>", false);
                return;
            }

            if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where   MemberState=2 and Number='" + CommonDataBLL.quanjiao(Session["Member"].ToString()) + "'")) != 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("009090", "推荐编号已注销!") + "');</script>", false);
                return;
            }
            if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where MemberState=0 and Number='" + CommonDataBLL.quanjiao(hidplacemnet.Value) + "'")) != 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置编号未激活!") + "');</script>", false);
                return;
            }
            if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where MemberState=2 and Number='" + CommonDataBLL.quanjiao(hidplacemnet.Value) + "'")) != 0)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("009107", "安置编号已注销!") + "');</script>", false);
                return;
            }

            #endregion

            //int placementXuHao = registermemberBLL.GetXuHao(mi.Direct);
            //if (placementXuHao >= 0)
            //{

            //    string GetError1 = new AjaxClass().CheckNumberNetAn(txtDirect.Text.Trim(), SearchPlacement_DoubleLines1.Placement);
            //    if (GetError1 != null && GetError1 != "")
            //    {
            //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("005986", "安置编号必须在推荐编号的安置网络下面!") + "');</script>", false);
            //        return;
            //    }
            //}

            //如果是零购注册,判断推荐人和安置人的注册期数是否合格
            //if (Session["Company"] != null)
            //{
            //    int tjExpectNum = registermemberBLL.GetError2(this.Txttj.Text.Trim());
            //    if (tjExpectNum > Convert.ToInt32(this.ddlQishu.SelectedValue))
            //    {
            //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("006013", "推荐人的注册期数必须大于") + this.ddlQishu.SelectedValue + "!');</script>", false);
            //        return;
            //    }

            //    int anExpectNum = registermemberBLL.GetError2(SearchPlacement_DoubleLines1.Placement.Trim());
            //    if (anExpectNum > Convert.ToInt32(this.ddlQishu.SelectedValue))
            //    {
            //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("006014", "安置人的注册期数必须大于") + this.ddlQishu.SelectedValue + "!');</script>", false);
            //        return;
            //    }
            //}
        }

        mi.PhotoPath = "";


        if (Session["UserType"] != null && Session["UserType"].ToString() == "1") //公司注册
        {
            mi.OrderType       = 31;
            Session["LUOrder"] = mi.Number + ",31,1";
        }
        else if (Session["UserType"] != null && Session["UserType"].ToString() == "2") //店铺注册
        {
            mi.OrderType       = 11;
            Session["LUOrder"] = mi.Number + ",11,2";
        }
        else if (Session["UserType"] != null && Session["UserType"].ToString() == "3") //会员注册
        {
            mi.OrderType       = 21;
            Session["LUOrder"] = mi.Number + ",21,3";
            mi.Assister        = Session["Member"].ToString();
        }
        else //默认店铺注册
        {
            mi.OrderType       = 11;
            Session["LUOrder"] = mi.Number + ",11,2";
        }

        Session["mbreginfo"] = mi;

        if (Session["mbreginfo"] != null)
        {
            decimal   totalmoeny = 0.00M;
            decimal   bili       = 0.00M;
            DataTable dts        = DAL.DBHelper.ExecuteDataTable("select top 1 * from config order by createdate desc");
            if (dts.Rows != null && dts.Rows.Count > 0)
            {
                decimal htm = Convert.ToDecimal(hidtzmoney.Value);
                if (htm == Convert.ToDecimal(dts.Rows[0]["para1"]))
                {
                    bili = Convert.ToDecimal(dts.Rows[0]["para4"]);
                }
                if (htm == Convert.ToDecimal(dts.Rows[0]["para2"]))
                {
                    bili = Convert.ToDecimal(dts.Rows[0]["para5"]);
                }
                if (htm == Convert.ToDecimal(dts.Rows[0]["para3"]))
                {
                    bili = Convert.ToDecimal(dts.Rows[0]["para6"]);
                }
            }
            OrderFinalModel ofm      = new OrderFinalModel();
            var             dayPrice = CommonDataBLL.GetMaxDayPrice();

            totalmoeny = Convert.ToDecimal(hidtzmoney.Value);;                       //投资金额
            var value = Convert.ToDecimal(totalmoeny) / Convert.ToDecimal(dayPrice); //投资金额换化石斛积分

            var expect = CommonDataBLL.getMaxqishu();



            ofm.InvestJB  = Convert.ToDecimal(value * bili); //投资石斛积分数量
            ofm.PriceJB   = Convert.ToDecimal(dayPrice);     //石斛积分当前市价
            ofm.SendWay   = 1;
            ofm.Number    = mi.Number;
            ofm.Placement = mi.Placement;
            ofm.Direct    = mi.Direct;
            ofm.ExpectNum = expect;
            ofm.OrderID   = registermemberBLL.GetOrderInfo("add", null);
            ofm.StoreID   = mi.StoreID;
            ofm.Name      = mi.Name;
            ofm.PetName   = mi.PetName;
            ofm.LoginPass = mi.LoginPass;
            ofm.AdvPass   = mi.AdvPass;
            ofm.LevelInt  = mi.LevelInt;

            ofm.RegisterDate            = mi.RegisterDate;
            ofm.Birthday                = mi.Birthday;
            ofm.Sex                     = mi.Sex;
            ofm.HomeTele                = mi.HomeTele;
            ofm.OfficeTele              = mi.OfficeTele;
            ofm.MobileTele              = mi.MobileTele;
            ofm.FaxTele                 = mi.FaxTele;
            ofm.CPCCode                 = mi.CPCCode;
            ofm.Address                 = mi.Address;
            ofm.PostalCode              = mi.PostalCode;
            ofm.PaperType.PaperTypeCode = mi.PaperType.PaperTypeCode;
            ofm.PaperNumber             = mi.PaperNumber;
            ofm.BankCode                = mi.BankCode;
            ofm.BankAddress             = mi.BankAddress;
            ofm.BankCard                = mi.BankCard;
            ofm.BCPCCode                = mi.BCPCCode;
            ofm.BankBook                = mi.BankBook;
            ofm.Remark                  = mi.Remark;
            ofm.ChangeInfo              = mi.ChangeInfo;
            ofm.PhotoPath               = mi.PhotoPath;
            ofm.Email                   = mi.Email;
            ofm.IsBatch                 = mi.IsBatch;
            ofm.Language                = mi.Language;
            ofm.OperateIp               = mi.OperateIp;
            ofm.OperaterNum             = mi.OperaterNum;
            ofm.Answer                  = mi.Answer;
            ofm.Question                = mi.Question;
            ofm.Error                   = mi.Error;
            ofm.Bankbranchname          = mi.Bankbranchname;
            ofm.Flag                    = mi.Flag;
            ofm.Assister                = mi.Assister;
            ofm.District                = mi.District;

            ofm.Type = Convert.ToInt32(rbltotaltype.SelectedValue);

            ofm.TotalMoney            = Convert.ToDecimal(totalmoeny);
            ofm.TotalPv               = Convert.ToDecimal(value);//投资金额兑换成石斛
            ofm.OrderType             = mi.OrderType;
            ofm.OrderExpect           = expect;
            ofm.StandardcurrencyMoney = ofm.TotalMoney;
            ofm.PaymentMoney          = ofm.TotalMoney;
            ofm.OrderDate             = DateTime.UtcNow;
            ofm.RemittancesId         = "";
            ofm.ElectronicaccountId   = "";



            ofm.ConCity.Country  = "";
            ofm.ConCity.Province = "";
            ofm.ConCity.City     = "";
            ofm.ConCity.Xian     = "";
            ofm.ConAddress       = mi.Address;
            ofm.CCPCCode         = mi.CPCCode;



            ofm.ConTelPhone   = mi.MobileTele;
            ofm.ConMobilPhone = mi.MobileTele;
            ofm.CarryMoney    = 0;
            ofm.ConPost       = mi.Email;
            ofm.Consignee     = mi.PetName;
            ofm.ConZipCode    = mi.PostalCode;

            ofm.ProductIDList        = "";
            ofm.QuantityList         = "";
            ofm.NotEnoughProductList = "";
            ofm.PhotoPath            = "";
            Boolean flag = new AddOrderDataDAL().AddFinalOrder(ofm);
            if (flag)
            {
                // ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#tiaoz').show();document.getElementById('tiaoz').href = '../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID.ToString(), 1, 1) + "'; alertt('注册订单已生成,请及时支付!');</script>", false);
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>location.href = '../payserver/chosepaysjpay.aspx?blif=" + EncryKey.GetEncryptstr(ofm.OrderID.ToString(), 1, 1) + "'; </script>", false);
            }
        }
        else
        {
            Response.Redirect("registermember.aspx");
        }
    }