예제 #1
0
파일: AirportBiz.cs 프로젝트: solo123/AGMV
        public void Update(DS_Flight.AirportCodeDataTable airportTable)
        {
            if (airportTable != null && airportTable.Rows.Count > 0)
            {
                for (int i = 0; i < airportTable.Rows.Count; i++)
                {
                    DS_Flight.AirportCodeRow row = airportTable.Rows[i] as DS_Flight.AirportCodeRow;
                    if (row.RowState == DataRowState.Added)
                    {
                        AddAirportCode(row.airportCode, row.name, row.name_cn, row.country);
                    }
                    else if (row.RowState == DataRowState.Modified)
                        UpdateAirportCode(row.airportID, row.airportCode, row.name, row.name_cn, row.country);
                }

            }
        }
예제 #2
0
파일: AirportBiz.cs 프로젝트: solo123/AGMV
        public DS_Flight.AirportCodeDataTable SearchAirport(string airport)
        {
            DS_Flight ds = new DS_Flight();
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT airportID, airportCode, [name], name_cn, country FROM AirportCode");
            if (airport != null && airport.Trim().Length > 0)
            {
                string s = SqlCleanString(airport);
                sb.Append(" WHERE [name] like '");
                sb.Append(s);
                sb.Append("' or name_cn like '");
                sb.Append(s);
                sb.Append("' or airportCode='");
                sb.Append(airport.Trim());
                sb.Append("'");
            }
            sb.Append(" order by airportCode");

            m_dao.FillDataSet(ds, "AirportCode", sb.ToString(), null);
            return ds.AirportCode;
        }