⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tdsflight.cs

📁 航空公司用的简单管理系统
💻 CS
字号:
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data.Common;
using System.ComponentModel;
using System;

namespace SouthernAir.Business.TypeDataSet {

    [DataObject]
    partial class tdsFlight
    { 
        [DataObjectMethod(DataObjectMethodType.Select, true)]
        public static BSAFlightDataTable GetResult(string strObjectAddress, string strYear, string strMonth, string strDay,
            string strPrice)
        {
            string strDate = strYear + "-" + strMonth + "-" + strDay;
            string strConn = "Data Source=192.168.210.203;Initial Catalog=TRTESTDB;Persist Security Info=True;User ID=test001;Password=test001-";
            string strSQL = "";
            if (strPrice == "无要求")
            {
                strSQL = "Select * From BSAFlight Where ObjectAddress = '" + strObjectAddress + "' and FlightDate = '" + strDate + "'";
            }
            else if (strPrice == "800以内")
            {
                strSQL = "Select * From BSAFlight Where ObjectAddress = '" + strObjectAddress + "' and FlightDate = '" + strDate + "' and CPrice <= 800";
            }
            else if (strPrice == "1000以内")
            {
                strSQL = "Select * From BSAFlight Where ObjectAddress = '" + strObjectAddress + "' and FlightDate = '" + strDate + "' and CPrice <= 1000";
            }
            else if (strPrice == "1200以内")
            {
                strSQL = "Select * From BSAFlight Where ObjectAddress = '" + strObjectAddress + "' and FlightDate = '" + strDate + "' and CPrice <= 1200";
            }
            else if (strPrice == "1500以内")
            {
                strSQL = "Select * From BSAFlight Where ObjectAddress = '" + strObjectAddress + "' and FlightDate = '" + strDate + "' and CPrice <= 1500";
            }
            else 
            {
                strSQL = "Select * From BSAFlight";
            }
            using (SqlConnection conn = new SqlConnection(strConn))
            {
                conn.Open();
                SqlDataAdapter da = new SqlDataAdapter(strSQL, conn);
                DataSet ds = new DataSet();
                da.Fill(ds, "Result");
                BSAFlightDataTable oDataTable = new BSAFlightDataTable();
                oDataTable.Merge(ds.Tables["Result"]);
                return oDataTable;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -