示例#1
0
        public void Update(DS_Airline.AirlineCodeDataTable airlineTable)
        {
            if (airlineTable != null && airlineTable.Rows.Count > 0)
            {
                for (int i = 0; i < airlineTable.Rows.Count; i++)
                {
                    DS_Airline.AirlineCodeRow row = airlineTable.Rows[i] as DS_Airline.AirlineCodeRow;
                    if (row.RowState == DataRowState.Added)
                    {
                        AddAirlineCode(row.airlineCode, row.name, row.name_cn);
                    }
                    else if (row.RowState == DataRowState.Modified)
                        UpdateAirlineCode(row.airlineID, row.airlineCode, row.name, row.name_cn);
                }

            }
        }
示例#2
0
        public DS_Airline.AirlineCodeDataTable SearchAirline(string airline)
        {
            DS_Airline ds = new DS_Airline();
            StringBuilder sb = new StringBuilder();

            sb.Append("SELECT airlineID, airlineCode, [name], name_cn FROM AirlineCode");
            string al = SqlCleanString(airline);
            if (al != null && al.Length > 0)
            {
                sb.Append(" WHERE [name] like '");
                sb.Append(al);
                sb.Append("' or name_cn like '");
                sb.Append(al);
                sb.Append("' or airlineCode='");
                sb.Append(airline.Trim());
                sb.Append("'");
            }
            sb.Append(" order by airlineCode");

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