public void DeleteBlock(object sender, CommandEventArgs e) { int bID = int.Parse(e.CommandArgument.ToString()); BlockCRUD blocks = new BlockCRUD(); bool success = blocks.RemoveBlock(bID); if (success) { Refresh(); } }
public void EditBlock_Click(object sender, EventArgs e) { int id = int.Parse(ViewState["BlockID"].ToString()); TextBox blockName = (TextBox)Page.FindControlRecursive("EditBlockName"); BlockCRUD blocks = new BlockCRUD(); bool success = blocks.EditBlock(id, blockName.Text); if (success) { Refresh(); } }
protected void CreateBlock_Click(object sender, EventArgs e) { //int id = Convert.ToInt32(Request.QueryString["subjectID"]); TextBox name = (TextBox)Page.FindControlRecursive("BlockName"); BlockCRUD blocks = new BlockCRUD(); bool addSuccess = blocks.AddBlocks((int)subjectID, name.Text); if (addSuccess) { blockList.DataBind(); name.Text = string.Empty; updatePanel.Update(); } }