protected void dlInjection_ItemCommand(object source, DataListCommandEventArgs e) { switch (e.CommandName) { case c_Command_MoveUp: SwapOrder(Convert.ToInt32(e.CommandArgument), c_Command_MoveUp); BindData(); break; case c_Command_MoveDown: SwapOrder(Convert.ToInt32(e.CommandArgument), c_Command_MoveDown); BindData(); break; case c_Command_Edit: BindForm(Convert.ToInt32(e.CommandArgument)); ToggleType(); TogglePanels(); break; case c_Command_Insert: ClearForm(); TogglePanels(); break; case c_Command_Delete: InjectionController ctlModule = new InjectionController(); ctlModule.DeleteInjectionContent(Convert.ToInt32(e.CommandArgument)); BindData(); break; default: return; break; } }
protected void cmdDelete_Click(object sender, EventArgs e) { if (Regex.IsMatch(hidInjectionId.Value, "^\\d+$")) { InjectionController ctlModule = new InjectionController(); ctlModule.DeleteInjectionContent(int.Parse(hidInjectionId.Value, System.Globalization.NumberStyles.Integer)); } ClearForm(); TogglePanels(); BindData(); }