public HttpResponseBase QueryLogIn() { string jsonStr = string.Empty; LogInLogeQuery logInLogeQuery = new LogInLogeQuery(); try { logInLogeQuery.Start = Convert.ToInt32(Request.Form["start"] ?? "0"); logInLogeQuery.Limit = Convert.ToInt32(Request.Form["limit"] ?? "20"); logInLogeMgr = new LogInLogeMgr(connectionString); int totalCount; List<LogInLogeQuery> querys = logInLogeMgr.QueryList(logInLogeQuery,out totalCount); jsonStr = "{success:true,totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(querys) + "}"; } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); jsonStr = "[]"; } this.Response.Clear(); this.Response.Write(jsonStr); this.Response.End(); return this.Response; }
public List<Model.Query.LogInLogeQuery> QueryList(LogInLogeQuery logInLogeQuery, out int totalCount) { DataTable dt = new DataTable(); tempStr = string.Format("select mu.user_id,mu.user_username,ml.login_id,ml.login_ipfrom,ml.login_createdate,convert(ml.login_createdate,char(100)) as strlogindate from manage_login ml inner join manage_user mu where ml.user_id = mu.user_id order by login_id desc limit {0},{1}", logInLogeQuery.Start, logInLogeQuery.Limit); dt = _accessMySql.getDataTable(tempStr); totalCount = int.Parse(_accessMySql.getDataTable("select count(*) as totalcount from manage_login ml inner join manage_user mu where ml.user_id = mu.user_id").Rows[0][0].ToString()); return _accessMySql.getObjByTable<Model.Query.LogInLogeQuery>(dt); }
public List<Model.Query.LogInLogeQuery> QueryList(LogInLogeQuery logInLogeQuery, out int totalCount) { try { return _logInLogeDao.QueryList(logInLogeQuery, out totalCount); } catch (Exception ex) { throw new Exception("LogInLogeMgr-->QueryList-->" + ex.Message, ex); } }