public List <NoteRecordModle> GetNoteRecordList() { using (var db = new NoteBookContext()) { return(db.NoteRecords.Where(s => s.status != EnumModle.VoucherStatus.结案.ToString()).ToList()); } }
/// <summary> /// 检测登录密码与用户名,使用EF /// </summary> /// <param name="pwd"></param> /// <returns></returns> public bool loginCheck(string userID, string pwd) { using (var db = new NoteBookContext()) { var q = db.Users.Where(s => s.userID == userID & s.pwd == pwd).ToList(); if (q.Count > 0) { foreach (var item in q) { CurrentUser.userID = item.userID; CurrentUser.userName = item.name; } return(true); } else { return(false); } } }