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(); } }
private void AddNewRecord() { AirPorts objData = new AirPorts(); objData.AddNew(); objData.EnName = uiTextBoxEnName.Text; objData.ArName = uiTextBoxArName.Text; objData.AirPortCode = uiTextBoxCode.Text; objData.Save(); }