コード例 #1
0
        public static int Insert(UserAccess userAccess)
        {
            using (ObjectConnection objectConnection = new ObjectConnection())
            {
                using (InsertUserAccessCommand objectCommand = new InsertUserAccessCommand(objectConnection))
                {
                    objectCommand.UserId          = userAccess.UserId;
                    objectCommand.UserName        = userAccess.UserName;
                    objectCommand.UserPassword    = userAccess.UserPassword;
                    objectCommand.PermissionToken = userAccess.PermissionToken;
                    objectCommand.PersonId        = userAccess.PersonId;

                    objectConnection.Open();
                    objectCommand.ExecuteNonQuery();

                    return(objectCommand.ReturnValue);
                }
            }
        }
コード例 #2
0
        public static int Insert(Guid?userId, string userName, string userPassword,
                                 int permissionToken, Guid personId)
        {
            using (ObjectConnection objectConnection = new ObjectConnection())
            {
                using (InsertUserAccessCommand objectCommand = new InsertUserAccessCommand(objectConnection))
                {
                    objectCommand.UserId          = userId ?? new Guid();
                    objectCommand.UserName        = userName;
                    objectCommand.UserPassword    = userPassword;
                    objectCommand.PermissionToken = permissionToken;
                    objectCommand.PersonId        = personId;

                    objectConnection.Open();
                    objectCommand.ExecuteNonQuery();

                    return(objectCommand.ReturnValue);
                }
            }
        }