private void BtnSignIn_Click(object sender, RoutedEventArgs e) { string email = TboxEmail.Text; string pass = TboxPass.Password; if (TboxEmail.Text.Trim() == "" || TboxPass.Password.Trim() == "") { email = ""; pass = ""; return; } LoggedInEmp = (ProfileQueries.FetchEmployee(email, pass)); if (LoggedInEmp != null) { StkAuth.Visibility = Visibility.Hidden; email = ""; pass = ""; TblEmpInfo.Text = LoggedInEmp.Profile.Email; BtnEmpSignOut.Visibility = Visibility.Visible; } else { MessageBox.Show("Email or Password is not correct!"); pass = ""; } }
/// <summary> /// Gets the profile by user identifier. /// </summary> /// <param name="userId">The user identifier.</param> /// <returns></returns> /// <exception cref="ApplicationException">Repository GetProfileByUserid</exception> /// <exception cref="ArgumentOutOfRangeException">userId</exception> public IProfile GetProfileByUserId(int userId) { try { using ( var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS)) { var aRecord = ProfileQueries.getProfilebyUserId(dbContext, userId); return(aRecord); } } catch (Exception e) { throw new ApplicationException("Repository GetProfileByUserid", e); } }