Esempio n. 1
0
        public BaseAirportModels GetBaseAirportList(BaseAirportModels model)
        {
            string errorStr = "";

            string listQuery = " SELECT SEQNO , " + string.Join(",", column_BaseAirport) + " FROM conf_airport WHERE 1=1 ";

            if (!String.IsNullOrEmpty(model.schType))
            {
                listQuery += " AND NATION_CODE = '" + model.schType + "' ";
            }

            listQuery += " ORDER BY SEQNO ";

            DataTable listDt = getQueryResult(listQuery, out errorStr);

            if (listDt != null && listDt.Rows.Count != 0)
            {
                for (int i = 0; i < listDt.Rows.Count; i++)
                {
                    ConfAirpot temp = new ConfAirpot();
                    temp.SEQNO            = int.Parse(listDt.Rows[i]["SEQNO"].ToString().Trim());
                    temp.NATION_CODE      = listDt.Rows[i]["NATION_CODE"].ToString().Trim();
                    temp.AIRPORT_CODE     = listDt.Rows[i]["AIRPORT_CODE"].ToString().Trim();
                    temp.AIRPORT_NAME     = listDt.Rows[i]["AIRPORT_NAME"].ToString().Trim();
                    temp.AIRPORT_LOCATION = listDt.Rows[i]["AIRPORT_LOCATION"].ToString().Trim();
                    model.Items.Add(temp);
                }
            }

            return(model);
        }
Esempio n. 2
0
        public ConfAirpot GetBaseAirportView(int SEQNO)
        {
            string errorStr = "";

            string listQuery = " SELECT SEQNO , " + string.Join(",", column_BaseAirport) + " FROM conf_airport  WHERE SEQNO = " + SEQNO;

            DataTable listDt = getQueryResult(listQuery, out errorStr);

            ConfAirpot model = new ConfAirpot();

            if (listDt != null && listDt.Rows.Count != 0)
            {
                model.SEQNO            = int.Parse(listDt.Rows[0]["SEQNO"].ToString().Trim());
                model.NATION_CODE      = listDt.Rows[0]["NATION_CODE"].ToString().Trim();
                model.AIRPORT_CODE     = listDt.Rows[0]["AIRPORT_CODE"].ToString().Trim();
                model.AIRPORT_NAME     = listDt.Rows[0]["AIRPORT_NAME"].ToString().Trim();
                model.AIRPORT_LOCATION = listDt.Rows[0]["AIRPORT_LOCATION"].ToString().Trim();
            }

            return(model);
        }