protected void btnDeleteAffil_Click(object sender, EventArgs e) { int iDeleteAffilID; if (int.TryParse(hidDeleteAffilID.Value, out iDeleteAffilID)) { Classes.cPlayerAffiliation PlayerAffil = new Classes.cPlayerAffiliation(iDeleteAffilID, Master.UserName, Master.UserID); PlayerAffil.RecordStatus = Classes.RecordStatuses.Delete; PlayerAffil.Delete(Master.UserName, Master.UserID); lblModalMessage.Text = "Your affiliation has been deleted."; ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModalMessage();", true); } }
protected void btnSaveAffiliation_Click(object sender, EventArgs e) { int iPlayerAffilID; int iPlayerProfileID; if ((int.TryParse(hidPlayerAffilID.Value, out iPlayerAffilID)) && (int.TryParse(hidPlayerProfileID.Value, out iPlayerProfileID))) { Classes.cPlayerAffiliation PlayerAffil = new Classes.cPlayerAffiliation(iPlayerAffilID, Master.UserName, Master.UserID); PlayerAffil.AffiliationName = tbAffiliationName.Text; PlayerAffil.AffiliationRole = tbAffiliationRole.Text; PlayerAffil.PlayerComments = tbAffiliationComments.Text; PlayerAffil.PlayerProfileID = iPlayerProfileID; PlayerAffil.Save(Master.UserName, Master.UserID); } }