SQL:
CREATE
TABLE
[
訂貨明細
]
(
[ 訂單號碼 ] [ int ] NOT NULL ,
[ 產品編號 ] [ int ] NOT NULL ,
[ 單價 ] [ money ] NOT NULL CONSTRAINT [ DF__訂貨明細__單價__00AA174D ] DEFAULT ( 0 ),
[ 數量 ] [ smallint ] NOT NULL CONSTRAINT [ DF__訂貨明細__數量__019E3B86 ] DEFAULT ( 1 ),
[ 折扣 ] [ real ] NOT NULL CONSTRAINT [ DF__訂貨明細__折扣__02925FBF ] DEFAULT ( 0 ),
[ upsize_ts ] [ timestamp ] NULL ,
CONSTRAINT [ PK_訂貨明細 ] PRIMARY KEY CLUSTERED
(
[ 訂單號碼 ] ,
[ 產品編號 ]
) ON [ PRIMARY ] ,
CONSTRAINT [ 訂貨明細_FK00 ] FOREIGN KEY
(
[ 訂單號碼 ]
) REFERENCES [ 訂貨主檔 ] (
[ 訂單號碼 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ 訂貨明細_FK01 ] FOREIGN KEY
(
[ 產品編號 ]
) REFERENCES [ 產品資料 ] (
[ 產品編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ CK 訂貨明細 折扣 ] CHECK ( [ 折扣 ] >= 0 and [ 折扣 ] <= 1 ),
CONSTRAINT [ CK 訂貨明細 單價 ] CHECK ( [ 單價 ] >= 0 ),
CONSTRAINT [ CK 訂貨明細 數量 ] CHECK ( [ 數量 ] > 0 )
) ON [ PRIMARY ]
GO
CREATE TABLE [ 訂貨主檔 ] (
[ 訂單號碼 ] [ int ] IDENTITY ( 1 , 1 ) NOT NULL ,
[ 客戶編號 ] [ nvarchar ] ( 5 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 員工編號 ] [ int ] NULL CONSTRAINT [ DF__訂貨主檔__員工編號__79FD19BE ] DEFAULT ( 0 ),
[ 訂單日期 ] [ datetime ] NULL ,
[ 要貨日期 ] [ datetime ] NULL ,
[ 送貨日期 ] [ datetime ] NULL ,
[ 送貨方式 ] [ int ] NULL CONSTRAINT [ DF__訂貨主檔__送貨方式__7AF13DF7 ] DEFAULT ( 0 ),
[ 運費 ] [ money ] NULL CONSTRAINT [ DF__訂貨主檔__運費__7BE56230 ] DEFAULT ( 0 ),
[ 收貨人 ] [ nvarchar ] ( 40 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 送貨地址 ] [ nvarchar ] ( 60 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 送貨城市 ] [ nvarchar ] ( 15 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 送貨行政區 ] [ nvarchar ] ( 15 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 送貨郵遞區號 ] [ nvarchar ] ( 10 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 送貨國家地區 ] [ nvarchar ] ( 15 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
CONSTRAINT [ PK_訂貨主檔 ] PRIMARY KEY CLUSTERED
(
[ 訂單號碼 ]
) ON [ PRIMARY ] ,
CONSTRAINT [ 訂貨主檔_FK00 ] FOREIGN KEY
(
[ 客戶編號 ]
) REFERENCES [ 客戶 ] (
[ 客戶編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ 訂貨主檔_FK01 ] FOREIGN KEY
(
[ 送貨方式 ]
) REFERENCES [ 貨運公司 ] (
[ 貨運公司編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ 訂貨主檔_FK02 ] FOREIGN KEY
(
[ 員工編號 ]
) REFERENCES [ 員工 ] (
[ 員工編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE
) ON [ PRIMARY ]
GO
CREATE TABLE [ 產品資料 ] (
[ 產品編號 ] [ int ] IDENTITY ( 1 , 1 ) NOT NULL ,
[ 產品 ] [ nvarchar ] ( 40 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NOT NULL ,
[ 供應商編號 ] [ int ] NULL CONSTRAINT [ DF__產品資料__供應商編號__5D60DB10 ] DEFAULT ( 0 ),
[ 類別編號 ] [ int ] NULL ,
[ 單位數量 ] [ nvarchar ] ( 20 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 單價 ] [ money ] NULL CONSTRAINT [ DF__產品資料__單價__5E54FF49 ] DEFAULT ( 0 ),
[ 庫存量 ] [ smallint ] NULL CONSTRAINT [ DF__產品資料__庫存量__5F492382 ] DEFAULT ( 0 ),
[ 已訂購量 ] [ smallint ] NULL CONSTRAINT [ DF__產品資料__已訂購量__603D47BB ] DEFAULT ( 0 ),
[ 安全存量 ] [ smallint ] NULL CONSTRAINT [ DF__產品資料__安全存量__61316BF4 ] DEFAULT ( 0 ),
[ 不再銷售 ] [ bit ] NOT NULL CONSTRAINT [ DF__產品資料__不再銷售__6225902D ] DEFAULT ( 0 ),
CONSTRAINT [ Pk_產品資料 ] PRIMARY KEY CLUSTERED
(
[ 產品編號 ]
) ON [ PRIMARY ] ,
CONSTRAINT [ 產品資料_FK00 ] FOREIGN KEY
(
[ 類別編號 ]
) REFERENCES [ 產品類別 ] (
[ 類別編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ 產品資料_FK01 ] FOREIGN KEY
(
[ 供應商編號 ]
) REFERENCES [ 供應商 ] (
[ 供應商編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ CK 產品資料 已訂購量 ] CHECK ( [ 已訂購量 ] >= 0 ),
CONSTRAINT [ CK 產品資料 安全存量 ] CHECK ( [ 安全存量 ] >= 0 ),
CONSTRAINT [ CK 產品資料 庫存量 ] CHECK ( [ 庫存量 ] >= 0 ),
CONSTRAINT [ CK 產品資料 單價 ] CHECK ( [ 單價 ] >= 0 )
) ON [ PRIMARY ]
GO
[ 訂單號碼 ] [ int ] NOT NULL ,
[ 產品編號 ] [ int ] NOT NULL ,
[ 單價 ] [ money ] NOT NULL CONSTRAINT [ DF__訂貨明細__單價__00AA174D ] DEFAULT ( 0 ),
[ 數量 ] [ smallint ] NOT NULL CONSTRAINT [ DF__訂貨明細__數量__019E3B86 ] DEFAULT ( 1 ),
[ 折扣 ] [ real ] NOT NULL CONSTRAINT [ DF__訂貨明細__折扣__02925FBF ] DEFAULT ( 0 ),
[ upsize_ts ] [ timestamp ] NULL ,
CONSTRAINT [ PK_訂貨明細 ] PRIMARY KEY CLUSTERED
(
[ 訂單號碼 ] ,
[ 產品編號 ]
) ON [ PRIMARY ] ,
CONSTRAINT [ 訂貨明細_FK00 ] FOREIGN KEY
(
[ 訂單號碼 ]
) REFERENCES [ 訂貨主檔 ] (
[ 訂單號碼 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ 訂貨明細_FK01 ] FOREIGN KEY
(
[ 產品編號 ]
) REFERENCES [ 產品資料 ] (
[ 產品編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ CK 訂貨明細 折扣 ] CHECK ( [ 折扣 ] >= 0 and [ 折扣 ] <= 1 ),
CONSTRAINT [ CK 訂貨明細 單價 ] CHECK ( [ 單價 ] >= 0 ),
CONSTRAINT [ CK 訂貨明細 數量 ] CHECK ( [ 數量 ] > 0 )
) ON [ PRIMARY ]
GO
CREATE TABLE [ 訂貨主檔 ] (
[ 訂單號碼 ] [ int ] IDENTITY ( 1 , 1 ) NOT NULL ,
[ 客戶編號 ] [ nvarchar ] ( 5 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 員工編號 ] [ int ] NULL CONSTRAINT [ DF__訂貨主檔__員工編號__79FD19BE ] DEFAULT ( 0 ),
[ 訂單日期 ] [ datetime ] NULL ,
[ 要貨日期 ] [ datetime ] NULL ,
[ 送貨日期 ] [ datetime ] NULL ,
[ 送貨方式 ] [ int ] NULL CONSTRAINT [ DF__訂貨主檔__送貨方式__7AF13DF7 ] DEFAULT ( 0 ),
[ 運費 ] [ money ] NULL CONSTRAINT [ DF__訂貨主檔__運費__7BE56230 ] DEFAULT ( 0 ),
[ 收貨人 ] [ nvarchar ] ( 40 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 送貨地址 ] [ nvarchar ] ( 60 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 送貨城市 ] [ nvarchar ] ( 15 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 送貨行政區 ] [ nvarchar ] ( 15 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 送貨郵遞區號 ] [ nvarchar ] ( 10 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 送貨國家地區 ] [ nvarchar ] ( 15 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
CONSTRAINT [ PK_訂貨主檔 ] PRIMARY KEY CLUSTERED
(
[ 訂單號碼 ]
) ON [ PRIMARY ] ,
CONSTRAINT [ 訂貨主檔_FK00 ] FOREIGN KEY
(
[ 客戶編號 ]
) REFERENCES [ 客戶 ] (
[ 客戶編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ 訂貨主檔_FK01 ] FOREIGN KEY
(
[ 送貨方式 ]
) REFERENCES [ 貨運公司 ] (
[ 貨運公司編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ 訂貨主檔_FK02 ] FOREIGN KEY
(
[ 員工編號 ]
) REFERENCES [ 員工 ] (
[ 員工編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE
) ON [ PRIMARY ]
GO
CREATE TABLE [ 產品資料 ] (
[ 產品編號 ] [ int ] IDENTITY ( 1 , 1 ) NOT NULL ,
[ 產品 ] [ nvarchar ] ( 40 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NOT NULL ,
[ 供應商編號 ] [ int ] NULL CONSTRAINT [ DF__產品資料__供應商編號__5D60DB10 ] DEFAULT ( 0 ),
[ 類別編號 ] [ int ] NULL ,
[ 單位數量 ] [ nvarchar ] ( 20 ) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
[ 單價 ] [ money ] NULL CONSTRAINT [ DF__產品資料__單價__5E54FF49 ] DEFAULT ( 0 ),
[ 庫存量 ] [ smallint ] NULL CONSTRAINT [ DF__產品資料__庫存量__5F492382 ] DEFAULT ( 0 ),
[ 已訂購量 ] [ smallint ] NULL CONSTRAINT [ DF__產品資料__已訂購量__603D47BB ] DEFAULT ( 0 ),
[ 安全存量 ] [ smallint ] NULL CONSTRAINT [ DF__產品資料__安全存量__61316BF4 ] DEFAULT ( 0 ),
[ 不再銷售 ] [ bit ] NOT NULL CONSTRAINT [ DF__產品資料__不再銷售__6225902D ] DEFAULT ( 0 ),
CONSTRAINT [ Pk_產品資料 ] PRIMARY KEY CLUSTERED
(
[ 產品編號 ]
) ON [ PRIMARY ] ,
CONSTRAINT [ 產品資料_FK00 ] FOREIGN KEY
(
[ 類別編號 ]
) REFERENCES [ 產品類別 ] (
[ 類別編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ 產品資料_FK01 ] FOREIGN KEY
(
[ 供應商編號 ]
) REFERENCES [ 供應商 ] (
[ 供應商編號 ]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [ CK 產品資料 已訂購量 ] CHECK ( [ 已訂購量 ] >= 0 ),
CONSTRAINT [ CK 產品資料 安全存量 ] CHECK ( [ 安全存量 ] >= 0 ),
CONSTRAINT [ CK 產品資料 庫存量 ] CHECK ( [ 庫存量 ] >= 0 ),
CONSTRAINT [ CK 產品資料 單價 ] CHECK ( [ 單價 ] >= 0 )
) ON [ PRIMARY ]
GO
运行界面:
cs代码:
using
System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Globalization;
namespace ch1
... {
public partial class BindingDemoForm15 : Form
...{
// 資料集物件的類別層級建立
DataSet ds = new DataSet();
// 關聯性連結物件的類別層級宣告
DataRelation rel;
// CurrencyManager 物件的類別層級宣告
BindingManagerBase bmCustomers;
BindingManagerBase bmOrders;
public BindingDemoForm15()
...{
InitializeComponent();
}
private void BindingDemoForm15_Load(object sender, System.EventArgs e)
...{
// 設定表單的最小大小
this.MinimumSize = new Size(680, 536);
// 建立一個連接字串
string strConnection = "Server=(local);Database=ch1;uid=sa;pwd=";
// 建立一個查詢命令字串
string strSql = "SELECT 客戶編號, 公司名稱, 連絡人, 電話 FROM 客戶 WHERE 客戶編號 IN (SELECT DISTINCT 客戶編號 FROM 訂貨主檔)";
// 建立一個資料連接
SqlConnection myConnection = new SqlConnection(strConnection);
// 建立一個資料配接器以便針對資料來源執行 SELECT 陳述式來提取出要填入資料集的資料記錄
SqlDataAdapter myAD = new SqlDataAdapter(strSql, myConnection);
// 將資料填入資料集
myAD.Fill(ds, "客戶");
// 重新指定用來提取資料來源之資料記錄的 SELECT 陳述式
myAD.SelectCommand.CommandText = "SELECT 訂貨主檔.客戶編號, 訂貨主檔.訂單號碼, 訂貨主檔.訂單日期, " + "訂貨明細.產品編號, 產品資料.產品, 訂貨明細.單價, 訂貨明細.數量, 訂貨明細.折扣, " + "(訂貨明細.單價 * 訂貨明細.數量 * (1 - 訂貨明細.折扣)) AS 訂貨金額 " + "FROM 訂貨主檔 " + "INNER JOIN 訂貨明細 " + "ON 訂貨主檔.訂單號碼 = 訂貨明細.訂單號碼 " + "INNER JOIN 產品資料 " + "ON 訂貨明細.產品編號 = 產品資料.產品編號 " + "ORDER BY 訂貨主檔.客戶編號";
// 將資料填入資料集內名稱為「訂單明細金額」的資料表
myAD.Fill(ds, "訂單明細金額");
// 宣告用來將資料集內之「客戶」資料表連結至「訂單明細金額」資料表的父欄位與子欄位
DataColumn ParentColumn;
DataColumn ChildColumn;
ParentColumn = ds.Tables["客戶"].Columns["客戶編號"];
ChildColumn = ds.Tables["訂單明細金額"].Columns["客戶編號"];
// 建立用來連結「客戶」資料表與「訂單明細金額」資料表的 DataRelation 物件,其名稱為「每一位客戶的訂單」。
rel = new DataRelation("每一位客戶的訂單", ParentColumn, ChildColumn);
ds.Relations.Add(rel);
// 將 TextBox 控制項繫結至父資料表(亦即「客戶」資料表)的各個欄位
TextBoxCustomerID.DataBindings.Add("Text", ds, "客戶.客戶編號");
TextBoxCompanyName.DataBindings.Add("Text", ds, "客戶.公司名稱");
TextBoxContact.DataBindings.Add("Text", ds, "客戶.連絡人");
TextBoxPhone.DataBindings.Add("Text", ds, "客戶.電話");
// 將 TextBox 控制項繫結至 DataRelation 物件(亦即「每一位客戶的訂單」)的各個欄位
TextBoxOrderID.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.訂單號碼");
TextBoxProductID.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.產品編號");
TextBoxProductName.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.產品");
TextBoxPrice.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.單價");
TextBoxQuantity.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.數量");
TextBoxDiscount.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.折扣");
// 將 DateTimePicker 控制項繫結至 DataRelation 物件(亦即「每一位客戶的訂單」)的「訂單日期」欄位
DateTimePickerOrderDate.DataBindings.Add("Value", ds, "客戶.每一位客戶的訂單.訂單日期");
// 建立一個新的 Binding 物件並替它加入 Parse 與 Format 事件的委派,
// 然後將此 Binding 物件加至名稱為 TextBoxAmount 之 TextBox 控制項的 BindingsCollection 中。
// 您務必在將 Binding 物件加至集合中之前就先加入事件委派,否則,除非資料來源
// 之 BindingManagerBase 的目前物件改變,將不會有任何格式化發生。
Binding myBindingObject = new Binding("Text", ds, "客戶.每一位客戶的訂單.訂貨金額");
myBindingObject.Format += DecimalToCurrencyString;
myBindingObject.Parse += CurrencyStringToDecimal;
TextBoxAmount.DataBindings.Add(myBindingObject);
// 取得代表「客戶」資料表的 CurrencyManager 物件
bmCustomers = this.BindingContext[ds, "客戶"];
// 設定當引發 bmCustomers 的 PositionChanged 事件時便執行事件處理常式「客戶_PositionChanged」
bmCustomers.PositionChanged += 客戶_PositionChanged;
// 取得代表 DataRelation 物件(亦即「每一位客戶的訂單」)的 CurrencyManager 物件
bmOrders = this.BindingContext[ds, "客戶.每一位客戶的訂單"];
// 設定當引發 bmOrders 的 PositionChanged 事件時便執行事件處理常式「訂單_PositionChanged」
bmOrders.PositionChanged += 訂單_PositionChanged;
// 設定資料記錄目前位置訊息的初值
TextBoxCustomerPosition.Text = string.Format("客戶記錄:目前位置 {0} 總數 {1}", bmCustomers.Position + 1, bmCustomers.Count);
TextBoxOrderPosition.Text = string.Format("訂單記錄:目前位置 {0} 總數 {1}", bmOrders.Position + 1, bmOrders.Count);
myConnection.Close();
}
// 此方法是 Format 事件的事件處理常式。每當控制項顯示一個新的數值,該數值便會由其原生型別
// 被轉換成一個貨幣格式的字串。ToString 方法使用格式化字元 "c" 將該數值轉換成一個貨幣格式的字串。
private void DecimalToCurrencyString(object sender, ConvertEventArgs cevent)
...{
// 使用 DesiredType 來檢測是否能轉換成 String 型別
if ((!object.ReferenceEquals(cevent.DesiredType, typeof(string))))
...{
return; // TODO: might not be correct. Was : Exit Sub
}
// 使用 ToString 方法將數值轉換成貨幣格式的字串
cevent.Value = Convert.ToDecimal(cevent.Value).ToString("c");
}
// 此方法是 Parse 事件的事件處理常式。每當所顯示的數值改變時,Parse 事件就會被引發。
// 在此主要是將貨幣格式的字串轉換回 Decimal 型別。
private void CurrencyStringToDecimal(object sender, ConvertEventArgs cevent)
...{
// 使用 DesiredType 來檢測是否能轉換成 Decimal 型別
if ((!object.ReferenceEquals(cevent.DesiredType, typeof(decimal))))
...{
return; // TODO: might not be correct. Was : Exit Sub
}
// 將貨幣格式的字串轉換回 Decimal 型別
//cevent.Value = decimal.Parse(cevent.Value.ToString, NumberStyles.Currency, null);
cevent.Value = decimal.Parse(cevent.Value.ToString(), NumberStyles.Currency, null);
}
protected void 客戶_PositionChanged(object sender, System.EventArgs e)
...{
TextBoxCustomerPosition.Text = string.Format("客戶記錄:目前位置 {0} 總數 {1}", bmCustomers.Position + 1, bmCustomers.Count);
TextBoxOrderPosition.Text = string.Format("訂單記錄:目前位置 {0} 總數 {1}", bmOrders.Position + 1, bmOrders.Count);
}
protected void 訂單_PositionChanged(object sender, System.EventArgs e)
...{
TextBoxOrderPosition.Text = string.Format("訂單記錄:目前位置 {0} 總數 {1}", bmOrders.Position + 1, bmOrders.Count);
}
// 按下導覽父資料表的「第一筆」按鈕
private void btnFirst_Click(object sender, System.EventArgs e)
...{
// 將 Position 屬性設定成 0
bmCustomers.Position = 0;
}
// 按下導覽父資料表的「上一筆」按鈕
private void btnBack_Click(object sender, System.EventArgs e)
...{
if (bmCustomers.Position > 0)
...{
// 將 Position 屬性遞減 1
bmCustomers.Position -= 1;
}
}
// 按下導覽父資料表的「下一筆」按鈕
private void btnNext_Click(object sender, System.EventArgs e)
...{
if (bmCustomers.Position < bmCustomers.Count - 1)
...{
// 將 Position 屬性遞增 1
bmCustomers.Position += 1;
}
}
// 按下導覽父資料表的「最後一筆」按鈕
private void btnEnd_Click(object sender, System.EventArgs e)
...{
bmCustomers.Position = bmCustomers.Count - 1;
}
// 按下導覽 DataRelation 物件的「第一筆」按鈕
private void btnChildFirst_Click(object sender, System.EventArgs e)
...{
bmOrders.Position = 0;
}
// 按下導覽 DataRelation 物件的「上一筆」按鈕
private void btnChildBack_Click(object sender, System.EventArgs e)
...{
if (bmOrders.Position > 0)
...{
bmOrders.Position -= 1;
}
}
// 按下導覽 DataRelation 物件的「下一筆」按鈕
private void btnChildNext_Click(object sender, System.EventArgs e)
...{
if (bmOrders.Position < bmOrders.Count - 1)
...{
bmOrders.Position += 1;
}
}
// 按下導覽 DataRelation 物件的「最後一筆」按鈕
private void btnChildEnd_Click(object sender, System.EventArgs e)
...{
bmOrders.Position = bmOrders.Count - 1;
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Globalization;
namespace ch1
... {
public partial class BindingDemoForm15 : Form
...{
// 資料集物件的類別層級建立
DataSet ds = new DataSet();
// 關聯性連結物件的類別層級宣告
DataRelation rel;
// CurrencyManager 物件的類別層級宣告
BindingManagerBase bmCustomers;
BindingManagerBase bmOrders;
public BindingDemoForm15()
...{
InitializeComponent();
}
private void BindingDemoForm15_Load(object sender, System.EventArgs e)
...{
// 設定表單的最小大小
this.MinimumSize = new Size(680, 536);
// 建立一個連接字串
string strConnection = "Server=(local);Database=ch1;uid=sa;pwd=";
// 建立一個查詢命令字串
string strSql = "SELECT 客戶編號, 公司名稱, 連絡人, 電話 FROM 客戶 WHERE 客戶編號 IN (SELECT DISTINCT 客戶編號 FROM 訂貨主檔)";
// 建立一個資料連接
SqlConnection myConnection = new SqlConnection(strConnection);
// 建立一個資料配接器以便針對資料來源執行 SELECT 陳述式來提取出要填入資料集的資料記錄
SqlDataAdapter myAD = new SqlDataAdapter(strSql, myConnection);
// 將資料填入資料集
myAD.Fill(ds, "客戶");
// 重新指定用來提取資料來源之資料記錄的 SELECT 陳述式
myAD.SelectCommand.CommandText = "SELECT 訂貨主檔.客戶編號, 訂貨主檔.訂單號碼, 訂貨主檔.訂單日期, " + "訂貨明細.產品編號, 產品資料.產品, 訂貨明細.單價, 訂貨明細.數量, 訂貨明細.折扣, " + "(訂貨明細.單價 * 訂貨明細.數量 * (1 - 訂貨明細.折扣)) AS 訂貨金額 " + "FROM 訂貨主檔 " + "INNER JOIN 訂貨明細 " + "ON 訂貨主檔.訂單號碼 = 訂貨明細.訂單號碼 " + "INNER JOIN 產品資料 " + "ON 訂貨明細.產品編號 = 產品資料.產品編號 " + "ORDER BY 訂貨主檔.客戶編號";
// 將資料填入資料集內名稱為「訂單明細金額」的資料表
myAD.Fill(ds, "訂單明細金額");
// 宣告用來將資料集內之「客戶」資料表連結至「訂單明細金額」資料表的父欄位與子欄位
DataColumn ParentColumn;
DataColumn ChildColumn;
ParentColumn = ds.Tables["客戶"].Columns["客戶編號"];
ChildColumn = ds.Tables["訂單明細金額"].Columns["客戶編號"];
// 建立用來連結「客戶」資料表與「訂單明細金額」資料表的 DataRelation 物件,其名稱為「每一位客戶的訂單」。
rel = new DataRelation("每一位客戶的訂單", ParentColumn, ChildColumn);
ds.Relations.Add(rel);
// 將 TextBox 控制項繫結至父資料表(亦即「客戶」資料表)的各個欄位
TextBoxCustomerID.DataBindings.Add("Text", ds, "客戶.客戶編號");
TextBoxCompanyName.DataBindings.Add("Text", ds, "客戶.公司名稱");
TextBoxContact.DataBindings.Add("Text", ds, "客戶.連絡人");
TextBoxPhone.DataBindings.Add("Text", ds, "客戶.電話");
// 將 TextBox 控制項繫結至 DataRelation 物件(亦即「每一位客戶的訂單」)的各個欄位
TextBoxOrderID.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.訂單號碼");
TextBoxProductID.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.產品編號");
TextBoxProductName.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.產品");
TextBoxPrice.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.單價");
TextBoxQuantity.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.數量");
TextBoxDiscount.DataBindings.Add("Text", ds, "客戶.每一位客戶的訂單.折扣");
// 將 DateTimePicker 控制項繫結至 DataRelation 物件(亦即「每一位客戶的訂單」)的「訂單日期」欄位
DateTimePickerOrderDate.DataBindings.Add("Value", ds, "客戶.每一位客戶的訂單.訂單日期");
// 建立一個新的 Binding 物件並替它加入 Parse 與 Format 事件的委派,
// 然後將此 Binding 物件加至名稱為 TextBoxAmount 之 TextBox 控制項的 BindingsCollection 中。
// 您務必在將 Binding 物件加至集合中之前就先加入事件委派,否則,除非資料來源
// 之 BindingManagerBase 的目前物件改變,將不會有任何格式化發生。
Binding myBindingObject = new Binding("Text", ds, "客戶.每一位客戶的訂單.訂貨金額");
myBindingObject.Format += DecimalToCurrencyString;
myBindingObject.Parse += CurrencyStringToDecimal;
TextBoxAmount.DataBindings.Add(myBindingObject);
// 取得代表「客戶」資料表的 CurrencyManager 物件
bmCustomers = this.BindingContext[ds, "客戶"];
// 設定當引發 bmCustomers 的 PositionChanged 事件時便執行事件處理常式「客戶_PositionChanged」
bmCustomers.PositionChanged += 客戶_PositionChanged;
// 取得代表 DataRelation 物件(亦即「每一位客戶的訂單」)的 CurrencyManager 物件
bmOrders = this.BindingContext[ds, "客戶.每一位客戶的訂單"];
// 設定當引發 bmOrders 的 PositionChanged 事件時便執行事件處理常式「訂單_PositionChanged」
bmOrders.PositionChanged += 訂單_PositionChanged;
// 設定資料記錄目前位置訊息的初值
TextBoxCustomerPosition.Text = string.Format("客戶記錄:目前位置 {0} 總數 {1}", bmCustomers.Position + 1, bmCustomers.Count);
TextBoxOrderPosition.Text = string.Format("訂單記錄:目前位置 {0} 總數 {1}", bmOrders.Position + 1, bmOrders.Count);
myConnection.Close();
}
// 此方法是 Format 事件的事件處理常式。每當控制項顯示一個新的數值,該數值便會由其原生型別
// 被轉換成一個貨幣格式的字串。ToString 方法使用格式化字元 "c" 將該數值轉換成一個貨幣格式的字串。
private void DecimalToCurrencyString(object sender, ConvertEventArgs cevent)
...{
// 使用 DesiredType 來檢測是否能轉換成 String 型別
if ((!object.ReferenceEquals(cevent.DesiredType, typeof(string))))
...{
return; // TODO: might not be correct. Was : Exit Sub
}
// 使用 ToString 方法將數值轉換成貨幣格式的字串
cevent.Value = Convert.ToDecimal(cevent.Value).ToString("c");
}
// 此方法是 Parse 事件的事件處理常式。每當所顯示的數值改變時,Parse 事件就會被引發。
// 在此主要是將貨幣格式的字串轉換回 Decimal 型別。
private void CurrencyStringToDecimal(object sender, ConvertEventArgs cevent)
...{
// 使用 DesiredType 來檢測是否能轉換成 Decimal 型別
if ((!object.ReferenceEquals(cevent.DesiredType, typeof(decimal))))
...{
return; // TODO: might not be correct. Was : Exit Sub
}
// 將貨幣格式的字串轉換回 Decimal 型別
//cevent.Value = decimal.Parse(cevent.Value.ToString, NumberStyles.Currency, null);
cevent.Value = decimal.Parse(cevent.Value.ToString(), NumberStyles.Currency, null);
}
protected void 客戶_PositionChanged(object sender, System.EventArgs e)
...{
TextBoxCustomerPosition.Text = string.Format("客戶記錄:目前位置 {0} 總數 {1}", bmCustomers.Position + 1, bmCustomers.Count);
TextBoxOrderPosition.Text = string.Format("訂單記錄:目前位置 {0} 總數 {1}", bmOrders.Position + 1, bmOrders.Count);
}
protected void 訂單_PositionChanged(object sender, System.EventArgs e)
...{
TextBoxOrderPosition.Text = string.Format("訂單記錄:目前位置 {0} 總數 {1}", bmOrders.Position + 1, bmOrders.Count);
}
// 按下導覽父資料表的「第一筆」按鈕
private void btnFirst_Click(object sender, System.EventArgs e)
...{
// 將 Position 屬性設定成 0
bmCustomers.Position = 0;
}
// 按下導覽父資料表的「上一筆」按鈕
private void btnBack_Click(object sender, System.EventArgs e)
...{
if (bmCustomers.Position > 0)
...{
// 將 Position 屬性遞減 1
bmCustomers.Position -= 1;
}
}
// 按下導覽父資料表的「下一筆」按鈕
private void btnNext_Click(object sender, System.EventArgs e)
...{
if (bmCustomers.Position < bmCustomers.Count - 1)
...{
// 將 Position 屬性遞增 1
bmCustomers.Position += 1;
}
}
// 按下導覽父資料表的「最後一筆」按鈕
private void btnEnd_Click(object sender, System.EventArgs e)
...{
bmCustomers.Position = bmCustomers.Count - 1;
}
// 按下導覽 DataRelation 物件的「第一筆」按鈕
private void btnChildFirst_Click(object sender, System.EventArgs e)
...{
bmOrders.Position = 0;
}
// 按下導覽 DataRelation 物件的「上一筆」按鈕
private void btnChildBack_Click(object sender, System.EventArgs e)
...{
if (bmOrders.Position > 0)
...{
bmOrders.Position -= 1;
}
}
// 按下導覽 DataRelation 物件的「下一筆」按鈕
private void btnChildNext_Click(object sender, System.EventArgs e)
...{
if (bmOrders.Position < bmOrders.Count - 1)
...{
bmOrders.Position += 1;
}
}
// 按下導覽 DataRelation 物件的「最後一筆」按鈕
private void btnChildEnd_Click(object sender, System.EventArgs e)
...{
bmOrders.Position = bmOrders.Count - 1;
}
}
}
窗体代码:
namespace
ch1
... {
partial class BindingDemoForm15
...{
/**//// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/**//// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
...{
if (disposing && (components != null))
...{
components.Dispose();
}
base.Dispose(disposing);
}
Windows 窗体设计器生成的代码#region Windows 窗体设计器生成的代码
/**//// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
...{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BindingDemoForm15));
this.Label3 = new System.Windows.Forms.Label();
this.Label2 = new System.Windows.Forms.Label();
this.Label1 = new System.Windows.Forms.Label();
this.TextBoxDiscount = new System.Windows.Forms.TextBox();
this.lblDiscount = new System.Windows.Forms.Label();
this.TextBoxQuantity = new System.Windows.Forms.TextBox();
this.lblQuantity = new System.Windows.Forms.Label();
this.TextBoxPrice = new System.Windows.Forms.TextBox();
this.lblPrice = new System.Windows.Forms.Label();
this.TextBoxProductName = new System.Windows.Forms.TextBox();
this.lblProductName = new System.Windows.Forms.Label();
this.TextBoxProductID = new System.Windows.Forms.TextBox();
this.lblProductID = new System.Windows.Forms.Label();
this.TextBoxOrderID = new System.Windows.Forms.TextBox();
this.lblOrderID = new System.Windows.Forms.Label();
this.TextBoxOrderPosition = new System.Windows.Forms.TextBox();
this.btnChildEnd = new System.Windows.Forms.Button();
this.btnChildNext = new System.Windows.Forms.Button();
this.btnChildBack = new System.Windows.Forms.Button();
this.btnChildFirst = new System.Windows.Forms.Button();
this.lblAmount = new System.Windows.Forms.Label();
this.lblOrderDate = new System.Windows.Forms.Label();
this.TextBoxAmount = new System.Windows.Forms.TextBox();
this.DateTimePickerOrderDate = new System.Windows.Forms.DateTimePicker();
this.lblPhone = new System.Windows.Forms.Label();
this.TextBoxPhone = new System.Windows.Forms.TextBox();
this.lblContact = new System.Windows.Forms.Label();
this.lblCompany = new System.Windows.Forms.Label();
this.lblCustomerID = new System.Windows.Forms.Label();
this.TextBoxCustomerID = new System.Windows.Forms.TextBox();
this.TextBoxContact = new System.Windows.Forms.TextBox();
this.TextBoxCompanyName = new System.Windows.Forms.TextBox();
this.btnEnd = new System.Windows.Forms.Button();
this.btnNext = new System.Windows.Forms.Button();
this.btnBack = new System.Windows.Forms.Button();
this.btnFirst = new System.Windows.Forms.Button();
this.TextBoxCustomerPosition = new System.Windows.Forms.TextBox();
this.Panel1 = new System.Windows.Forms.Panel();
this.SuspendLayout();
//
// Label3
//
this.Label3.AutoSize = true;
this.Label3.Font = new System.Drawing.Font("PMingLiU", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.Label3.ForeColor = System.Drawing.Color.Maroon;
this.Label3.Location = new System.Drawing.Point(3, 174);
this.Label3.Name = "Label3";
this.Label3.Size = new System.Drawing.Size(72, 16);
this.Label3.TabIndex = 151;
this.Label3.Text = "訂單資料";
//
// Label2
//
this.Label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.Label2.Font = new System.Drawing.Font("PMingLiU", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.Label2.ForeColor = System.Drawing.Color.Maroon;
this.Label2.Location = new System.Drawing.Point(35, 56);
this.Label2.Name = "Label2";
this.Label2.Size = new System.Drawing.Size(30, 79);
this.Label2.TabIndex = 150;
this.Label2.Text = "客戶資料";
//
// Label1
//
this.Label1.AutoSize = true;
this.Label1.Font = new System.Drawing.Font("PMingLiU", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.Label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
this.Label1.Location = new System.Drawing.Point(147, 6);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(312, 32);
this.Label1.TabIndex = 114;
this.Label1.Text = "一對多資料導覽介面";
this.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// TextBoxDiscount
//
this.TextBoxDiscount.ForeColor = System.Drawing.Color.Blue;
this.TextBoxDiscount.Location = new System.Drawing.Point(475, 268);
this.TextBoxDiscount.Name = "TextBoxDiscount";
this.TextBoxDiscount.Size = new System.Drawing.Size(100, 21);
this.TextBoxDiscount.TabIndex = 144;
//
// lblDiscount
//
this.lblDiscount.AutoSize = true;
this.lblDiscount.Location = new System.Drawing.Point(427, 270);
this.lblDiscount.Name = "lblDiscount";
this.lblDiscount.Size = new System.Drawing.Size(35, 12);
this.lblDiscount.TabIndex = 143;
this.lblDiscount.Text = "折扣:";
//
// TextBoxQuantity
//
this.TextBoxQuantity.ForeColor = System.Drawing.Color.Blue;
this.TextBoxQuantity.Location = new System.Drawing.Point(281, 268);
this.TextBoxQuantity.Name = "TextBoxQuantity";
this.TextBoxQuantity.Size = new System.Drawing.Size(100, 21);
this.TextBoxQuantity.TabIndex = 142;
//
// lblQuantity
//
this.lblQuantity.AutoSize = true;
this.lblQuantity.Location = new System.Drawing.Point(233, 270);
this.lblQuantity.Name = "lblQuantity";
this.lblQuantity.Size = new System.Drawing.Size(35, 12);
this.lblQuantity.TabIndex = 141;
this.lblQuantity.Text = "數量:";
//
// TextBoxPrice
//
this.TextBoxPrice.ForeColor = System.Drawing.Color.Blue;
this.TextBoxPrice.Location = new System.Drawing.Point(91, 268);
this.TextBoxPrice.Name = "TextBoxPrice";
this.TextBoxPrice.Size = new System.Drawing.Size(100, 21);
this.TextBoxPrice.TabIndex = 140;
//
// lblPrice
//
this.lblPrice.AutoSize = true;
this.lblPrice.Location = new System.Drawing.Point(43, 270);
this.lblPrice.Name = "lblPrice";
this.lblPrice.Size = new System.Drawing.Size(35, 12);
this.lblPrice.TabIndex = 139;
this.lblPrice.Text = "單價:";
//
// TextBoxProductName
//
this.TextBoxProductName.ForeColor = System.Drawing.Color.Blue;
this.TextBoxProductName.Location = new System.Drawing.Point(281, 236);
this.TextBoxProductName.Name = "TextBoxProductName";
this.TextBoxProductName.Size = new System.Drawing.Size(100, 21);
this.TextBoxProductName.TabIndex = 138;
//
// lblProductName
//
this.lblProductName.AutoSize = true;
this.lblProductName.Location = new System.Drawing.Point(201, 239);
this.lblProductName.Name = "lblProductName";
this.lblProductName.Size = new System.Drawing.Size(59, 12);
this.lblProductName.TabIndex = 137;
this.lblProductName.Text = "產品名稱:";
//
// TextBoxProductID
//
this.TextBoxProductID.ForeColor = System.Drawing.Color.Blue;
this.TextBoxProductID.Location = new System.Drawing.Point(91, 236);
this.TextBoxProductID.Name = "TextBoxProductID";
this.TextBoxProductID.Size = new System.Drawing.Size(100, 21);
this.TextBoxProductID.TabIndex = 136;
//
// lblProductID
//
this.lblProductID.AutoSize = true;
this.lblProductID.Location = new System.Drawing.Point(11, 239);
this.lblProductID.Name = "lblProductID";
this.lblProductID.Size = new System.Drawing.Size(59, 12);
this.lblProductID.TabIndex = 135;
this.lblProductID.Text = "產品編號:";
//
// TextBoxOrderID
//
this.TextBoxOrderID.ForeColor = System.Drawing.Color.Blue;
this.TextBoxOrderID.Location = new System.Drawing.Point(91, 212);
this.TextBoxOrderID.Name = "TextBoxOrderID";
this.TextBoxOrderID.Size = new System.Drawing.Size(100, 21);
this.TextBoxOrderID.TabIndex = 130;
//
// lblOrderID
//
this.lblOrderID.AutoSize = true;
this.lblOrderID.Location = new System.Drawing.Point(11, 214);
this.lblOrderID.Name = "lblOrderID";
this.lblOrderID.Size = new System.Drawing.Size(59, 12);
this.lblOrderID.TabIndex = 129;
this.lblOrderID.Text = "訂單號碼:";
//
// TextBoxOrderPosition
//
this.TextBoxOrderPosition.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.TextBoxOrderPosition.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
this.TextBoxOrderPosition.Location = new System.Drawing.Point(163, 299);
this.TextBoxOrderPosition.Name = "TextBoxOrderPosition";
this.TextBoxOrderPosition.Size = new System.Drawing.Size(290, 21);
this.TextBoxOrderPosition.TabIndex = 145;
this.TextBoxOrderPosition.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// btnChildEnd
//
this.btnChildEnd.BackColor = System.Drawing.Color.White;
this.btnChildEnd.Image = ((System.Drawing.Image)(resources.GetObject("btnChildEnd.Image")));
this.btnChildEnd.Location = new System.Drawing.Point(403, 342);
this.btnChildEnd.Name = "btnChildEnd";
this.btnChildEnd.Size = new System.Drawing.Size(58, 21);
this.btnChildEnd.TabIndex = 149;
this.btnChildEnd.UseVisualStyleBackColor = false;
this.btnChildEnd.Click += new System.EventHandler(this.btnChildEnd_Click);
//
// btnChildNext
//
this.btnChildNext.BackColor = System.Drawing.Color.White;
this.btnChildNext.Image = ((System.Drawing.Image)(resources.GetObject("btnChildNext.Image")));
this.btnChildNext.Location = new System.Drawing.Point(323, 342);
this.btnChildNext.Name = "btnChildNext";
this.btnChildNext.Size = new System.Drawing.Size(58, 21);
this.btnChildNext.TabIndex = 148;
this.btnChildNext.UseVisualStyleBackColor = false;
this.btnChildNext.Click += new System.EventHandler(this.btnChildNext_Click);
//
// btnChildBack
//
this.btnChildBack.BackColor = System.Drawing.Color.White;
this.btnChildBack.Image = ((System.Drawing.Image)(resources.GetObject("btnChildBack.Image")));
this.btnChildBack.Location = new System.Drawing.Point(243, 342);
this.btnChildBack.Name = "btnChildBack";
this.btnChildBack.Size = new System.Drawing.Size(58, 21);
this.btnChildBack.TabIndex = 147;
this.btnChildBack.UseVisualStyleBackColor = false;
this.btnChildBack.Click += new System.EventHandler(this.btnChildBack_Click);
//
// btnChildFirst
//
this.btnChildFirst.BackColor = System.Drawing.Color.White;
this.btnChildFirst.Image = ((System.Drawing.Image)(resources.GetObject("btnChildFirst.Image")));
this.btnChildFirst.Location = new System.Drawing.Point(163, 342);
this.btnChildFirst.Name = "btnChildFirst";
this.btnChildFirst.Size = new System.Drawing.Size(58, 21);
this.btnChildFirst.TabIndex = 146;
this.btnChildFirst.UseVisualStyleBackColor = false;
this.btnChildFirst.Click += new System.EventHandler(this.btnChildFirst_Click);
//
// lblAmount
//
this.lblAmount.AutoSize = true;
this.lblAmount.Location = new System.Drawing.Point(441, 214);
this.lblAmount.Name = "lblAmount";
this.lblAmount.Size = new System.Drawing.Size(59, 12);
this.lblAmount.TabIndex = 133;
this.lblAmount.Text = "訂貨金額:";
//
// lblOrderDate
//
this.lblOrderDate.AutoSize = true;
this.lblOrderDate.Location = new System.Drawing.Point(201, 214);
this.lblOrderDate.Name = "lblOrderDate";
this.lblOrderDate.Size = new System.Drawing.Size(59, 12);
this.lblOrderDate.TabIndex = 131;
this.lblOrderDate.Text = "訂單日期:";
//
// TextBoxAmount
//
this.TextBoxAmount.Font = new System.Drawing.Font("PMingLiU", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.TextBoxAmount.ForeColor = System.Drawing.Color.Red;
this.TextBoxAmount.Location = new System.Drawing.Point(514, 212);
this.TextBoxAmount.Name = "TextBoxAmount";
this.TextBoxAmount.Size = new System.Drawing.Size(103, 22);
this.TextBoxAmount.TabIndex = 134;
//
// DateTimePickerOrderDate
//
this.DateTimePickerOrderDate.Font = new System.Drawing.Font("PMingLiU", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.DateTimePickerOrderDate.Location = new System.Drawing.Point(281, 212);
this.DateTimePickerOrderDate.Name = "DateTimePickerOrderDate";
this.DateTimePickerOrderDate.Size = new System.Drawing.Size(152, 22);
this.DateTimePickerOrderDate.TabIndex = 132;
//
// lblPhone
//
this.lblPhone.AutoSize = true;
this.lblPhone.Location = new System.Drawing.Point(315, 77);
this.lblPhone.Name = "lblPhone";
this.lblPhone.Size = new System.Drawing.Size(35, 12);
this.lblPhone.TabIndex = 121;
this.lblPhone.Text = "電話:";
//
// TextBoxPhone
//
this.TextBoxPhone.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.TextBoxPhone.Location = new System.Drawing.Point(363, 75);
this.TextBoxPhone.Name = "TextBoxPhone";
this.TextBoxPhone.Size = new System.Drawing.Size(177, 21);
this.TextBoxPhone.TabIndex = 122;
//
// lblContact
//
this.lblContact.AutoSize = true;
this.lblContact.Location = new System.Drawing.Point(99, 77);
this.lblContact.Name = "lblContact";
this.lblContact.Size = new System.Drawing.Size(47, 12);
this.lblContact.TabIndex = 119;
this.lblContact.Text = "連絡人:";
//
// lblCompany
//
this.lblCompany.AutoSize = true;
this.lblCompany.Location = new System.Drawing.Point(283, 52);
this.lblCompany.Name = "lblCompany";
this.lblCompany.Size = new System.Drawing.Size(59, 12);
this.lblCompany.TabIndex = 117;
this.lblCompany.Text = "公司名稱:";
//
// lblCustomerID
//
this.lblCustomerID.AutoSize = true;
this.lblCustomerID.Location = new System.Drawing.Point(83, 52);
this.lblCustomerID.Name = "lblCustomerID";
this.lblCustomerID.Size = new System.Drawing.Size(59, 12);
this.lblCustomerID.TabIndex = 115;
this.lblCustomerID.Text = "客戶編號:";
//
// TextBoxCustomerID
//
this.TextBoxCustomerID.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.TextBoxCustomerID.Location = new System.Drawing.Point(163, 50);
this.TextBoxCustomerID.Name = "TextBoxCustomerID";
this.TextBoxCustomerID.Size = new System.Drawing.Size(100, 21);
this.TextBoxCustomerID.TabIndex = 116;
//
// TextBoxContact
//
this.TextBoxContact.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.TextBoxContact.Location = new System.Drawing.Point(163, 75);
this.TextBoxContact.Name = "TextBoxContact";
this.TextBoxContact.Size = new System.Drawing.Size(101, 21);
this.TextBoxContact.TabIndex = 120;
//
// TextBoxCompanyName
//
this.TextBoxCompanyName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.TextBoxCompanyName.Location = new System.Drawing.Point(363, 50);
this.TextBoxCompanyName.Name = "TextBoxCompanyName";
this.TextBoxCompanyName.Size = new System.Drawing.Size(177, 21);
this.TextBoxCompanyName.TabIndex = 118;
//
// btnEnd
//
this.btnEnd.BackColor = System.Drawing.Color.White;
this.btnEnd.Image = ((System.Drawing.Image)(resources.GetObject("btnEnd.Image")));
this.btnEnd.Location = new System.Drawing.Point(403, 143);
this.btnEnd.Name = "btnEnd";
this.btnEnd.Size = new System.Drawing.Size(58, 21);
this.btnEnd.TabIndex = 127;
this.btnEnd.UseVisualStyleBackColor = false;
this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
//
// btnNext
//
this.btnNext.BackColor = System.Drawing.Color.White;
this.btnNext.Image = ((System.Drawing.Image)(resources.GetObject("btnNext.Image")));
this.btnNext.Location = new System.Drawing.Point(323, 143);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(58, 21);
this.btnNext.TabIndex = 126;
this.btnNext.UseVisualStyleBackColor = false;
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// btnBack
//
this.btnBack.BackColor = System.Drawing.Color.White;
this.btnBack.Image = ((System.Drawing.Image)(resources.GetObject("btnBack.Image")));
this.btnBack.Location = new System.Drawing.Point(243, 143);
this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(58, 21);
this.btnBack.TabIndex = 125;
this.btnBack.UseVisualStyleBackColor = false;
this.btnBack.Click += new System.EventHandler(this.btnBack_Click);
//
// btnFirst
//
this.btnFirst.BackColor = System.Drawing.Color.White;
this.btnFirst.Image = ((System.Drawing.Image)(resources.GetObject("btnFirst.Image")));
this.btnFirst.Location = new System.Drawing.Point(163, 143);
this.btnFirst.Name = "btnFirst";
this.btnFirst.Size = new System.Drawing.Size(58, 21);
this.btnFirst.TabIndex = 124;
this.btnFirst.UseVisualStyleBackColor = false;
this.btnFirst.Click += new System.EventHandler(this.btnFirst_Click);
//
// TextBoxCustomerPosition
//
this.TextBoxCustomerPosition.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.TextBoxCustomerPosition.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
this.TextBoxCustomerPosition.Location = new System.Drawing.Point(171, 112);
this.TextBoxCustomerPosition.Name = "TextBoxCustomerPosition";
this.TextBoxCustomerPosition.Size = new System.Drawing.Size(290, 21);
this.TextBoxCustomerPosition.TabIndex = 123;
this.TextBoxCustomerPosition.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// Panel1
//
this.Panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.Panel1.Location = new System.Drawing.Point(3, 199);
this.Panel1.Name = "Panel1";
this.Panel1.Size = new System.Drawing.Size(628, 172);
this.Panel1.TabIndex = 128;
//
// BindingDemoForm15
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(663, 411);
this.Controls.Add(this.Label3);
this.Controls.Add(this.Label2);
this.Controls.Add(this.Label1);
this.Controls.Add(this.TextBoxDiscount);
this.Controls.Add(this.lblDiscount);
this.Controls.Add(this.TextBoxQuantity);
this.Controls.Add(this.lblQuantity);
this.Controls.Add(this.TextBoxPrice);
this.Controls.Add(this.lblPrice);
this.Controls.Add(this.TextBoxProductName);
this.Controls.Add(this.lblProductName);
this.Controls.Add(this.TextBoxProductID);
this.Controls.Add(this.lblProductID);
this.Controls.Add(this.TextBoxOrderID);
this.Controls.Add(this.lblOrderID);
this.Controls.Add(this.TextBoxOrderPosition);
this.Controls.Add(this.btnChildEnd);
this.Controls.Add(this.btnChildNext);
this.Controls.Add(this.btnChildBack);
this.Controls.Add(this.btnChildFirst);
this.Controls.Add(this.lblAmount);
this.Controls.Add(this.lblOrderDate);
this.Controls.Add(this.TextBoxAmount);
this.Controls.Add(this.DateTimePickerOrderDate);
this.Controls.Add(this.lblPhone);
this.Controls.Add(this.TextBoxPhone);
this.Controls.Add(this.lblContact);
this.Controls.Add(this.lblCompany);
this.Controls.Add(this.lblCustomerID);
this.Controls.Add(this.TextBoxCustomerID);
this.Controls.Add(this.TextBoxContact);
this.Controls.Add(this.TextBoxCompanyName);
this.Controls.Add(this.btnEnd);
this.Controls.Add(this.btnNext);
this.Controls.Add(this.btnBack);
this.Controls.Add(this.btnFirst);
this.Controls.Add(this.TextBoxCustomerPosition);
this.Controls.Add(this.Panel1);
this.Name = "BindingDemoForm15";
this.Text = "BindingDemoForm15";
this.Load += new System.EventHandler(this.BindingDemoForm15_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
internal System.Windows.Forms.Label Label3;
internal System.Windows.Forms.Label Label2;
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.TextBox TextBoxDiscount;
internal System.Windows.Forms.Label lblDiscount;
internal System.Windows.Forms.TextBox TextBoxQuantity;
internal System.Windows.Forms.Label lblQuantity;
internal System.Windows.Forms.TextBox TextBoxPrice;
internal System.Windows.Forms.Label lblPrice;
internal System.Windows.Forms.TextBox TextBoxProductName;
internal System.Windows.Forms.Label lblProductName;
internal System.Windows.Forms.TextBox TextBoxProductID;
internal System.Windows.Forms.Label lblProductID;
internal System.Windows.Forms.TextBox TextBoxOrderID;
internal System.Windows.Forms.Label lblOrderID;
internal System.Windows.Forms.TextBox TextBoxOrderPosition;
internal System.Windows.Forms.Button btnChildEnd;
internal System.Windows.Forms.Button btnChildNext;
internal System.Windows.Forms.Button btnChildBack;
internal System.Windows.Forms.Button btnChildFirst;
internal System.Windows.Forms.Label lblAmount;
internal System.Windows.Forms.Label lblOrderDate;
internal System.Windows.Forms.TextBox TextBoxAmount;
internal System.Windows.Forms.DateTimePicker DateTimePickerOrderDate;
internal System.Windows.Forms.Label lblPhone;
internal System.Windows.Forms.TextBox TextBoxPhone;
internal System.Windows.Forms.Label lblContact;
internal System.Windows.Forms.Label lblCompany;
internal System.Windows.Forms.Label lblCustomerID;
internal System.Windows.Forms.TextBox TextBoxCustomerID;
internal System.Windows.Forms.TextBox TextBoxContact;
internal System.Windows.Forms.TextBox TextBoxCompanyName;
internal System.Windows.Forms.Button btnEnd;
internal System.Windows.Forms.Button btnNext;
internal System.Windows.Forms.Button btnBack;
internal System.Windows.Forms.Button btnFirst;
internal System.Windows.Forms.TextBox TextBoxCustomerPosition;
internal System.Windows.Forms.Panel Panel1;
}
}
... {
partial class BindingDemoForm15
...{
/**//// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/**//// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
...{
if (disposing && (components != null))
...{
components.Dispose();
}
base.Dispose(disposing);
}
Windows 窗体设计器生成的代码#region Windows 窗体设计器生成的代码
/**//// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
...{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BindingDemoForm15));
this.Label3 = new System.Windows.Forms.Label();
this.Label2 = new System.Windows.Forms.Label();
this.Label1 = new System.Windows.Forms.Label();
this.TextBoxDiscount = new System.Windows.Forms.TextBox();
this.lblDiscount = new System.Windows.Forms.Label();
this.TextBoxQuantity = new System.Windows.Forms.TextBox();
this.lblQuantity = new System.Windows.Forms.Label();
this.TextBoxPrice = new System.Windows.Forms.TextBox();
this.lblPrice = new System.Windows.Forms.Label();
this.TextBoxProductName = new System.Windows.Forms.TextBox();
this.lblProductName = new System.Windows.Forms.Label();
this.TextBoxProductID = new System.Windows.Forms.TextBox();
this.lblProductID = new System.Windows.Forms.Label();
this.TextBoxOrderID = new System.Windows.Forms.TextBox();
this.lblOrderID = new System.Windows.Forms.Label();
this.TextBoxOrderPosition = new System.Windows.Forms.TextBox();
this.btnChildEnd = new System.Windows.Forms.Button();
this.btnChildNext = new System.Windows.Forms.Button();
this.btnChildBack = new System.Windows.Forms.Button();
this.btnChildFirst = new System.Windows.Forms.Button();
this.lblAmount = new System.Windows.Forms.Label();
this.lblOrderDate = new System.Windows.Forms.Label();
this.TextBoxAmount = new System.Windows.Forms.TextBox();
this.DateTimePickerOrderDate = new System.Windows.Forms.DateTimePicker();
this.lblPhone = new System.Windows.Forms.Label();
this.TextBoxPhone = new System.Windows.Forms.TextBox();
this.lblContact = new System.Windows.Forms.Label();
this.lblCompany = new System.Windows.Forms.Label();
this.lblCustomerID = new System.Windows.Forms.Label();
this.TextBoxCustomerID = new System.Windows.Forms.TextBox();
this.TextBoxContact = new System.Windows.Forms.TextBox();
this.TextBoxCompanyName = new System.Windows.Forms.TextBox();
this.btnEnd = new System.Windows.Forms.Button();
this.btnNext = new System.Windows.Forms.Button();
this.btnBack = new System.Windows.Forms.Button();
this.btnFirst = new System.Windows.Forms.Button();
this.TextBoxCustomerPosition = new System.Windows.Forms.TextBox();
this.Panel1 = new System.Windows.Forms.Panel();
this.SuspendLayout();
//
// Label3
//
this.Label3.AutoSize = true;
this.Label3.Font = new System.Drawing.Font("PMingLiU", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.Label3.ForeColor = System.Drawing.Color.Maroon;
this.Label3.Location = new System.Drawing.Point(3, 174);
this.Label3.Name = "Label3";
this.Label3.Size = new System.Drawing.Size(72, 16);
this.Label3.TabIndex = 151;
this.Label3.Text = "訂單資料";
//
// Label2
//
this.Label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.Label2.Font = new System.Drawing.Font("PMingLiU", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.Label2.ForeColor = System.Drawing.Color.Maroon;
this.Label2.Location = new System.Drawing.Point(35, 56);
this.Label2.Name = "Label2";
this.Label2.Size = new System.Drawing.Size(30, 79);
this.Label2.TabIndex = 150;
this.Label2.Text = "客戶資料";
//
// Label1
//
this.Label1.AutoSize = true;
this.Label1.Font = new System.Drawing.Font("PMingLiU", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.Label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
this.Label1.Location = new System.Drawing.Point(147, 6);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(312, 32);
this.Label1.TabIndex = 114;
this.Label1.Text = "一對多資料導覽介面";
this.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// TextBoxDiscount
//
this.TextBoxDiscount.ForeColor = System.Drawing.Color.Blue;
this.TextBoxDiscount.Location = new System.Drawing.Point(475, 268);
this.TextBoxDiscount.Name = "TextBoxDiscount";
this.TextBoxDiscount.Size = new System.Drawing.Size(100, 21);
this.TextBoxDiscount.TabIndex = 144;
//
// lblDiscount
//
this.lblDiscount.AutoSize = true;
this.lblDiscount.Location = new System.Drawing.Point(427, 270);
this.lblDiscount.Name = "lblDiscount";
this.lblDiscount.Size = new System.Drawing.Size(35, 12);
this.lblDiscount.TabIndex = 143;
this.lblDiscount.Text = "折扣:";
//
// TextBoxQuantity
//
this.TextBoxQuantity.ForeColor = System.Drawing.Color.Blue;
this.TextBoxQuantity.Location = new System.Drawing.Point(281, 268);
this.TextBoxQuantity.Name = "TextBoxQuantity";
this.TextBoxQuantity.Size = new System.Drawing.Size(100, 21);
this.TextBoxQuantity.TabIndex = 142;
//
// lblQuantity
//
this.lblQuantity.AutoSize = true;
this.lblQuantity.Location = new System.Drawing.Point(233, 270);
this.lblQuantity.Name = "lblQuantity";
this.lblQuantity.Size = new System.Drawing.Size(35, 12);
this.lblQuantity.TabIndex = 141;
this.lblQuantity.Text = "數量:";
//
// TextBoxPrice
//
this.TextBoxPrice.ForeColor = System.Drawing.Color.Blue;
this.TextBoxPrice.Location = new System.Drawing.Point(91, 268);
this.TextBoxPrice.Name = "TextBoxPrice";
this.TextBoxPrice.Size = new System.Drawing.Size(100, 21);
this.TextBoxPrice.TabIndex = 140;
//
// lblPrice
//
this.lblPrice.AutoSize = true;
this.lblPrice.Location = new System.Drawing.Point(43, 270);
this.lblPrice.Name = "lblPrice";
this.lblPrice.Size = new System.Drawing.Size(35, 12);
this.lblPrice.TabIndex = 139;
this.lblPrice.Text = "單價:";
//
// TextBoxProductName
//
this.TextBoxProductName.ForeColor = System.Drawing.Color.Blue;
this.TextBoxProductName.Location = new System.Drawing.Point(281, 236);
this.TextBoxProductName.Name = "TextBoxProductName";
this.TextBoxProductName.Size = new System.Drawing.Size(100, 21);
this.TextBoxProductName.TabIndex = 138;
//
// lblProductName
//
this.lblProductName.AutoSize = true;
this.lblProductName.Location = new System.Drawing.Point(201, 239);
this.lblProductName.Name = "lblProductName";
this.lblProductName.Size = new System.Drawing.Size(59, 12);
this.lblProductName.TabIndex = 137;
this.lblProductName.Text = "產品名稱:";
//
// TextBoxProductID
//
this.TextBoxProductID.ForeColor = System.Drawing.Color.Blue;
this.TextBoxProductID.Location = new System.Drawing.Point(91, 236);
this.TextBoxProductID.Name = "TextBoxProductID";
this.TextBoxProductID.Size = new System.Drawing.Size(100, 21);
this.TextBoxProductID.TabIndex = 136;
//
// lblProductID
//
this.lblProductID.AutoSize = true;
this.lblProductID.Location = new System.Drawing.Point(11, 239);
this.lblProductID.Name = "lblProductID";
this.lblProductID.Size = new System.Drawing.Size(59, 12);
this.lblProductID.TabIndex = 135;
this.lblProductID.Text = "產品編號:";
//
// TextBoxOrderID
//
this.TextBoxOrderID.ForeColor = System.Drawing.Color.Blue;
this.TextBoxOrderID.Location = new System.Drawing.Point(91, 212);
this.TextBoxOrderID.Name = "TextBoxOrderID";
this.TextBoxOrderID.Size = new System.Drawing.Size(100, 21);
this.TextBoxOrderID.TabIndex = 130;
//
// lblOrderID
//
this.lblOrderID.AutoSize = true;
this.lblOrderID.Location = new System.Drawing.Point(11, 214);
this.lblOrderID.Name = "lblOrderID";
this.lblOrderID.Size = new System.Drawing.Size(59, 12);
this.lblOrderID.TabIndex = 129;
this.lblOrderID.Text = "訂單號碼:";
//
// TextBoxOrderPosition
//
this.TextBoxOrderPosition.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.TextBoxOrderPosition.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
this.TextBoxOrderPosition.Location = new System.Drawing.Point(163, 299);
this.TextBoxOrderPosition.Name = "TextBoxOrderPosition";
this.TextBoxOrderPosition.Size = new System.Drawing.Size(290, 21);
this.TextBoxOrderPosition.TabIndex = 145;
this.TextBoxOrderPosition.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// btnChildEnd
//
this.btnChildEnd.BackColor = System.Drawing.Color.White;
this.btnChildEnd.Image = ((System.Drawing.Image)(resources.GetObject("btnChildEnd.Image")));
this.btnChildEnd.Location = new System.Drawing.Point(403, 342);
this.btnChildEnd.Name = "btnChildEnd";
this.btnChildEnd.Size = new System.Drawing.Size(58, 21);
this.btnChildEnd.TabIndex = 149;
this.btnChildEnd.UseVisualStyleBackColor = false;
this.btnChildEnd.Click += new System.EventHandler(this.btnChildEnd_Click);
//
// btnChildNext
//
this.btnChildNext.BackColor = System.Drawing.Color.White;
this.btnChildNext.Image = ((System.Drawing.Image)(resources.GetObject("btnChildNext.Image")));
this.btnChildNext.Location = new System.Drawing.Point(323, 342);
this.btnChildNext.Name = "btnChildNext";
this.btnChildNext.Size = new System.Drawing.Size(58, 21);
this.btnChildNext.TabIndex = 148;
this.btnChildNext.UseVisualStyleBackColor = false;
this.btnChildNext.Click += new System.EventHandler(this.btnChildNext_Click);
//
// btnChildBack
//
this.btnChildBack.BackColor = System.Drawing.Color.White;
this.btnChildBack.Image = ((System.Drawing.Image)(resources.GetObject("btnChildBack.Image")));
this.btnChildBack.Location = new System.Drawing.Point(243, 342);
this.btnChildBack.Name = "btnChildBack";
this.btnChildBack.Size = new System.Drawing.Size(58, 21);
this.btnChildBack.TabIndex = 147;
this.btnChildBack.UseVisualStyleBackColor = false;
this.btnChildBack.Click += new System.EventHandler(this.btnChildBack_Click);
//
// btnChildFirst
//
this.btnChildFirst.BackColor = System.Drawing.Color.White;
this.btnChildFirst.Image = ((System.Drawing.Image)(resources.GetObject("btnChildFirst.Image")));
this.btnChildFirst.Location = new System.Drawing.Point(163, 342);
this.btnChildFirst.Name = "btnChildFirst";
this.btnChildFirst.Size = new System.Drawing.Size(58, 21);
this.btnChildFirst.TabIndex = 146;
this.btnChildFirst.UseVisualStyleBackColor = false;
this.btnChildFirst.Click += new System.EventHandler(this.btnChildFirst_Click);
//
// lblAmount
//
this.lblAmount.AutoSize = true;
this.lblAmount.Location = new System.Drawing.Point(441, 214);
this.lblAmount.Name = "lblAmount";
this.lblAmount.Size = new System.Drawing.Size(59, 12);
this.lblAmount.TabIndex = 133;
this.lblAmount.Text = "訂貨金額:";
//
// lblOrderDate
//
this.lblOrderDate.AutoSize = true;
this.lblOrderDate.Location = new System.Drawing.Point(201, 214);
this.lblOrderDate.Name = "lblOrderDate";
this.lblOrderDate.Size = new System.Drawing.Size(59, 12);
this.lblOrderDate.TabIndex = 131;
this.lblOrderDate.Text = "訂單日期:";
//
// TextBoxAmount
//
this.TextBoxAmount.Font = new System.Drawing.Font("PMingLiU", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.TextBoxAmount.ForeColor = System.Drawing.Color.Red;
this.TextBoxAmount.Location = new System.Drawing.Point(514, 212);
this.TextBoxAmount.Name = "TextBoxAmount";
this.TextBoxAmount.Size = new System.Drawing.Size(103, 22);
this.TextBoxAmount.TabIndex = 134;
//
// DateTimePickerOrderDate
//
this.DateTimePickerOrderDate.Font = new System.Drawing.Font("PMingLiU", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.DateTimePickerOrderDate.Location = new System.Drawing.Point(281, 212);
this.DateTimePickerOrderDate.Name = "DateTimePickerOrderDate";
this.DateTimePickerOrderDate.Size = new System.Drawing.Size(152, 22);
this.DateTimePickerOrderDate.TabIndex = 132;
//
// lblPhone
//
this.lblPhone.AutoSize = true;
this.lblPhone.Location = new System.Drawing.Point(315, 77);
this.lblPhone.Name = "lblPhone";
this.lblPhone.Size = new System.Drawing.Size(35, 12);
this.lblPhone.TabIndex = 121;
this.lblPhone.Text = "電話:";
//
// TextBoxPhone
//
this.TextBoxPhone.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.TextBoxPhone.Location = new System.Drawing.Point(363, 75);
this.TextBoxPhone.Name = "TextBoxPhone";
this.TextBoxPhone.Size = new System.Drawing.Size(177, 21);
this.TextBoxPhone.TabIndex = 122;
//
// lblContact
//
this.lblContact.AutoSize = true;
this.lblContact.Location = new System.Drawing.Point(99, 77);
this.lblContact.Name = "lblContact";
this.lblContact.Size = new System.Drawing.Size(47, 12);
this.lblContact.TabIndex = 119;
this.lblContact.Text = "連絡人:";
//
// lblCompany
//
this.lblCompany.AutoSize = true;
this.lblCompany.Location = new System.Drawing.Point(283, 52);
this.lblCompany.Name = "lblCompany";
this.lblCompany.Size = new System.Drawing.Size(59, 12);
this.lblCompany.TabIndex = 117;
this.lblCompany.Text = "公司名稱:";
//
// lblCustomerID
//
this.lblCustomerID.AutoSize = true;
this.lblCustomerID.Location = new System.Drawing.Point(83, 52);
this.lblCustomerID.Name = "lblCustomerID";
this.lblCustomerID.Size = new System.Drawing.Size(59, 12);
this.lblCustomerID.TabIndex = 115;
this.lblCustomerID.Text = "客戶編號:";
//
// TextBoxCustomerID
//
this.TextBoxCustomerID.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.TextBoxCustomerID.Location = new System.Drawing.Point(163, 50);
this.TextBoxCustomerID.Name = "TextBoxCustomerID";
this.TextBoxCustomerID.Size = new System.Drawing.Size(100, 21);
this.TextBoxCustomerID.TabIndex = 116;
//
// TextBoxContact
//
this.TextBoxContact.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.TextBoxContact.Location = new System.Drawing.Point(163, 75);
this.TextBoxContact.Name = "TextBoxContact";
this.TextBoxContact.Size = new System.Drawing.Size(101, 21);
this.TextBoxContact.TabIndex = 120;
//
// TextBoxCompanyName
//
this.TextBoxCompanyName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.TextBoxCompanyName.Location = new System.Drawing.Point(363, 50);
this.TextBoxCompanyName.Name = "TextBoxCompanyName";
this.TextBoxCompanyName.Size = new System.Drawing.Size(177, 21);
this.TextBoxCompanyName.TabIndex = 118;
//
// btnEnd
//
this.btnEnd.BackColor = System.Drawing.Color.White;
this.btnEnd.Image = ((System.Drawing.Image)(resources.GetObject("btnEnd.Image")));
this.btnEnd.Location = new System.Drawing.Point(403, 143);
this.btnEnd.Name = "btnEnd";
this.btnEnd.Size = new System.Drawing.Size(58, 21);
this.btnEnd.TabIndex = 127;
this.btnEnd.UseVisualStyleBackColor = false;
this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
//
// btnNext
//
this.btnNext.BackColor = System.Drawing.Color.White;
this.btnNext.Image = ((System.Drawing.Image)(resources.GetObject("btnNext.Image")));
this.btnNext.Location = new System.Drawing.Point(323, 143);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(58, 21);
this.btnNext.TabIndex = 126;
this.btnNext.UseVisualStyleBackColor = false;
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// btnBack
//
this.btnBack.BackColor = System.Drawing.Color.White;
this.btnBack.Image = ((System.Drawing.Image)(resources.GetObject("btnBack.Image")));
this.btnBack.Location = new System.Drawing.Point(243, 143);
this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(58, 21);
this.btnBack.TabIndex = 125;
this.btnBack.UseVisualStyleBackColor = false;
this.btnBack.Click += new System.EventHandler(this.btnBack_Click);
//
// btnFirst
//
this.btnFirst.BackColor = System.Drawing.Color.White;
this.btnFirst.Image = ((System.Drawing.Image)(resources.GetObject("btnFirst.Image")));
this.btnFirst.Location = new System.Drawing.Point(163, 143);
this.btnFirst.Name = "btnFirst";
this.btnFirst.Size = new System.Drawing.Size(58, 21);
this.btnFirst.TabIndex = 124;
this.btnFirst.UseVisualStyleBackColor = false;
this.btnFirst.Click += new System.EventHandler(this.btnFirst_Click);
//
// TextBoxCustomerPosition
//
this.TextBoxCustomerPosition.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.TextBoxCustomerPosition.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
this.TextBoxCustomerPosition.Location = new System.Drawing.Point(171, 112);
this.TextBoxCustomerPosition.Name = "TextBoxCustomerPosition";
this.TextBoxCustomerPosition.Size = new System.Drawing.Size(290, 21);
this.TextBoxCustomerPosition.TabIndex = 123;
this.TextBoxCustomerPosition.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// Panel1
//
this.Panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.Panel1.Location = new System.Drawing.Point(3, 199);
this.Panel1.Name = "Panel1";
this.Panel1.Size = new System.Drawing.Size(628, 172);
this.Panel1.TabIndex = 128;
//
// BindingDemoForm15
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(663, 411);
this.Controls.Add(this.Label3);
this.Controls.Add(this.Label2);
this.Controls.Add(this.Label1);
this.Controls.Add(this.TextBoxDiscount);
this.Controls.Add(this.lblDiscount);
this.Controls.Add(this.TextBoxQuantity);
this.Controls.Add(this.lblQuantity);
this.Controls.Add(this.TextBoxPrice);
this.Controls.Add(this.lblPrice);
this.Controls.Add(this.TextBoxProductName);
this.Controls.Add(this.lblProductName);
this.Controls.Add(this.TextBoxProductID);
this.Controls.Add(this.lblProductID);
this.Controls.Add(this.TextBoxOrderID);
this.Controls.Add(this.lblOrderID);
this.Controls.Add(this.TextBoxOrderPosition);
this.Controls.Add(this.btnChildEnd);
this.Controls.Add(this.btnChildNext);
this.Controls.Add(this.btnChildBack);
this.Controls.Add(this.btnChildFirst);
this.Controls.Add(this.lblAmount);
this.Controls.Add(this.lblOrderDate);
this.Controls.Add(this.TextBoxAmount);
this.Controls.Add(this.DateTimePickerOrderDate);
this.Controls.Add(this.lblPhone);
this.Controls.Add(this.TextBoxPhone);
this.Controls.Add(this.lblContact);
this.Controls.Add(this.lblCompany);
this.Controls.Add(this.lblCustomerID);
this.Controls.Add(this.TextBoxCustomerID);
this.Controls.Add(this.TextBoxContact);
this.Controls.Add(this.TextBoxCompanyName);
this.Controls.Add(this.btnEnd);
this.Controls.Add(this.btnNext);
this.Controls.Add(this.btnBack);
this.Controls.Add(this.btnFirst);
this.Controls.Add(this.TextBoxCustomerPosition);
this.Controls.Add(this.Panel1);
this.Name = "BindingDemoForm15";
this.Text = "BindingDemoForm15";
this.Load += new System.EventHandler(this.BindingDemoForm15_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
internal System.Windows.Forms.Label Label3;
internal System.Windows.Forms.Label Label2;
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.TextBox TextBoxDiscount;
internal System.Windows.Forms.Label lblDiscount;
internal System.Windows.Forms.TextBox TextBoxQuantity;
internal System.Windows.Forms.Label lblQuantity;
internal System.Windows.Forms.TextBox TextBoxPrice;
internal System.Windows.Forms.Label lblPrice;
internal System.Windows.Forms.TextBox TextBoxProductName;
internal System.Windows.Forms.Label lblProductName;
internal System.Windows.Forms.TextBox TextBoxProductID;
internal System.Windows.Forms.Label lblProductID;
internal System.Windows.Forms.TextBox TextBoxOrderID;
internal System.Windows.Forms.Label lblOrderID;
internal System.Windows.Forms.TextBox TextBoxOrderPosition;
internal System.Windows.Forms.Button btnChildEnd;
internal System.Windows.Forms.Button btnChildNext;
internal System.Windows.Forms.Button btnChildBack;
internal System.Windows.Forms.Button btnChildFirst;
internal System.Windows.Forms.Label lblAmount;
internal System.Windows.Forms.Label lblOrderDate;
internal System.Windows.Forms.TextBox TextBoxAmount;
internal System.Windows.Forms.DateTimePicker DateTimePickerOrderDate;
internal System.Windows.Forms.Label lblPhone;
internal System.Windows.Forms.TextBox TextBoxPhone;
internal System.Windows.Forms.Label lblContact;
internal System.Windows.Forms.Label lblCompany;
internal System.Windows.Forms.Label lblCustomerID;
internal System.Windows.Forms.TextBox TextBoxCustomerID;
internal System.Windows.Forms.TextBox TextBoxContact;
internal System.Windows.Forms.TextBox TextBoxCompanyName;
internal System.Windows.Forms.Button btnEnd;
internal System.Windows.Forms.Button btnNext;
internal System.Windows.Forms.Button btnBack;
internal System.Windows.Forms.Button btnFirst;
internal System.Windows.Forms.TextBox TextBoxCustomerPosition;
internal System.Windows.Forms.Panel Panel1;
}
}