Inheritance: System.Data.DbContext
コード例 #1
0
ファイル: AspNetRolesDAL.cs プロジェクト: CISC181/VolTeerNET
 public void AddRole(String ApplicationName, String RoleName)
 {
     using (AspNetProviderEntities context = new AspNetProviderEntities())
     {
         var errorCode = context.aspnet_Roles_CreateRole(ApplicationName, RoleName);
     }
 }
コード例 #2
0
ファイル: AspNetRolesDAL.cs プロジェクト: CISC181/VolTeerNET
 public int DeleteRole(String ApplicationName, String RoleName, Boolean bDeleteOnlyIfEmpty)
 {
     int iErrorCode = 0;
     using (AspNetProviderEntities context = new AspNetProviderEntities())
     {
         iErrorCode = context.aspnet_Roles_DeleteRole(ApplicationName, RoleName, bDeleteOnlyIfEmpty);
     }
     return iErrorCode;
 }
コード例 #3
0
ファイル: AspNetRolesDAL.cs プロジェクト: CISC181/VolTeerNET
        public List<aspnet_Roles_DM> ListAspNetRoles()
        {
            List<aspnet_Roles_DM> list = new List<aspnet_Roles_DM>();
            using (AspNetProviderEntities context = new AspNetProviderEntities())
            {
                list = (from result in context.aspnet_Roles
                        select new aspnet_Roles_DM
                        {
                            ApplicationId = result.ApplicationId,
                            Description = result.Description,
                            LoweredRoleName = result.LoweredRoleName,
                            RoleId = result.RoleId,
                            RoleName = result.RoleName
                        }).ToList();
            } // Guaranteed to close the Connection

            return list;
        }
コード例 #4
0
ファイル: AspNetViews.cs プロジェクト: CISC181/VolTeerNET
        public vw_aspnet_MembershipUsers_DM ListUserByEmail(string strEmail)
        {
            vw_aspnet_MembershipUsers_DM list = new vw_aspnet_MembershipUsers_DM();
            try
            {
                using (AspNetProviderEntities context = new AspNetProviderEntities())
                {
                    list = (from result in context.vw_aspnet_MembershipUsers
                            where result.Email == strEmail
                            select new vw_aspnet_MembershipUsers_DM
                            {
                                ApplicationId = result.ApplicationId,
                                Comment = result.Comment,
                                CreateDate = result.CreateDate,
                                Email = result.Email,
                                FailedPasswordAnswerAttemptCount = result.FailedPasswordAnswerAttemptCount,
                                FailedPasswordAnswerAttemptWindowStart = result.FailedPasswordAnswerAttemptWindowStart,
                                FailedPasswordAttemptCount = result.FailedPasswordAttemptCount,
                                FailedPasswordAttemptWindowStart = result.FailedPasswordAttemptWindowStart,
                                IsAnonymous = result.IsAnonymous,
                                IsApproved = result.IsApproved,
                                IsLockedOut = result.IsLockedOut,
                                UserId = result.UserId,
                                UserName = result.UserName,
                                LastActivityDate = result.LastActivityDate,
                                LastLockoutDate = result.LastLockoutDate,
                                LastLoginDate = result.LastLoginDate,
                                LoweredEmail = result.LoweredEmail,
                                LastPasswordChangedDate = result.LastPasswordChangedDate
                            }).FirstOrDefault();
                } // Guaranteed to close the Connection
            }
            catch (Exception ex)
            {
                throw (ex);
            }

            return list;
        }
コード例 #5
0
ファイル: AspNetUsersDAL.cs プロジェクト: CISC181/VolTeerNET
 public List<vw_aspnet_MembershipUsers_DM> vMembershipUsers_In_Role(string RoleName)
 {
     List<vw_aspnet_MembershipUsers_DM> list = new List<vw_aspnet_MembershipUsers_DM>();
     using (AspNetProviderEntities context = new AspNetProviderEntities())
     {
         list = (from memUsers in context.vw_aspnet_MembershipUsers
                 join memUserInRole in context.vw_aspnet_UsersInRoles on memUsers.UserId equals memUserInRole.UserId
                 join memRole in context.vw_aspnet_Roles on memUserInRole.RoleId equals memRole.RoleId
                 where memRole.RoleName == RoleName
                 select new vw_aspnet_MembershipUsers_DM
                 {
                     ApplicationId = memUsers.ApplicationId,
                     Comment = memUsers.Comment,
                     CreateDate = memUsers.CreateDate,
                     Email = memUsers.Email,
                     FailedPasswordAnswerAttemptCount = memUsers.FailedPasswordAnswerAttemptCount,
                     FailedPasswordAnswerAttemptWindowStart = memUsers.FailedPasswordAnswerAttemptWindowStart,
                     FailedPasswordAttemptCount = memUsers.FailedPasswordAttemptCount,
                     FailedPasswordAttemptWindowStart = memUsers.FailedPasswordAttemptWindowStart,
                     IsAnonymous = memUsers.IsAnonymous,
                     IsApproved = memUsers.IsApproved,
                     IsLockedOut = memUsers.IsLockedOut,
                     LastActivityDate = memUsers.LastActivityDate,
                     LastLockoutDate = memUsers.LastLockoutDate,
                     LastLoginDate = memUsers.LastLoginDate,
                     LastPasswordChangedDate = memUsers.LastPasswordChangedDate,
                     LoweredEmail = memUsers.LoweredEmail,
                     MobileAlias = memUsers.MobileAlias,
                     MobilePIN = memUsers.MobilePIN,
                     PasswordAnswer = memUsers.PasswordAnswer,
                     PasswordFormat = memUsers.PasswordFormat,
                     PasswordQuestion = memUsers.PasswordQuestion,
                     UserId = memUsers.UserId,
                     UserName = memUsers.UserName
                 }).ToList();
     } // Guaranteed to close the Connection
     return list;
 }
コード例 #6
0
ファイル: AspNetUsersDAL.cs プロジェクト: CISC181/VolTeerNET
 public List<aspnet_Users> ListAspNetUsers()
 {
     List<aspnet_Users> list = new List<aspnet_Users>();
     using (AspNetProviderEntities context = new AspNetProviderEntities())
     {
         list = (from result in context.aspnet_Users
                 select new aspnet_Users
                 {
                     ApplicationId = result.ApplicationId,
                     aspnet_Applications = result.aspnet_Applications,
                     aspnet_Membership = result.aspnet_Membership,
                     aspnet_PersonalizationPerUser = result.aspnet_PersonalizationPerUser,
                     aspnet_Profile = result.aspnet_Profile,
                     aspnet_Roles = result.aspnet_Roles,
                     IsAnonymous = result.IsAnonymous,
                     LastActivityDate = result.LastActivityDate,
                     LoweredUserName = result.LoweredUserName,
                     MobileAlias = result.MobileAlias,
                     UserId = result.UserId,
                     UserName = result.UserName
                 }).ToList();
     } // Guaranteed to close the Connection
     return list;
 }