/// <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.ToLower() == "edit") { int transID = ValidationHelper.GetInteger(actionArgument, 0); if (transID != 0) { TransformationInfo ti = TransformationInfoProvider.GetTransformation(transID); if (ti != null) { if (ti.TransformationIsHierarchical) { string isManager = IsSiteManager ? "&sitemanager=true" : String.Empty; URLHelper.Redirect(ResolveUrl("~/CMSModules/DocumentTypes/Pages/Development/HierarchicalTransformations_Frameset.aspx?transid=" + transID + "&classid=" + this.ClassID.ToString() + "&tabmode=1" + isManager)); } else { URLHelper.Redirect(this.EditPageUrl + "?transformationid=" + transID.ToString() + "&classid=" + this.ClassID.ToString() + "&hash=" + QueryHelper.GetHash("?transformationid=" + transID + "&classid=" + ClassID)); } } } } else if (actionName.ToLower() == "delete") { int transformationId = ValidationHelper.GetInteger(actionArgument, -1); if (transformationId > 0) { TransformationInfoProvider.DeleteTransformation(transformationId); } } }
/// <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.ToLowerCSafe() == "edit") { int transID = ValidationHelper.GetInteger(actionArgument, 0); if (transID != 0) { var ti = TransformationInfoProvider.GetTransformation(transID); if (ti != null) { var url = EditPageUrl; var query = String.Format( "objectid={0}&parentobjectid={1}&displaytitle=false&hash={2}{3}", transID, ClassID, QueryHelper.GetHash("?objectid=" + transID + "&parentobjectid=" + ClassID), (ModuleID > 0 ? "&moduleid=" + ModuleID : String.Empty) ); url = URLHelper.AppendQuery(url, query); URLHelper.Redirect(url); } } } else if (actionName.ToLowerCSafe() == "delete") { int transformationId = ValidationHelper.GetInteger(actionArgument, -1); if (transformationId > 0) { TransformationInfoProvider.DeleteTransformation(transformationId); } } }