/// <summary> /// Get users list /// </summary> /// <returns></returns> public JsonResult GetUsersList() { var model = new List <UserModel>(); AccountDbAccess ADA = new AccountDbAccess(); DataTable dt = ADA.GetUsersList(1); foreach (DataRow row in dt.Rows) { //DateTime? LtLogin = Convert.ToDateTime(row["LastLogin"]); model.Add(new UserModel { UserId = Convert.ToInt32(row["UserID"]), FullName = row["FullName"].ToString(), Email = row["Email"].ToString(), Group = row["Group"].ToString(), Status = Convert.ToBoolean(row["Status"]), LastLogin = row["LastLogin"].ToString() //LastLogin = row["LastLogin"] != DBNull.Value ? Convert.ToDateTime(row["LastLogin"]) : (DateTime?)null }); } return(Json(new { data = model }, JsonRequestBehavior.AllowGet)); }