Example #1
0
        // todo: Login metodu yeni projeye gore kodlanacak

        /*
         * public static SessionLoginResult Login(string userRegNum, string userPasswordClear, bool isWindowsAuthentication, IUserService userService, IBshCasAuthService bshCasAuthService, ICustomAppUserService customAppUserService, IBshCasProfileService bshCasProfileService, IDepartmentService departmentService)
         */

        public static SessionLoginResult Login(string userName, string userPasswordClear,
                                               IMemberService memberService, IProfileDetailService profileDetailService,
                                               IProfileMemberService profileMemberService)
        {
            var existMember = memberService.GetByUserNameAndPassword(userName, userPasswordClear);

            if (existMember == null)
            {
                return(new SessionLoginResult(false, "Member not found."));
            }

            SessionUser currentUser = new SessionUser();

            currentUser.ID            = existMember.Id;
            currentUser.TC            = existMember.TC;
            currentUser.Name          = existMember.Name;
            currentUser.LastName      = existMember.LastName;
            currentUser.Phone         = existMember.Phone;
            currentUser.ImageFilePath = existMember.ImageFilePath;

            currentUser.AuthList = profileDetailService.GetAllAuthByCurrentUser(currentUser.ID);

            currentUser.ProfileList = profileMemberService.GetAllProfileByCurrentUser(currentUser.ID);

            CurrentUser = currentUser;

            return(new SessionLoginResult(true, null));
        }
Example #2
0
 public UserController(IMemberService memberService, IProfileDetailService profileDetailService, IProfileMemberService profileMemberService)
 {
     _memberService        = memberService;
     _profileDetailService = profileDetailService;
     _profileMemberService = profileMemberService;
 }
Example #3
0
 public ProfileMemberController(IProfileMemberService profileMemberService, IProfileService profileService)
 {
     _profileMemberService = profileMemberService;
     _profileService       = profileService;
 }