//private function private bool IsTooOften(string messageID, string appUser) { EW_USER_APPLY_BLL aBLL = new EW_USER_APPLY_BLL(); EW_USER_APPLY apply = aBLL.GetSpecifyUserApply(messageID, appUser); if (apply != null) { DateTime?lastDate = apply.SAMPLE_DATE; if (lastDate != null && lastDate.Value.AddMinutes(10) > DateTime.Now) { return(true); } } else { EW_USER_APPLY model = new EW_USER_APPLY(); model.MESSAGE_ID = messageID; model.APP_USER = appUser; model.APPLY = CHubConstValues.IndN; apply.SAMPLE_DATE = DateTime.Now; aBLL.Add(model); return(false); } apply.SAMPLE_DATE = DateTime.Now; aBLL.update(apply); return(false); }
public ActionResult SaveApplies(List <string> idList, string group) { try { if (idList == null) { idList = new List <string>(); } string appUser = Session[CHubConstValues.SessionUser].ToString(); EW_USER_APPLY_BLL aBLL = new EW_USER_APPLY_BLL(); aBLL.SaveApply(idList, group, appUser); return(Json(new RequestResult(true))); } catch (Exception ex) { LogHelper.WriteLog("SaveApplies", ex); return(Json(new RequestResult(false, ex.Message))); } }