資源簡介
實現了交易的各種情況,一方發出訂單,一方接受訂單,一方取消訂單,合同終止。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.Data.SqlClient;
using?System.Configuration;
namespace?WindowsFormsApplication1
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?button4_Click(object?sender?EventArgs?e)
????????{
????????}
????????private?void?button3_Click(object?sender?EventArgs?e)//跳轉到另外的窗口
????????{
????????????//Form2?form2?=?new?Form2();
????????????//form2.TopLevel?=?false;?//?這一步最重要?去除子窗體的頂級窗體設置
????????????//form2.Parent?=?this.panel1;?//?子窗體的父容器
????????????//form2.FormBorderstyle?=?FormBorderstyle.None;?//?去邊框標題欄等
????????????//form2.Dock?=?Dockstyle.Fill;?//?填充
????????????//form2.Show();
????????????Form2?frm2?=?new?Form2();
????????????//??this.Hide();
????????????if?(frm2.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????this.Show();
????????????}
????????}
????????private?void?button4_Click_1(object?sender?EventArgs?e)//取消登陸界面
????????{
????????????this.Close();
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)//登錄按鈕,檢驗并連接數據庫匹配帳號
????????{
????????????if?(textBox1?.Text?.Trim?()!=““?&&textBox2?.Text?.Trim?()!=““?)
????????????{
????????????????string?sqlconnstr?=?ConfigurationManager.ConnectionStrings[“ConnectionString“].ToString();
????????????????SqlConnection?cn?=?new?SqlConnection(sqlconnstr);
????????????????SqlCommand?cmd?=?new?SqlCommand();
????????????????cmd.Connection?=?cn;
????????????????cn.Open();
?????????????if?(radioButton1.Checked?)
?????????????{
????????????????cmd.CommandText?=?“select?*?from?customer?where?c_no=@no?and?c_pw=@pw“;
????????????????cmd.Parameters.AddWithValue(“@no“?textBox1.Text.Trim());
????????????????cmd.Parameters.AddWithValue(“@pw“?textBox2.Text.Trim());
????????????????SqlDataReader?sdr?=?cmd.ExecuteReader();
????????????????int?t?=?0;
????????????????while?(sdr.Read())
????????????????{
????????????????????t++;
????????????????}
????????????????if?(t?>?0)
????????????????{
???????????????//?????MessageBox.Show(“找到該用戶“);
????????????????????cmd?=?null;
????????????????????cn.Close();
????????????????????cn?=?null;
????????????????????yhForm?frm?=?new?yhForm(textBox1.Text.Trim());
????????????????????this.Hide();
????????????????????if?(frm.ShowDialog()?==?DialogResult.OK)
????????????????????{
????????????????????????this.Show();
????????????????????}
????????????????}
????????????????else
????????????????{
????????????????????MessageBox.Show(“用戶名或密碼錯誤,請重新輸入“);
????????????????}
????????????}////////////////////////////////if
?????????????else???if?(radioButton2.Checked)
?????????????{
?????????????????cmd.CommandText?=?“select?*?from?gys?where?g_no=@no?and?g_pw=@pw“;
?????????????????cmd.Paramet
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-06-25?16:27??軟工2012-6-25\
?????目錄???????????0??2012-06-14?14:54??軟工2012-6-25\WindowsFormsApplication1\
?????目錄???????????0??2012-06-14?14:54??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\
?????文件?????????962??2012-05-25?06:24??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1.sln
?????文件???????54272??2012-06-21?00:36??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1.suo
?????文件????????1048??2012-06-11?10:34??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\App.config
?????目錄???????????0??2012-06-14?14:54??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\bin\
?????目錄???????????0??2012-06-14?14:54??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\
?????文件?????2293760??2012-06-11?11:07??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\MyDataba
?????文件??????573440??2012-06-11?11:07??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\MyDataba
?????文件??????333824??2012-06-11?11:04??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
?????文件????????1048??2012-06-11?10:34??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config
?????文件??????820736??2012-06-11?11:04??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
?????文件???????11592??2012-06-20?22:09??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
?????文件????????1048??2012-06-11?10:34??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.config
?????文件?????????490??2007-07-21?01:33??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
?????文件????????6083??2012-06-05?09:13??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs
?????文件????????8589??2012-06-05?09:13??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\Form1.Designer.cs
?????文件????????5814??2012-06-05?09:13??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx
?????文件????????6174??2012-06-11?10:35??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\Form2.cs
?????文件???????11231??2012-05-29?12:59??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\Form2.Designer.cs
?????文件????????5814??2012-05-29?12:59??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\Form2.resx
?????文件????????8949??2012-06-05?08:59??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\Form3.cs
?????文件???????12431??2012-06-05?08:59??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\Form3.Designer.cs
?????文件????????8354??2012-06-05?08:59??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\Form3.resx
?????文件???????13604??2012-06-11?12:49??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\gysForm.cs
?????文件???????20551??2012-06-11?12:49??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\gysForm.Designer.cs
?????文件????????7103??2012-06-11?12:49??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\gysForm.resx
?????文件????????4018??2012-06-11?11:04??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\gysxgForm.cs
?????文件???????10423??2012-06-05?08:41??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\gysxgForm.Designer.cs
?????文件????????5814??2012-06-05?08:41??軟工2012-6-25\WindowsFormsApplication1\WindowsFormsApplication1\gysxgForm.resx
............此處省略47個文件信息
評論
共有 條評論