void AccountMembersManage_Leave(object sender, ModuleModeEventArgs e)
        {
            MusicianMember member = new MusicianMember(core, (Musician)Owner, core.Functions.RequestLong("id", 0));

            if (member.Musician.Id != Owner.Id)
            {
                return;
            }

            if (member.Id == LoggedInMember.Id)
            {
            }
        }
        void AccountMemberProfile_Save(object sender, EventArgs e)
        {
            AuthoriseRequestSid();

            MusicianMember member = new MusicianMember(core, (Musician)Owner, LoggedInMember);

            member.StageName = core.Http.Form["stage-name"];
            member.Biography = core.Http.Form["biography"];

            member.Update(typeof(MusicianMember));

            SetRedirectUri(BuildUri());
            core.Display.ShowMessage("Profile Updated", "Your musician member profile has been updated.");
        }
        void AccountMemberProfile_Show(object sender, EventArgs e)
        {
            SetTemplate("account_member_profile");

            MusicianMember member = null;

            /* */
            TextBox stageNameTextBox = new TextBox("stage-name");
            stageNameTextBox.MaxLength = 63;

            /* */
            TextBox biographyTextBox = new TextBox("biography");
            biographyTextBox.IsFormatted = true;
            biographyTextBox.Lines = 7;

            try
            {
                member = new MusicianMember(core, (Musician)Owner, LoggedInMember);

                stageNameTextBox.Value = member.StageName;
                biographyTextBox.Value = member.Biography;
            }
            catch (InvalidMusicianMemberException)
            {
                return;
            }

            template.Parse("S_STAGENAME", stageNameTextBox);
            template.Parse("S_BIOGRAPHY", biographyTextBox);

            Save(new EventHandler(AccountMemberProfile_Save));
        }
Esempio n. 4
0
        public static void Show(object sender, ShowMPageEventArgs e)
        {
            e.Template.SetTemplate("Musician", "viewmusician_member");

            MusicianMember member = null;

            try
            {
                member = new MusicianMember(e.Core, (Musician)e.Page.Owner, e.Slug, UserLoadOptions.All);
            }
            catch (InvalidMusicianMemberException)
            {
                e.Core.Functions.Generate404();
                return;
            }

            List<Instrument> instruments = member.GetInstruments();

            foreach (Instrument instrument in instruments)
            {
                VariableCollection instrumentVariableCollection = e.Template.CreateChild("instrument_list");

                instrumentVariableCollection.Parse("NAME", instrument.Name);
            }

            e.Core.Display.ParseBbcode("BIOGRAPHY", member.Biography);
        }
Esempio n. 5
0
        public static MusicianMember Create(Core core, Musician musician, User member)
        {
            if (core == null)
            {
                throw new NullCoreException();
            }

            InsertQuery iQuery = new InsertQuery(typeof(MusicianMember));
            iQuery.AddField("user_id", member.Id);
            iQuery.AddField("musician_id", musician.Id);
            iQuery.AddField("member_date_ut", UnixTime.UnixTimeStamp());
            iQuery.AddField("member_lead", false);
            iQuery.AddField("member_instruments", 0);
            iQuery.AddField("member_stage_name", string.Empty);
            iQuery.AddField("member_biography", string.Empty);

            core.Db.Query(iQuery);

            MusicianMember newMember = new MusicianMember(core, musician, member);

            return newMember;
        }