UserInfoChangeServices.cs 959 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.ViewModel.UniversityManage.TeacherManage;
  6. using Bowin.Common.Linq;
  7. using EMIS.DataLogic.SystemDAL;
  8. using System.Linq.Expressions;
  9. using EMIS.Entities;
  10. namespace EMIS.CommonLogic.SystemServices
  11. {
  12. public class UserInfoChangeServices: BaseServices, IUserInfoChangeServices
  13. {
  14. public UserInfoChangeDAL UserInfoChangeDAL { get; set; }
  15. public StaffView GetStaffView(Guid? userID)
  16. {
  17. var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
  18. userID = curUser.UserID;
  19. Expression<Func<CF_Staff, bool>> exp = x => true;
  20. if (userID.HasValue && userID != Guid.Empty)
  21. {
  22. exp = exp.And(x => x.UserID == userID);
  23. }
  24. var query = UserInfoChangeDAL.GetStaffViewQueryable(exp);
  25. return query.FirstOrDefault();
  26. }
  27. }
  28. }