protected void uiGridViewAirPorts_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditAirPort") { AirPorts objData = new AirPorts(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxEnName.Text = objData.EnName; uiTextBoxArName.Text = objData.ArName; uiTextBoxCode.Text = objData.AirPortCode; uiPanelViewAirPorts.Visible = false; uiPanelEdit.Visible = true; CurrentAirPort = objData; } else if (e.CommandName == "DeleteAirPort") { AirPorts objData = new AirPorts(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); CurrentAirPort = null; BindData(); } }