/// <summary> /// 未读条数 /// </summary> /// <param name="sId"></param> /// <returns></returns> public static object GetNoticeNum(string userCode) { if (userCode.IsNullOrEmpty()) { throw new MessageException("用户编号为空!"); } var user = UserInfoService.Find(o => o.CompanyId == Sys.SysCommonRules.CompanyId && o.UserCode == userCode); if (user == null) { throw new MessageException("用户不存在!"); } var dt = dal.GetNoticeList(user.UID, true); return(dt.Rows.Count); }
/// <summary> /// 支持手动输入姓名或编号 /// </summary> /// <param name="title">内容</param> /// <returns></returns> static SysUserInfo GetUser(string title) { if (title.IsNullOrEmpty()) { return(null); } var obj = UserInfoService.Find(o => o.FullName == title); if (obj != null) { return(obj); } int code = 0; if (int.TryParse(title, out code)) { obj = UserInfoService.Find(o => o.UserCode == code.ToString()); } return(null); }
/// <summary> /// APP调用 /// </summary> /// <returns></returns> public static object GetNoticeList(string userCode) { if (userCode.IsNullOrEmpty()) { throw new MessageException("用户编号为空!"); } var user = UserInfoService.Find(o => o.CompanyId == Sys.SysCommonRules.CompanyId && o.UserCode == userCode); if (user == null) { throw new MessageException("用户不存在!"); } var dt = dal.GetNoticeList(user.UID, false); if (dt.Rows.Count > 0) { var ids = dt.AsEnumerable().Select(o => (int)o["id"]).ToList(); ReaderService.Add(1, user.UID, ids); } return(dt); }
public static SysUserInfo GetUserInfo(string id) { return(UserInfoService.Find(o => o.UID == id)); }