public async Task <JsonResult <dynamic> > CommitEnterpriseCertification(EnterpriseCertification parameter) { bool flag = await _memberService.CommitEnterpriseCertification(parameter); ////验证身份证 //if (!Regex.IsMatch(parameter.EnterpriseLegalIdentityCardNo, @"(^\d{18}$)|(^\d{15}$)")) // return new JsonResult<dynamic> // { // status = false, // Message = "身份证号填写错误" // }; return(new JsonResult <dynamic> { status = flag, Message = flag ? "企业认证成功" : "企业认证失败" }); }
/// <summary> /// 企业资质认证 /// </summary> /// <param name="parameter"></param> /// <returns></returns> public async Task <bool> CommitEnterpriseCertification(EnterpriseCertification parameter) { string sql = "update Members set EnterpriseName=@EnterpriseName ,EnterpriseType=@EnterpriseType ,EnterpriseArea=@EnterpriseArea,EnterpriseLegal=@EnterpriseLegal,EnterpriseLegalIdentityCardNo=@EnterpriseLegalIdentityCardNo," + $"EnterprisePeopleNum=@EnterprisePeopleNum,SocialSecurityCreditCode=@SocialSecurityCreditCode,EnterpriseBusinessLicense=@EnterpriseBusinessLicense,IsAuthentication=1,UserType={(int)UserTypeEnum.QiYe} where MemberID=@MemberID"; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@EnterpriseName", parameter.EnterpriseName), new SqlParameter("@EnterpriseType", parameter.EnterpriseType), new SqlParameter("@EnterpriseArea", parameter.EnterpriseArea), new SqlParameter("@EnterpriseLegal", parameter.EnterpriseLegal), new SqlParameter("@EnterpriseLegalIdentityCardNo", parameter.EnterpriseLegalIdentityCardNo), new SqlParameter("@EnterprisePeopleNum", parameter.EnterprisePeopleNum), new SqlParameter("@SocialSecurityCreditCode", parameter.SocialSecurityCreditCode ?? (object)DBNull.Value), new SqlParameter("@EnterpriseBusinessLicense", parameter.EnterpriseBusinessLicense), new SqlParameter("@MemberID", parameter.MemberID) }; int result = await DbHelper.ExecuteSqlCommandAsync(sql, parameters); return(result > 0); }