protected void btnSaveLimit_Click(object sender, EventArgs e) { int iPlayerLimitID; int iPlayerProfileID; if ((int.TryParse(hidPlayerLimitID.Value, out iPlayerLimitID)) && (int.TryParse(hidPlayerProfileID.Value, out iPlayerProfileID))) { Classes.cPlayerLimitation PlayerLimit = new cPlayerLimitation(iPlayerLimitID, _UserName); PlayerLimit.Description = tbLimitation.Text; PlayerLimit.ShareInfo = cbxLimitShareWithStaff.Checked; PlayerLimit.PrintOnCard = cbxLimitPrintOnCard.Checked; DateTime dtTemp; if (DateTime.TryParse(tbLimitationStartDate.Text, out dtTemp)) { PlayerLimit.StartDate = dtTemp; } else { PlayerLimit.EndDate = null; } if (DateTime.TryParse(tbLimitationEndDate.Text, out dtTemp)) { PlayerLimit.EndDate = dtTemp; } else { PlayerLimit.EndDate = null; } PlayerLimit.PlayerProfileID = iPlayerProfileID; PlayerLimit.Save(_UserName, _UserID); } }
protected void btnDeleteLimit_Click(object sender, EventArgs e) { int iDeleteLimitID; if (int.TryParse(hidDeleteLimitID.Value, out iDeleteLimitID)) { cPlayerLimitation PlayerLimit = new cPlayerLimitation(iDeleteLimitID, _UserName); PlayerLimit.RecordStatus = RecordStatuses.Delete; PlayerLimit.Delete(_UserName, _UserID); lblModalMessage.Text = "Your record has been deleted."; ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModalMessage();", true); } }