protected void uiGridViewClassType_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditClassType") { int id = Convert.ToInt32(e.CommandArgument.ToString()); CurrentClassType = id; DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetClassType(id); if (ds.Tables[0].Rows.Count > 0) { uiTextBoxEnName.Text = ds.Tables[0].Rows[0]["EnName"].ToString(); uiTextBoxArName.Text = ds.Tables[0].Rows[0]["ArName"].ToString(); } uiPanelCurrentClassType.Visible = false; uiPanelCurrent.Visible = true; } else if (e.CommandName == "DeleteClassType") { int id = Convert.ToInt32(e.CommandArgument.ToString()); CurrentClassType = id; DBLayer db = new DBLayer(); db.DeleteClassType(id); uiPanelCurrentClassType.Visible = true; uiPanelCurrent.Visible = false; BindData(); } }