public IList <User> GetAllUserBasicInfo() { IList <User> users = new List <User>(); DataTable userTable = manager.GetAllUserBasicInfo(); foreach (DataRow row in userTable.Rows) { DateTime dt1 = DateTime.Now; User user = new User(); user.UserId = Convert.ToInt32(row["UserId"]); user.UserName = row["UserName"] == null ? "" : row["UserName"].ToString(); user.EmpName = row["EmployeeName"] == null ? "" : row["EmployeeName"].ToString(); user.Password = row["Password"] == null ? "" : row["Password"].ToString(); user.Mobile = row["Mobile"] == null ? "" : row["Mobile"].ToString(); user.EmployeeId = row["EmployeeId"] == null ? "" : row["EmployeeId"].ToString(); if (user.UserId == UserAdminId) { user.IsAdmin = true; } //user.IsAdmin = row["IsAdmin"] == null ? false : (row["IsAdmin"].ToString() == "1" ? true : false); user.IsActive = row["IsActive"] == null ? false : (row["IsActive"].ToString() == "0" ? false : true); IList <int> roleIds = manager.GetAllRolesIdByUserID(user.UserId); users.Add(user); } return(users); }