當前位置:學問谷 >

職場範例 >實習報告 >

上機實習報告總結結尾

上機實習報告總結結尾

一. 首頁

上機實習報告總結結尾

代碼如下;

using System;

using ric;

using onentModel;

using ;

using ing;

using ;

using s;

namespace WindowsApplication1

{

public partial class Form5 : Form {

public Form5()

{

InitializeComponent();

}

private void button1_Click(object sender, {

logo from = new logo();

(); EventArgs e)

}

private void button2_Click(object sender, EventArgs e) {

Form2 from = new Form2();

();

}

private void button3_Click(object sender, EventArgs e) 試卷 {

Form3 from = new Form3();

();

}

private void button4_Click(object sender, EventArgs e) {

Form4 from = new Form4();

();

}

}

}

二. 登錄模塊

代碼如下:

using System;

using ric;

using onentModel;

using ;

using

lient;

using ing;

using ;

using s;

namespace WindowsApplication1

{

public partial class logo : Form

{

public logo()

{

InitializeComponent();

}

private void Form1_Load(object sender, EventArgs e)

{

}

private void button1_Click(object sender, EventArgs e) {

string connstring = @"Data Source=panlunzhao;Initial Catalog=;Integrated Security=True";

SqlConnection conn = new SqlConnection(connstring); ();

string username = ring(); string password = ring(); SqlCommand comm = teCommand();

andText = "select * from manage where username='" + username + "' and password='" + password + "'";

SqlDataReader sqlda = uteReader();

if (())

{

if 工作報告 (sqlda["password"]ring()() == password) {

//("恭喜您登陸成功!", "登陸成功!", , rmation);

//Form2 f = new Form2();

//();

Form3 from = new Form3();

();

}

else { ("密碼錯誤,請重新輸入!", "錯誤

", , rmation); }

}

else { ("此用户不存在,請您註冊!", "註冊", , rmation); }

e(); 黨團工作總結

e();

}

private void button2_Click(object sender, EventArgs e) {

= "";

= "";

}

}

}

三. 會員管理模塊

代碼如下:

using System;

using ric;

using onentModel;

using ;

using lient;

using ing;

using ;

using s;

namespace WindowsApplication1

{

public partial class Form2 :

Form

{

protected SqlConnection conn;

protected SqlCommand cmd;

string connstring = @"Data Sou 述職報告rce=panlunzhao;Initial Catalog=;Integrated Security=True";

public Form2()

{

InitializeComponent();

}

private void Form2_Load(object sender, EventArgs e)

{

load1();

load();

}

protected void load1()

{

string sql = "select *from customer";

conn = new SqlConnection(connstring);

();

SqlDataAdapter da = new SqlDataAdapter(sql, conn); DataSet ds = new DataSet();

(ds, "book");

Source = es["book"];

}

protected void load()

{

conn = new SqlConnection(connstring);

();

string sql_select = "SELECT ID FROM customer "; cmd = new SqlCommand(sql_select, conn);

SqlDataReader dr = uteReader();

r();

while (())

(dr[0]);

e();

}

private DataTable BindData(string sql)

{

string sql_select = sql;

conn = new SqlConnection(connstring);

SqlDataAdapter ad = new SqlDataAdapter(sql_select, conn); DataSet ds = new DataSet();

(ds, "customer");

return es["customer"];

}

private void button1_Click(object sender, EventArgs e) {

string sql = "select * from customer where ID='" + ring() + "'";

conn = new SqlConnection(connstring);

();

SqlCommand cmd = new SqlCommand(sql, conn);

SqlDataReader ds = uteReader();

();

= ds["name"]ring();

學校工作總結 = ds["Levels"]ring();

= ds["Birthday"]ring();

= ds["Degree"]ring();

= ds["Address"]ring();

= ds["Telephone"]ring();

= ds["Email"]ring();

= ds["Score"]ring();

ked = (bool)ds["Gender"];

}

private void update_Click(object sender, EventArgs e) {

string sql = "customer set

name=@name,Levels=@Levels,Birthday=@Birthday,Degree=@Degree,Address=@Address,Telephone=@Telephone,Email=@Email,Score=@Score where ID=@ID"; conn = new SqlConnection(connstring);

();

cmd = new SqlCommand(sql, conn);

("@ID", )e = ring();

("@name", Char, 20)e = ();

("@Levels", lInt)e = ();

("@Birthday",

lDateTime)e = ();

("@Degree", Char,

20)e = ();

("@Address", Char, 256)e = ();

("@Telephone", Char,

50)e = ();

("@Email", Char, 50)e = ();

(" 運動會演講稿 @Gender", )e = (bool)ked;

("@Score", )e = ();

uteNonQuery();

SqlDataReader ds = uteReader();

();

load1();

}

private void _Click(object sender, EventArgs e) {

string sql_ = " into

customer(Name,Levels,Gender,Birthday,Degree,Address,Telephone,Email,Score)

values(@Name,@Levels,@Gender,@Birthday,@Degree,@Address,@Telephone,@Email,@Score)";

cmd = new SqlCommand(sql_, conn);

try

{

();

("@Name", Char,

20)e = ();

("@Levels",

lInt)e = uble(()); ("@Birthday",

lDateTime)e =

teTime(());

("@Degree", Char,

20)e = ();

("@Address", Char, 256)e = ();

("@Telephone", Char,

50)e = ();

("@Email", Char,

50)e = ();

("@Score", )e = uble(());

if (ked)

{

("@Gender",

)e = "true";

}

else

{

("@Gender",

) 月工作總結 e = "false";

}

int count = uteNonQuery();

if (count == 1)

{

if (("確認添加讀者嗎?", "提示", o, tion) == ) return;

("添加成功!!", "提示!"); }

else

{

("添加失敗", "提示",

yCancel, rmation);

}

}

catch (Exception ex)

{

(age);

}

finally

{

e();

}

}

}

}

四.增加、刪除、修改圖書模塊

代碼如下:

using System;

using ric;

using onentModel;

using ;

using lient;

using ing;

using ;

using s;

namespace WindowsApplication1

{

public partial class Form3 : Form

{

protected SqlConnection conn;

protected SqlCom 事蹟材料mand cmd;

string connstring = @"Data Source=panlunzhao;Initial Catalog=;Integrated Security=True";

public Form3()

{

InitializeComponent();

}

private void textBox7_TextChanged(object sender, EventArgs e) {

}

private void label6_Click(object sender, EventArgs e) {

}

private void select_Click(object sender, EventArgs e) {

string book_name = ();

string press = ring();

string Author = ();

StringBuilder sb1 = new StringBuilder();

nd("select * from book where ");

if (ked)

nd(at("Name LIKE '%{0}%'", book_name));

if (ked && ked) nd("AND ");

if (ked)

{

nd(at("Press = '{0}'", press)); }

if (ked && ked) nd("AND ");

if (ked)

{

nd(at("Author LIKE '%{0}%'", Author));

}

Source = Bin 班主任工作計劃 dData(ring()); }

private void reset_Click(object sender, EventArgs e) {

ked = true;

ked = false;

ked = false;

= "";

= "";

= "";

}

private void button1_Click(object sender, EventArgs e) {

string sql = "select * from book where ISBN='" + ring() + "'";

conn = new SqlConnection(connstring);

();

SqlCommand cmd = new SqlCommand(sql, conn);

SqlDataReader ds = uteReader();

();

= ds["ISBN"]ring();

= ds["name"]ring();

= ds["author"]ring();

= ds["press"]ring();

= ds["publishdate"]ring( 試用期工作總結 );

= ds["price"]ring();

= ds["pages"]ring();

= ds["barcode"]ring();

ked = (bool)ds["cd"];

= ds["storage"]ring();

}

private void button2_Click(object sender, EventArgs e) {

string sql = " into

book(ISBN,name,author,press,publishdate,price,pages,barcode,cd,storage)

values(@ISBN,@name,@author,@press,@publishdate,@price,@pages,@barcode,@cd,@storage)";

conn = new SqlConnection(connstring);

();

cmd = new SqlCommand(sql, conn);

("@isbn", r, 10)e = ring();

("@name", Char, 256)e = ();

("@author", Char, 100)e = ();

("@press", Char, 50)e = ();

("@publishdate", Char,

50)e = ();

("@price", Char, 50)e = ();

("@pages", Char, 50)e

= ();

("@barcode", SqlDbType 黨校學習心得體會 Char,

50)e = ();

("@cd", Char, 50)e = (bool)ked;

("@storage", Char,

50)e = ();

uteNonQuery();

load1();

load();

}

private void save_Click(object sender, EventArgs e)

{

string sql = "book set

name=@name,author=@author,press=@press,publishdate=@publishdate,price=@price,pages=@pages,barcode=@barcode,cd=@cd,Storage=@Storage where ISBN=@ISBN";

conn = new SqlConnection(connstring);

();

cmd = new SqlCommand(sql, conn);

("@isbn", r, 10)e = ring();

("@name", Char, 256)e = ();

("@author", Char, 100)e = ();

("@press", Char, 50)e = ();

("@publishdate", Char,

50)e = ();

("@price", Char, 50)e = ();

("@pages", Char, 50)e = ();

("@barcode", Char,

50)e = ();

("@cd", Char, 50)e = (bool)ked;

("@storage", Char,

50)e = ();

uteNonQuery();

SqlDataReader ds = uteReader();

();

load1();

}

private void quxiaosave_Click(object sender, EventArgs e) {

= "";

= "";

= "";

= "";

= "& 申報材料quot;;

= "";

= "";

= "";

ked = false;

= "";

}

private void _Click(object sender, EventArgs e) {

string sql = " from book where isbn=@isbn"; conn = new SqlConnection(connstring);

cmd = new SqlCommand(sql, conn);

();

("@isbn", r, 10)e = ring();

uteNonQuery();

load1();

load();

}

private void Form3_Load(object sender, EventArgs e) {

load();

load1();

}

protected void load()

{

conn = new SqlConnection(connstring);

();

string sql_select = "SELECT DISTINCT [PRESS] FROM [BOOK] ORDER BY [PRESS]";

cmd = new SqlCommand(sql_select, conn);

SqlDataReader dr = uteReader();

r();

while (())

(dr[0]);

e();

andText = "SELECT DISTINCT [Barcode] FROM [Book] ORDER BY [Barcode]";

SqlDataReader ds = uteReader();

r();

while (())

(ds[0]);

e();

andText = "SELECT DISTINCT [ISBN] FROM [Book] ORDER BY [ISBN]";

SqlDataReader st = uteReader();

r();

while (())

(st[0]);

e();

}

protected void load1()

{

string sql = "select *from book";

conn = new SqlConnection(connstring);

();

SqlDataAdapter da = 情況報告new SqlDataAdapter(sql, conn); DataSet ds = new DataSet();

(ds, "book");

Source = es["book"];

}

private DataTable BindData(string sql)

{

string sql_select = sql;

conn = new SqlConnection(connstring);

SqlDataAdapter ad = new SqlDataAdapter(sql_select, conn); DataSet ds = new DataSet();

(ds, "Book");

return es["Book"];

}

private void all_Click(object sender, EventArgs e)

{

string sql = "select *from book";

conn = new SqlConnection(connstring);

();

SqlDataAdapter da = new SqlDataAdapter(sql, conn);

DataSet ds = new DataSet();

(ds, "book");

Source = es["book"]; }

}

}

五.借書模塊

代碼如下:

using System;

using ric;

using onentModel;

using ;

using lient;

using ing;

using ;

using s;

namespace WindowsApplication1

{

public partial class Form4 : Form

{

protected SqlConnection conn;

protected SqlCommand cmd;

string connstring = @"Data Source=panlunzhao;Initial Catalog=tp:// 班級工作計劃 F;Integrated Security=True";

public Form4()

{

InitializeComponent();

}

private void Form4_Load(object sender, EventArgs e)

{

try

{

conn = new SqlConnection(@"Data

Source=panlunzhao;Initial Catalog=;Integrated

Security=True");

();

Data();

}

catch (Exception exp)

{

("無法建立數據連接:" + age); e();

}

}

protected void InitData()

{

cmd = new SqlCommand("select distinct [ID] from Book order By [ID]", conn);

SqlDataReader reader1 = uteReader();

r();

while (())

(reader1[0]);

e();

cmd = new SqlCommand("select id from reader order by[ID]",conn);

SqlDataReader reader2 = uteReader();

r();

while (())

(reader2[0]);

e();

}

private void select_Click(object sender, EventArgs e) 誠信演講稿 {

string sql = "select * from book where ID='" +

ring() + "'";

conn = new SqlConnection(connstring);

();

SqlCommand cmd = new SqlCommand(sql, conn);

SqlDataReader ds = uteReader();

();

= ds["ISBN"]ring();

= ds["name"]ring();

= ds["author"]ring();

= ds["press"]ring();

= ds["publishdate"]ring();

= ds["price"]ring();

= ds["pages"]ring();

= ds["barcode"]ring();

ked = (bool)ds["cd"];

= ds["storage"]ring();

}

private void jieshu_Click(object sender, EventArgs e) {

string sql = "select * from reader where ID='" + ring() + "'";

conn = new SqlConnection(connstring);

();

SqlDataAdapter da = new SqlDataAdapter(sql, conn); DataSet ds = new DataSet();

(ds, "book");

Source = es["book"];

string sql_up = "book set Storage=Storage-1 where ID='" + ring() + "'";

cmd = new SqlCommand(sql_up, conn);

uteNonQuery();

DataSet hs = new DataSet();

(hs, "book");

Source = es["book"];

if ( == "")

return;

andText = "SELECT * FROM [reader] WHERE [ID]=" + ;

SqlDataReader reader1 = null;

try

{

reader1 = uteReader();

if (())

{

textB 個人工作計劃 = reader1["Name"]ring();

}

else

{

("沒有符合條件的記錄", "提示", , risk);

}

}

catch (Exception exp)

{

("數據訪問錯誤:" + age +

kTrace, "錯誤", , r); }

finally

{

if (reader1 != null && !osed)

e();

}

}

}

}

總結

此次實訓綜合考查了所學的c#知識,讓我知道一個項目從構思、設計、實結題報告現、測試的過程。在實訓中也綜合運用了所學的`知識,也涵蓋了數據庫的知識,用數據庫存放數據,用腳本實現功能。



  • 文章版權屬於文章作者所有,轉載請註明 https://xuewengu.com/flzc/baogao/kkqr3g.html