private static UserLite CreateUserLite(TpUser tpUser) { var userType = tpUser.Type == 1 ? UserType.User : UserType.Requester; return(new UserLite { Id = tpUser.UserID, Email = tpUser.Email, UserType = userType, IsActive = tpUser.IsActive, DeleteDate = tpUser.DeleteDate, FirstName = tpUser.FirstName, LastName = tpUser.LastName, Login = tpUser.Login, CompanyId = tpUser.CompanyID }); }
private void CreateUser(string login, bool isActive, DateTime?deletedDate) { var user = new TpUser { Login = login, Email = string.Format("{0}@targetprocess.com", login), FirstName = "FirstName", LastName = "LastName", SecretWord = "abc", Type = 1, IsActive = isActive, DeleteDate = deletedDate }; Context.TpUsers.InsertOnSubmit(user); Context.SubmitChanges(); Context.ProjectMembers.InsertOnSubmit(new ProjectMember { ProjectID = Context.Projects.First().ProjectID, UserID = user.UserID }); Context.SubmitChanges(); }
private static MappingLookup Create(TpUser tpUser) { return(new MappingLookup { Id = tpUser.UserID, Name = tpUser.Login }); }
protected override bool IsUserTypeCorrect(TpUser user) { return(user.Type == 1); }
private static string GetEmployeeNameById(IEnumerable <TpUser> users, string id) { TpUser user = GetUserById(users, id); return(user.LastName + ", " + user.FirstName); }
private bool CheckUserField(string fieldValue, Func <TpUser, string> getUserFieldValueToCompare, TpUser x) { var fieldValueToCompare = getUserFieldValueToCompare(x) ?? string.Empty; return(fieldValueToCompare.ToLower() == fieldValue.ToLower() && x.DeleteDate == null && IsUserTypeCorrect(x)); }
protected virtual bool IsUserTypeCorrect(TpUser user) { return(true); }