using System; using System.Collections.Generic; using Ease.Core.Model; using System.Data; using System.Security.Claims; using Ease.Core.DataAccess; namespace HRM.BO { //public class CurrentUser //{ // public int UserID { get; set; } // public string LoginID { get; set; } // private int? _employeeID; // public int? EmployeeID // { // get // { // if (UserType == EnumUserType.Employee && this._employeeID == null) // { // throw new Exception("Employee-ID cann't be null, Self-service login"); // } // return this._employeeID; // } // set { _employeeID = value; } // } // public string UserName { get; set; } // public int? PayrollTypeID { get; set; } // public DateTime? NextPayProcessDate { get; set; } // public int? TaxParamID {get;set;} // public string Description { get; set; } // public EnumUserType UserType { get; set; } // public CurrentUser() // { // this.PayrollTypeID = 1; // this.EmployeeID = null; // } // public static CurrentUser GetCurrentUser(ClaimsPrincipal principal) // { // if (principal == null || principal.Identity == null || principal.Identity.IsAuthenticated == false) // return null; // CurrentUser oUser = new CurrentUser(); // foreach (Claim item in principal.Claims) // { // if (item.Type == "UserID") // oUser.UserID = Convert.ToInt32(item.Value); // if (item.Type == "UserName") // oUser.UserName = item.Value; // if (item.Type == "LoginID") // oUser.LoginID = item.Value; // if (item.Type == "UserType") // oUser.UserType =(EnumUserType) Convert.ToInt32( item.Value); // if (item.Type == "EmployeeID" && item.Value !="0") // oUser.EmployeeID = Convert.ToInt32(item.Value); // if (item.Type == "PayrollTypeID" && item.Value != "0") // oUser.PayrollTypeID = Convert.ToInt32(item.Value); // if (item.Type == "nextPayProcessDate" && item.Value != "null") // oUser.NextPayProcessDate = Convert.ToDateTime(item.Value); // if (item.Type == "taxParamId" && item.Value != "0") // oUser.TaxParamID = Convert.ToInt32(item.Value); // } // return oUser; // } //} public partial class ErJobUser : BasicBaseObject { public ErJobUser() { } public void Logout() { } public int JobUserID { get; set; } public string Email { get; set; } public string Mobile { get; set; } public string UserName { get; set; } public EnumUserFrom UserFrom { get; set; } public string Password { get; set; } public bool IsActive { get; set; } public DateTime? InActiveDate { get; set; } public string InActiveReason { get; set; } public bool IsCVCompleted { get; set; } } #region IeRjOBUser Service public interface IErJobUserService { List GetAll(); ErJobUser Get(int userid); ErJobUser Get(string email); // void ChangePasswordAdmin(ErJobUser oUser); int Save(ErJobUser oUser); void Delete(int id); ErJobUser CheckEmailMobExist(string email, string mobile); ErJobUser GetByLoginIDAndPassword(string sLoginID, string sPassword); } #endregion }