protected void uiButtonUpdate_Click(object sender, EventArgs e) { if (CurrentAirPort != null) { UpdateRecord(); } else { AddNewRecord(); } uiPanelEdit.Visible = false; uiPanelViewAirPorts.Visible = true; BindData(); Clearfields(); CurrentAirPort = null; }
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(); } }