/// <summary> /// Handles the UniGrid's OnAction event. /// </summary> /// <param name="actionName">Name of item (button) that throws event</param> /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param> protected void uniGrid_OnAction(string actionName, object actionArgument) { if (actionName == "edit") { SelectedItemID = Convert.ToInt32(actionArgument); RaiseOnEdit(); } else if (actionName == "delete") { if (!AllowEdit) { return; } if (GroupId > 0) { CMSGroupPage.CheckGroupPermissions(GroupId, PERMISSION_MANAGE); } // Delete PollAnswerInfo object from database PollAnswerInfoProvider.DeletePollAnswerInfo(Convert.ToInt32(actionArgument)); ReloadData(true); } else if (actionName == "moveup") { if (!AllowEdit) { return; } if (GroupId > 0) { CMSGroupPage.CheckGroupPermissions(GroupId, PERMISSION_MANAGE); } // Move the answer up in order PollAnswerInfoProvider.MoveAnswerUp(PollId, Convert.ToInt32(actionArgument)); ReloadData(true); } else if (actionName == "movedown") { if (!AllowEdit) { return; } if (GroupId > 0) { CMSGroupPage.CheckGroupPermissions(GroupId, PERMISSION_MANAGE); } // Move the answer down in order PollAnswerInfoProvider.MoveAnswerDown(PollId, Convert.ToInt32(actionArgument)); ReloadData(true); } }
/// <summary> /// Handles the UniGrid's OnAction event. /// </summary> /// <param name="actionName">Name of item (button) that throws event</param> /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param> protected void uniGrid_OnAction(string actionName, object actionArgument) { if (actionName == "edit") { this.SelectedItemID = Convert.ToInt32(actionArgument); this.RaiseOnEdit(); } else if (actionName == "delete") { if (!CheckModifyPermission()) { return; } // Delete PollAnswerInfo object from database PollAnswerInfoProvider.DeletePollAnswerInfo(Convert.ToInt32(actionArgument)); this.ReloadData(true); } else if (actionName == "moveup") { if (!CheckModifyPermission()) { return; } // Move the answer up in order PollAnswerInfoProvider.MoveAnswerUp(this.PollId, Convert.ToInt32(actionArgument)); this.ReloadData(true); } else if (actionName == "movedown") { if (!CheckModifyPermission()) { return; } // Move the answer down in order PollAnswerInfoProvider.MoveAnswerDown(this.PollId, Convert.ToInt32(actionArgument)); this.ReloadData(true); } }