/// <summary> /// 实名认证提交 /// </summary> /// <param name="user_id"></param> /// <param name="name"></param> /// <param name="cardno"></param> /// <param name="CertificaRecordID"></param> /// <returns></returns> public ActionResult Certification(int User_ID, string name, string cardno, string facecard = "", string frontcard = "") { try { string appid = CheckAPPID(); if (User_ID <= 0) { return(FailNoLogin()); } if (name.IsEmpty()) { throw new Exception("真实姓名不能为空!"); } //dm_certifica_recordEntity dm_Certifica_RecordEntity = new dm_certifica_recordEntity(); dm_basesettingEntity dm_BasesettingEntity = dm_BaseSettingIBLL.GetEntityByCache(appid); dm_certifica_recordEntity dm_Certifica_RecordEntity = dm_CertificaRecordIBLL.GetCertificationRecord(User_ID); if (dm_Certifica_RecordEntity.IsEmpty()) { dm_Certifica_RecordEntity = new dm_certifica_recordEntity(); } else { if (dm_Certifica_RecordEntity.realstatus == 0) { throw new Exception("实名认证信息正在审核中,请勿重复提交!"); } else if (dm_Certifica_RecordEntity.realstatus == 1) { throw new Exception("实名认证信息已审核通过!"); } } #region 身份证正面上传 if (facecard.IsEmpty() || facecard == "System.Web.HttpPostedFileWrapper") { HttpPostedFile facecard_file = System.Web.HttpContext.Current.Request.Files["facecard"]; if (facecard_file.IsEmpty() || facecard_file.ContentLength == 0 || string.IsNullOrEmpty(facecard_file.FileName)) { throw new Exception("请上传身份证正面照片!"); } dm_Certifica_RecordEntity.facecard = OSSHelper.PutObject(dm_BasesettingEntity, "", facecard_file); } else { dm_Certifica_RecordEntity.facecard = facecard; } #endregion #region 身份证反面上传 if (frontcard.IsEmpty() || frontcard == "System.Web.HttpPostedFileWrapper") { HttpPostedFile frontcard_file = System.Web.HttpContext.Current.Request.Files["frontcard"]; if (frontcard_file.IsEmpty() || frontcard_file.ContentLength == 0 || string.IsNullOrEmpty(frontcard_file.FileName)) { throw new Exception("请上传身份证反面照片!"); } dm_Certifica_RecordEntity.frontcard = OSSHelper.PutObject(dm_BasesettingEntity, "", frontcard_file); } else { dm_Certifica_RecordEntity.frontcard = frontcard; } #endregion #region 构造其他信息 dm_Certifica_RecordEntity.user_id = User_ID; dm_Certifica_RecordEntity.realname = name; dm_Certifica_RecordEntity.cardno = cardno; dm_Certifica_RecordEntity.realstatus = 0; dm_Certifica_RecordEntity.appid = appid; #endregion dm_CertificaRecordIBLL.SaveEntity(dm_Certifica_RecordEntity.id, dm_Certifica_RecordEntity); return(Success("提交成功!")); } catch (Exception ex) { return(FailException(ex)); } }