-2

ASP.Net でロジスティクス Web サイトを設計しています。顧客は注文を行うことができ、注文はデータベースに挿入されます。新しい注文がデータベースに挿入されると、新しい注文の従業員に自動的に通知が送信されます。問題は、データベースが変更されたときに次のコードを操作してライブ通知を取得する方法です。

public class FreightOrderList
{

    int customerID = 0;

    public int CustomerID
    {
        get { return customerID; }
        set { customerID = value; }
    }
    string email = string.Empty;



    public FreightOrderList()
    {
        //default Cons
    }

    public FreightOrderList(int _customerID)
    {
        this.customerID = _customerID;

    }

    public DataSet displayOrders()
    {
        string ConString = ConfigurationManager.ConnectionStrings["LGDB"].ToString();
        SqlConnection sqlConnectionObj = new SqlConnection(ConString);
        SqlDataAdapter sqlDataAdapterObj = new SqlDataAdapter();
        DataSet dataSetObj = new DataSet();
        sqlDataAdapterObj.SelectCommand = new SqlCommand();
        sqlDataAdapterObj.SelectCommand.Connection = sqlConnectionObj;
        sqlDataAdapterObj.SelectCommand.CommandText = "customerShipOrderProc";
        sqlDataAdapterObj.SelectCommand.CommandType = CommandType.StoredProcedure;
        sqlConnectionObj.Open();
        sqlDataAdapterObj.SelectCommand.Parameters.AddWithValue("customerID", this.CustomerID);

        sqlDataAdapterObj.Fill(dataSetObj,"customerShipOrder");
        sqlConnectionObj.Close();
        return dataSetObj;
    }

}
4

1 に答える 1