Beispiel #1
0
        public List <AirLines> GetAirLinesCodesAll(string fieldName, string fieldName2, string fieldValue, string connectionName)
        {
            Database  db        = DatabaseFactory.CreateDatabase(connectionName);
            DbCommand dbCommand = db.GetStoredProcCommand(Resources.AirLinesResource.SP_GetAirLinesCodesAll);

            db.AddInParameter(dbCommand, Resources.AirLinesResource.PARAM_QUERY, DbType.String, fieldName);
            db.AddInParameter(dbCommand, Resources.AirLinesResource.PARAM_QUERY2, DbType.String, fieldName2);
            db.AddInParameter(dbCommand, Resources.AirLinesResource.PARAM_VALUE, DbType.String, fieldValue);

            List <AirLines> airlinesList = new List <AirLines>();

            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                int _airlinealfaid = dr.GetOrdinal(Resources.AirLinesResource.PARAM_AIRLINEALFAID);
                int _airlinename   = dr.GetOrdinal(Resources.AirLinesResource.PARAM_AIRLINENAME);
                while (dr.Read())
                {
                    AirLines item = new AirLines();
                    item.AirlineAlfaID = dr.GetString(_airlinealfaid);
                    item.AirlineName   = dr.GetString(_airlinename);
                    airlinesList.Add(item);
                }
            }

            return(airlinesList);
        }
        private void dgvCodesAirLines_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            AirLines        airline         = (AirLines)dgvCodesAirLines.SelectedRows[0].DataBoundItem;
            UpdateEventArgs updateeventargs = new UpdateEventArgs(airline.AirlineAlfaID);

            AirlineUpdate(this, updateeventargs);
            this.Close();
        }
Beispiel #3
0
 private void InitDataBind()
 {
     this.txtStartTime.Text     = DateTime.Today.ToString("yyyy-MM-dd");
     this.txtEndTime.Text       = DateTime.Today.AddMonths(1).ToString("yyyy-MM-dd");
     this.ddlAirLine.DataSource = from item in FoundationService.Airlines
                                  select new
     {
         Text  = item.Code.Value + "-" + item.ShortName,
         Value = item.Code.Value
     };
     this.ddlAirLine.DataTextField  = "Text";
     this.ddlAirLine.DataValueField = "Value";
     this.ddlAirLine.DataBind();
     this.ddlAirLine.Items.Insert(0, new ListItem("-请选择-", ""));
     AirLines.InitData(true, Service.FoundationService.Airports);
     //txtTiedianStart.Text = "08:00";
     //txtTiedianEnd.Text = "18:00";
 }