/// <summary> /// Deletes web farm server. Called when the "Delete server" button is pressed. /// Expects the CreateWebFarmServer method to be run first. /// </summary> private bool DeleteWebFarmServer() { // Get the web farm server WebFarmServerInfo deleteServer = WebFarmServerInfoProvider.GetWebFarmServerInfo("MyNewServer"); // Delete the web farm server WebFarmServerInfoProvider.DeleteWebFarmServerInfo(deleteServer); return(deleteServer != null); }
/// <summary> /// Handles action event of unigrid. /// </summary> protected void OnAction(string actionName, object actionArgument) { if (actionName == "edit") { URLHelper.Redirect("WebFarm_Server_Edit.aspx?serverid=" + ValidationHelper.GetString(actionArgument, String.Empty)); } else if (actionName == "delete") { // Delete WebFarmServerInfo object from database WebFarmServerInfoProvider.DeleteWebFarmServerInfo(ValidationHelper.GetInteger(actionArgument, 0)); } }
/// <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") { URLHelper.Redirect("WebFarm_Server_Edit.aspx?serverid=" + Convert.ToString(actionArgument)); } else if (actionName == "delete") { // delete WebFarmServerInfo object from database WebFarmServerInfoProvider.DeleteWebFarmServerInfo(Convert.ToInt32(actionArgument)); } }