/// <summary> /// Delete Judge /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void RadGrid1_DeleteCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { string ID = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ChallengeJudgeId"].ToString(); challengeJudgeComponent = new ChallengeJudgeComponent(new Guid(ID)); JudgesAssignationComponent.deleteListPerChallengeJudgeId(challengeJudgeComponent.ChallengeJudge.ChallengeJudgeId); challengeJudgeComponent.Delete(); this.grdManageJudge.MasterTableView.Rebind(); }
/// <summary> /// Delete and assign solutions to jury /// </summary> /// <param name="challengeJudgeId"></param> /// <param name="checkBoxList"></param> /// <returns></returns> private bool SaveChkControl(Guid challengeJudgeId, CheckBoxList checkBoxList) { if (JudgesAssignationComponent.deleteListPerChallengeJudgeId(challengeJudgeId)) { string result = string.Empty; foreach (ListItem item in checkBoxList.Items) { if (item.Selected) { JudgesAssignationComponent judgesAssignationComponent = new JudgesAssignationComponent(); judgesAssignationComponent.JudgesAssignation.ChallengeJudgeId = challengeJudgeId; judgesAssignationComponent.JudgesAssignation.SolutionId = new Guid(item.Value); judgesAssignationComponent.JudgesAssignation.JudgeAssigantionId = Guid.NewGuid(); judgesAssignationComponent.Save(); } } return(true); } return(false); }