/// <summary> /// 发送短信 /// </summary> public string SendSMS(string phone, string account) { try { if (!SendSMSTime()) { return("请120秒后再获取验证码"); } IPAddress ip = IPAddressLocator.GetRequestIP(HttpContext.Current.Request); if (!AccountCombineService.ValidateIP(ip.ToString())) { return("同一个IP一天只有100次获取验证码的机会"); } var verfiCode = new VerfiCode() { CellPhone = phone, Code = ChinaPay.Utility.VerifyCodeUtility.CreateVerifyCode(6, "1,2,3,4,5,6,7,8,9,0"), IP = ip.ToString(), Type = Common.Enums.VerfiCodeType.Register, AccountNo = account }; Session["phoneValidateCode"] = verfiCode.Code; Session["phoneTime"] = DateTime.Now; SMSSendService.SendB3bRegisterValidateCode(verfiCode.CellPhone, verfiCode.Code, 20, BasePage.CurrenContract.ServicePhone); AccountCombineService.SaveVerfiCode(verfiCode); return(string.Empty); } catch (Exception) { return("发送验证码异常"); } }
private void ToExamine() { Guid id = Guid.Parse(Request.QueryString["CompanyId"]); CompanyType type = (CompanyType)byte.Parse(Request.QueryString["CompanyType"]); AccountBaseType accounType = (AccountBaseType)byte.Parse(Request.QueryString["AccountType"]); AuditType auditType = (AuditType)int.Parse(Request.QueryString["AuditType"]); var address = ChinaPay.B3B.TransactionWeb.PublicClass.AddressShow.GetAddressBaseInfo(hfldAddressCode.Value); bool isUpgrade = false; CompanyUpgrade companyUpgrade = null; if (auditType == AuditType.ApplyAudit) { isUpgrade = true; companyUpgrade = CompanyUpgradeService.QueryCompanyUpgrade(id); } if ((type == CompanyType.Provider && !isUpgrade) || (isUpgrade && companyUpgrade.Type == CompanyType.Provider)) { AccountCombineService.AuditProviderInfo(id, GetProviderAuditInfo(address, isUpgrade)); } else { if (accounType == AccountBaseType.Individual) { AccountCombineService.AuditSupplier(id, GetSupplierIndividualAuditInfo(address, isUpgrade)); } else { AccountCombineService.AuditSupplier(id, GetSupplierEnterpriseInfo(address, isUpgrade)); } } }
public void OutPutStram(string companyId) { string type = HttpContext.Current.Request.QueryString["type"]; HttpContext.Current.Response.ContentType = "image/jpeg"; CompanyDocument companyDocument = null; if (!string.IsNullOrWhiteSpace(companyId)) { companyDocument = AccountCombineService.QueryCompanyDocument(Guid.Parse(companyId)); } if (companyDocument != null) { if (type == "bussiness" && companyDocument.BussinessLicense != null && companyDocument.BussinessLicense.Length > 0) { HttpContext.Current.Response.BinaryWrite(companyDocument.BussinessLicense); } if (type == "certNo" && companyDocument.CertLicense != null && companyDocument.CertLicense.Length > 0) { HttpContext.Current.Response.BinaryWrite(companyDocument.CertLicense); } if (type == "iata" && companyDocument.IATALicense != null && companyDocument.IATALicense.Length > 0) { HttpContext.Current.Response.BinaryWrite(companyDocument.IATALicense); } } }
private void RegisterAccount() { if (CurrentCompany.CompanyType == CompanyType.Platform) { if (person.Checked) { AccountCombineService.Register(GetAccountInfo(), GetIndividual(), DomainName, CurrenContract.ServicePhone, PlatformName); } else { AccountCombineService.Register(GetAccountInfo(), GetEnterprise(), DomainName, CurrenContract.ServicePhone, PlatformName); } } else { //if (VerificationIPAddress.VerificationIP() && Verification.VerificationCode(txtPhoneCode.Text, "phoneValidateCode")) //{ } if (person.Checked) { // AccountCombineService.Spread(CurrentCompany.CompanyId, GetAccountInfo(), GetIndividual()); } else { // AccountCombineService.Spread(CurrentCompany.CompanyId, GetAccountInfo(), GetEnterprise()); } } }
private bool SendSms() { IPAddress ip = IPAddressLocator.GetRequestIP(HttpContext.Current.Request); if (!AccountCombineService.ValidateIP(ip.ToString())) { BasePage.RegisterScript(this, "alert('同一个IP一天只有3次获取验证码的机会');"); return(false); } var verfiCode = new VerfiCode { CellPhone = Session["phone"].ToString(), Code = ChinaPay.Utility.VerifyCodeUtility.CreateVerifyCode(6), IP = ip.ToString(), Type = Common.Enums.VerfiCodeType.Register, AccountNo = Session["accountno"].ToString() }; Session["phoneValidateCode"] = verfiCode.Code; Session["phone"] = verfiCode.CellPhone; Session["phoneTime"] = DateTime.Now; ChinaPay.SMS.Service.SMSSendService.SendB3bTrade(verfiCode.CellPhone, verfiCode.Code, 20, BasePage.CurrenContract.ServicePhone); AccountCombineService.SaveVerfiCode(verfiCode); return(true); }
private void Update() { var address = ChinaPay.B3B.TransactionWeb.PublicClass.AddressShow.GetAddressBaseInfo(hfldAddressCode.Value); if (address == null || string.IsNullOrEmpty(address.CountyCode)) { throw new ArgumentNullException("请选择所地"); } string strCompanyId = Request.QueryString["CompanyId"]; string strAccountType = Request.QueryString["AccountType"]; if (!string.IsNullOrEmpty(strCompanyId) && !string.IsNullOrEmpty(strAccountType)) { AccountBaseType accountType = (AccountBaseType)byte.Parse(strAccountType); Guid id = Guid.Parse(strCompanyId); if (accountType == AccountBaseType.Individual) { AccountCombineService.UpdateIndividualInfo(GetIndividualInfo(address)); } else { AccountCombineService.UpdateEnterpriseInfo(GetEnterpriseInfo(address)); } } }
private void AddAccount() { var address = ChinaPay.B3B.TransactionWeb.PublicClass.AddressShow.GetAddressBaseInfo(hfldAddressCode.Value); if (CurrentCompany.CompanyType == CompanyType.Platform) { if (person.Checked) { AccountCombineService.Establish(GetAccountInfo(), GetAccountIndividual(address), DomainName, CurrenContract.ServicePhone, PlatformName); } else { AccountCombineService.Establish(GetAccountInfo(), GetAccountEnterprise(address), DomainName, CurrenContract.ServicePhone, PlatformName); } } else { ValidateCode(); if (person.Checked) { AccountCombineService.Spread(CurrentCompany.CompanyId, GetAccountInfo(), GetAccountIndividual(address), DomainName, CurrenContract.ServicePhone, PlatformName); } else { AccountCombineService.Spread(CurrentCompany.CompanyId, GetAccountInfo(), GetAccountEnterprise(address), DomainName, CurrenContract.ServicePhone, PlatformName); } } }
private void RegisterAccount() { if (person.Checked) { AccountCombineService.Register(GetAccountInfo(), GetIndividual(), BasePage.DomainName, BasePage.CurrenContract.ServicePhone, BasePage.PlatformName); } else { AccountCombineService.Register(GetAccountInfo(), GetEnterprise(), BasePage.DomainName, BasePage.CurrenContract.ServicePhone, BasePage.PlatformName); } }
protected void btnNext_Click(object sender, EventArgs e) { EmployeeDetailInfo info = EmployeeService.QueryEmployee(txtAccountNo.Value); if (info == null) { txtAccountNoTip.InnerHtml = "账号无效,不存在该账户"; txtReAccountNoTip.InnerHtml = ""; txtCodeTip.InnerHtml = ""; return; } if (Session["lostCode"] == null) { txtAccountNoTip.InnerHtml = ""; txtReAccountNoTip.InnerHtml = ""; txtCodeTip.InnerHtml = "验证码已过期"; return; } if (txtCode.Value.ToUpper() != Session["lostCode"].ToString().ToUpper()) { txtAccountNoTip.InnerHtml = ""; txtReAccountNoTip.InnerHtml = ""; txtCodeTip.InnerHtml = "验证码不正确"; BasePage.RegisterScript(this, "window.onload = function(){loadValidateCode(); };"); return; } IPAddress ip = IPAddressLocator.GetRequestIP(HttpContext.Current.Request); if (!AccountCombineService.ValidateIP(ip.ToString())) { txtAccountNoTip.InnerHtml = ""; txtReAccountNoTip.InnerHtml = ""; txtCodeTip.InnerHtml = "同一个IP一天只有3次获取验证码的机会"; return; } var verfiCode = new VerfiCode() { CellPhone = info.Cellphone, Code = ChinaPay.Utility.VerifyCodeUtility.CreateVerifyCode(6), IP = ip.ToString(), Type = Common.Enums.VerfiCodeType.Register, AccountNo = txtAccountNo.Value }; Session["phoneValidateCode"] = verfiCode.Code; Session["phone"] = verfiCode.CellPhone; Session["accountno"] = verfiCode.AccountNo; Session["phoneTime"] = DateTime.Now; ChinaPay.SMS.Service.SMSSendService.SendB3bTrade(verfiCode.CellPhone, verfiCode.Code, 20, BasePage.CurrenContract.ServicePhone); AccountCombineService.SaveVerfiCode(verfiCode); SendSMSTime(); BasePage.RegisterScript(this, "window.location.href='RelostPasswordCode.aspx'"); }
private void Register() { if (rdoIndividual.Checked) { AccountCombineService.AddReciveAccount(this.CurrentCompany.CompanyId, CreatePerson(), CurrentUser.UserName); } else { AccountCombineService.AddReciveAccount(this.CurrentCompany.CompanyId, CreateCompany(), CurrentUser.UserName); } }
private void RegisterAccount() { if (person.Checked) { AccountCombineService.Register(GetAccountInfo(), GetIndividual()); } else { AccountCombineService.Register(GetAccountInfo(), GetEnterprise()); } }
/// <summary> /// 注册个人账户的收款账号 /// </summary> /// <param name="info">个人账户信息</param> public void AddPersonAccount(AccountDTO info) { try { AccountCombineService.AddReciveAccount(this.CurrentCompany.CompanyId, info, CurrentUser.UserName); } catch (System.Data.Common.DbException) { throw new ChinaPay.Core.CustomException("注册失败"); } }
private void SpreadAccount(EmployeeDetailInfo employeeDetailInfo, string spreadAccount) { if (person.Checked) { AccountCombineService.Spread(employeeDetailInfo.Owner, GetAccountInfo(), GetAccountIndividual(spreadAccount), BasePage.DomainName, BasePage.CurrenContract.ServicePhone, BasePage.PlatformName); } else { AccountCombineService.Spread(employeeDetailInfo.Owner, GetAccountInfo(), GetAccountEnterprise(spreadAccount), BasePage.DomainName, BasePage.CurrenContract.ServicePhone, BasePage.PlatformName); } }
public static bool VerificationIP() { bool IsVerfication = true; IPAddress ip = IPAddressLocator.GetRequestIP(HttpContext.Current.Request); if (!AccountCombineService.ValidateIP(ip.ToString())) { IsVerfication = false; throw new IndexOutOfRangeException("同一个IP一天只能申请3个账号"); } return(IsVerfication); }
/// <summary> /// 补填个人用户信息 /// </summary> public bool AddPurchaseIndividualInfo(PurchaseIndividualInfo info) { try { AccountCombineService.AddPurchaseInfo(this.CurrentCompany.CompanyId, info, this.CurrentUser.UserName); return(true); } catch (Exception) { return(false); } }
private bool valiate() { if (!Regex.IsMatch(txtPosRate.Text.Trim(), "^(0\\.[5-9]\\d?|[1-2]\\.\\d{1,2}|3\\.0{1,2}|[1-3])$")) { lblWarnRateInfo.Text = "Pos费率格式错误!"; return(false); } if (!string.IsNullOrWhiteSpace(txtContactCertNo.Text.Trim()) && !AccountCombineService.ValidateIdentifyCard(txtContactCertNo.Text.Trim())) { lblWarnCertNoInfo.Text = "联系人身份证号格式错误!"; return(false); } return(true); }
private void AddAccount() { var address = ChinaPay.B3B.TransactionWeb.PublicClass.AddressShow.GetAddressBaseInfo(hfldAddressCode.Value); string type = Request.QueryString["Type"]; if (!string.IsNullOrEmpty(type) && type == "Subordinate") { AccountCombineService.CreateSubordinate(CurrentCompany.CompanyId, GetAccountInfo(), GetAccountEnterprise(address), DomainName, CurrenContract.ServicePhone, PlatformName); } else { if (company.Checked) { AccountCombineService.CreatePurchase(CurrentCompany.CompanyId, GetAccountInfo(), GetAccountEnterprise(address), DomainName, CurrenContract.ServicePhone, PlatformName); } else { AccountCombineService.CreatePurchase(CurrentCompany.CompanyId, GetAccountInfo(), GetAccountIndividual(address), DomainName, CurrenContract.ServicePhone, PlatformName); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (valiateCompnayInfo()) { try { if (this.CurrentCompany.AccountType == AccountBaseType.Individual) { AccountCombineService.AddPurchaseInfo(this.CurrentCompany.CompanyId, getIndividualInfo(), this.CurrentUser.UserName); } else { AccountCombineService.AddPurchaseInfo(this.CurrentCompany.CompanyId, getEnterpriseInfo(), this.CurrentUser.UserName); } ShowMessage("修改成功"); } catch (Exception ex) { ShowExceptionMessage(ex, "保存公司信息"); } } }
private void queryCompanys(Pagination pagination) { try { var companys = AccountCombineService.GetNeedAuditCompanies(getCondition(), pagination); this.datalist.DataSource = companys.Select(item => new { Account = item.UserNo, CompanyName = item.AbbreviateName, AccountType = item.CompanyType.GetDescription() + "(" + item.AccountType.GetDescription() + ")", CompanyTypeValue = (byte)item.CompanyType, AccountTypeValue = (byte)item.AccountType, Time = item.ApplyTime, Id = item.CompanyId, AuditType = item.AuditType, AuditTypeValue = item.AuditType == "普通审核"?0:1, SourceType = item.SpreadId == Guid.Empty ? item.SourceType : "<a href='../CompanyInfoManage/LookUpCompanyInfo.aspx?CompanyId=" + item.SpreadId.ToString() + "'>" + item.SourceType + "</a>", }); datalist.DataBind(); if (companys.Any()) { pager.Visible = true; if (pagination.GetRowCount) { pager.RowCount = pagination.RowCount; } } else { pager.Visible = false; } } catch (Exception ex) { ShowExceptionMessage(ex, "查询"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var company = CompanyService.GetCompanySettingsInfo(CurrentCompany.CompanyId); if (company != null && company.Parameter.CanHaveSubordinate) { neibuTh.Visible = true; neibufanyong.Visible = true; } else { neibuTh.Visible = false; neibufanyong.Visible = false; } SettingPolicy setting = CompanyService.GetPolicySetting(this.CurrentCompany.CompanyId); if (setting == null) { RegisterScript("alert('还未有任何政策设置信息,不能访问本页面!');window.location.href='/Index.aspx';", true); return; } if (setting.Airlines == "") { RegisterScript("alert('还没有设置航空公司,请先设置航空公司!');window.location.href='/Index.aspx';", true); return; } this.txtDepartureAirports.InitData(true, ChinaPay.B3B.Service.FoundationService.Airports.Where(item => setting.Departure.Split('/').Contains(item.Code.Value))); this.txtArrivalAirports.InitData(true, ChinaPay.B3B.Service.FoundationService.Airports.Where(item => setting.Departure.Split('/').Contains(item.Code.Value))); IEnumerable <OfficeNumber> list = null; var empowermentOffice = CompanyService.GetWorkingSetting(this.CurrentCompany.CompanyId) != null && CompanyService.GetWorkingSetting(this.CurrentCompany.CompanyId).IsImpower; if (empowermentOffice) { list = AccountCombineService.GetOfficeNoByEmployee(this.CurrentUser.Id); } else { list = from item in AccountCombineService.GetOfficeNumbers(this.CurrentCompany.CompanyId) select new OfficeNumber { Impower = false, Company = item.Company, Number = item.Number, Enabled = item.Enabled, Id = item.Id }; } if (list != null) { dropOffice.DataSource = list; dropOffice.DataTextField = "Number"; dropOffice.DataValueField = "Impower"; dropOffice.DataBind(); } //selEndorseRegulation.DataSource = SystemDictionaryService.Query(SystemDictionaryType.EndorseRegulation); //selEndorseRegulation.DataTextField = "Name"; //selEndorseRegulation.DataValueField = "Name"; //selEndorseRegulation.DataBind(); //selInvalidRegulation.DataSource = SystemDictionaryService.Query(SystemDictionaryType.InvalidRegulation); //selInvalidRegulation.DataTextField = "Name"; //selInvalidRegulation.DataValueField = "Name"; //selInvalidRegulation.DataBind(); //selRefundRegulation.DataSource = SystemDictionaryService.Query(SystemDictionaryType.RefundRegulation); //selRefundRegulation.DataTextField = "Name"; //selRefundRegulation.DataValueField = "Name"; //selRefundRegulation.DataBind(); //selChangeRegulation.DataSource = SystemDictionaryService.Query(SystemDictionaryType.ChangeRegulation); //selChangeRegulation.DataTextField = "Name"; //selChangeRegulation.DataValueField = "Name"; //selChangeRegulation.DataBind(); if (Request.QueryString["Id"] != null && Request.QueryString["Type"] != null) { RoundTripPolicy roundTrip = PolicyManageService.GetRoundTripPolicy(Guid.Parse(Request.QueryString["Id"])); if (Request.QueryString["Type"].Trim() == "Update") { tip.InnerText = "修改往返政策"; lblAirline.Visible = true; ddlAirline.Visible = false; chkAuto.Visible = false; btnCopy.Visible = false; btnModify.Visible = true; } if (Request.QueryString["Type"].Trim() == "Copy") { tip.InnerText = "复制往返政策"; lblAirline.Visible = false; ddlAirline.Visible = true; chkAuto.Visible = true; btnCopy.Visible = true; btnModify.Visible = false; string[] strIds = setting.Airlines.Split('/'); ddlAirline.DataSource = from item in ChinaPay.B3B.Service.FoundationService.Airlines where item.Valid && strIds.Contains(item.Code.Value) select new { item.Code, Name = item.Code + "-" + item.ShortName }; ddlAirline.DataTextField = "Name"; ddlAirline.DataValueField = "Code"; ddlAirline.DataBind(); } InitDataValue(roundTrip); } } }
private void BindUpgradeInfo(Guid companyId) { var companyUpgrade = CompanyUpgradeService.QueryCompanyUpgrade(companyId); var companyDetailInfo = CompanyService.GetCompanyDetail(companyId); var companyDocument = AccountCombineService.QueryCompanyDocument(companyId); this.lblUpgradeType.Visible = true; this.lblCong.Visible = true; this.lblChange.Visible = true; BindCommenContent(companyDetailInfo); this.lblCompanyType.Style.Add(HtmlTextWriterStyle.Color, "blue"); this.lblUpgradeType.Style.Add(HtmlTextWriterStyle.Color, "blue"); if (companyUpgrade.AccountType == AccountBaseType.Individual) { this.hfdAccountType.Value = "individual"; this.txtFixedPhone.Text = companyDetailInfo.OfficePhones; this.lblUpgradeType.Text = CompanyType.Supplier.GetDescription() + "(" + AccountBaseType.Individual.GetDescription() + ")"; this.lblCompanyInfo.Visible = false; this.lblContactInfo.Visible = false; lblType.Text = "身份证"; this.lblTrueName.Text = companyDetailInfo.CompanyName; this.lblCertNo.Text = companyDetailInfo.CertNo; if (companyDocument != null) { if (companyDocument.CertLicense != null && companyDocument.CertLicense.Length > 0) { this.certNoOrBussness.Visible = false; this.iataAccess.Visible = false; this.bussnessTime.Visible = false; this.hfdBussnessValid.Value = "false"; } } else { this.hfdValid.Value = "false"; } } else { this.hfdAccountType.Value = "enterprise"; this.fixedPhoneTitle.Visible = false; this.fixedPhoneValue.Visible = false; this.lblIndividual.Visible = false; if (companyDocument != null) { if (companyDocument.BussinessLicense != null) { this.certNoOrBussness.Visible = false; this.hfdBussnessValid.Value = "false"; this.access.Visible = true; } if (companyDocument.IATALicense != null) { this.iataAccess.Visible = false; this.access.Visible = false; this.hfdValid.Value = "false"; } } else { if (companyUpgrade.Type == CompanyType.Supplier) { this.hfdValid.Value = "false"; this.hfdBussnessValid.Value = "false"; } } if (companyUpgrade.Type == CompanyType.Provider) { this.bussnessTime.Visible = false; this.lblUpgradeType.Text = CompanyType.Provider.GetDescription() + "(" + AccountBaseType.Enterprise.GetDescription() + ")"; } else { this.lblUpgradeType.Text = CompanyType.Supplier.GetDescription() + "(" + AccountBaseType.Enterprise.GetDescription() + ")"; } txtManagerName.Text = string.IsNullOrWhiteSpace(companyUpgrade.ManagerName) ? companyDetailInfo.ManagerName : companyUpgrade.ManagerName; txtManagerPhone.Text = string.IsNullOrWhiteSpace(companyUpgrade.ManagerPhone) ? companyDetailInfo.ManagerCellphone : companyUpgrade.ManagerPhone; txtEmergencyContact.Text = string.IsNullOrWhiteSpace(companyUpgrade.EmergencyName) ? companyDetailInfo.EmergencyContact : companyUpgrade.EmergencyName; txtEmergencyCall.Text = string.IsNullOrWhiteSpace(companyUpgrade.EmergencyPhone) ? companyDetailInfo.EmergencyCall : companyUpgrade.EmergencyPhone; lblAbbreviation.Text = string.IsNullOrWhiteSpace(companyUpgrade.AbbreviateName) ? companyDetailInfo.AbbreviateName : companyUpgrade.AbbreviateName; lblCompanyPhone.Text = string.IsNullOrWhiteSpace(companyUpgrade.OfficePhones) ? companyDetailInfo.OfficePhones : companyUpgrade.OfficePhones; lblIdCode.Text = string.IsNullOrWhiteSpace(companyUpgrade.OrginationCode) ? companyDetailInfo.OrginationCode : companyUpgrade.OrginationCode; } }