public JsonResult CheckInvitation(string code) { if (!string.IsNullOrEmpty(code)) { InvitationCode invitationCode = ncBase.CurrentEntities.InvitationCode.Where(o => o.Code == code && o.IsUsed == false) .FirstOrDefault(); if (invitationCode.IsNoNull()) { return(Json(new { exists = 1 })); } return(Json(new { exists = 0 })); } return(Json(new { exists = 0 })); }
public ActionResult SendInvitationCode(int codeId) { string smsContent = "现诚邀{0}注册使用“房产盒子”_免费房产网络营销软件,邀请码:{1} ,访问 http://fcHeZi.com 开通使用。"; InvitationCode invitationCode = ncBase.CurrentEntities.InvitationCode.Where(o => o.CodeId == codeId).FirstOrDefault(); if (invitationCode.IsNoNull() && !string.IsNullOrEmpty(invitationCode.BindTel)) { SendResult sendResult = smsApi.SendSms(invitationCode.BindTel, string.Format(smsContent, invitationCode.Invitee, invitationCode.Code), (Purpose)8, "【房产盒子】"); if (sendResult.Status == Status.Success) { invitationCode.IsSend = true; ncBase.CurrentEntities.SaveChanges(); return(Content("1")); } } return(Content("0")); }