protected void btnOk_Click(object sender, EventArgs e) { string number = this.labBh.Text; string placement = SearchPlacement_DoubleLines1.Placement; string direct = DisposeString.DisString(this.txtDirect.Text, "'", "").Trim(); string oldplacement = ViewState["placement"].ToString(); string olddirect = ViewState["direct"].ToString(); string storeid = ViewState["storeid"].ToString(); if (placement == "" || direct == "") { lblmessage.Text = GetTran("000716", "推荐编号或安置编号都不能为空!"); return; } if (ChangeTeamBLL.CheckNum(direct)) { lblmessage.Text = GetTran("000717", "推荐编号不存在!"); return; } if (ChangeTeamBLL.CheckNum(placement)) { lblmessage.Text = GetTran("000718", "安置编号不存在!"); return; } string topMemberId = BLL.CommonClass.CommonDataBLL.getManageID(3); int district = Convert.ToInt32(ViewState["district"]);; if (placement != topMemberId) { int flag_xiou = ChangeTeamBLL.GetPlacementCount(placement, number); if (flag_xiou >= 2) { ScriptHelper.SetAlert(Page, GetTran("000000", "此安置编号下已经安置了两个人!")); return; } if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=" + direct + "").ToString() != "0") { district = AddOrderDataDAL.GetDistrict(placement, 1); if (district == 1) { if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=2").ToString() != "0") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false); return; } } else if (district == 2) { if (DBHelper.ExecuteScalar("select count(0) from memberinfo where placement='" + placement + "' and District=1").ToString() != "0") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false); return; } } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "安置人所选区位已有人安置!") + "');</script>", false); return; } } RegistermemberBLL registermemberBLL = new RegistermemberBLL(); string CheckMember = registermemberBLL.CheckMemberInProc(number, placement, direct, storeid); CheckMember = new GroupRegisterBLL().GerCheckErrorInfo(CheckMember); if (CheckMember != null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + CheckMember + "');</script>", false); return; } string p_info = registermemberBLL.GetHavePlacedOrDriect(number, "", placement, direct); if (p_info != null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + p_info + "');</script>", false); return; } //判断该编号是否有安置,推荐 string GetError = registermemberBLL.GetError(direct, 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; } #region 安置推荐人必须要激活 if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar("select COUNT(0) from MemberInfo where MemberState=1 and Number='" + direct + "'")) == 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=1 and Number='" + placement + "'")) == 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + this.GetTran("000000", "互助编号未激活!") + "');</script>", false); return; } #endregion } bool ispass = false; if (ViewState["placement"].ToString() != placement || ViewState["direct"].ToString() != direct) { Application.Lock(); string msg = ChangeTeamBLL.UpdateNet(number, placement, direct, oldplacement, olddirect, district, ChangeTeamBLL.GetFlag(number), out ispass); Application.UnLock(); ScriptHelper.SetAlert(Page, msg); } else { ScriptHelper.SetAlert(Page, this.GetTran("000000", "推荐、安置人编号未变化!")); } }
/// <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"); } }