基于C#的仓库管理系统的设计与实现本科毕业设计论文 下载本文

湖南文理学院本科毕业设计(论文) 第5章 系统实现

图5.2 登录界面

3. 代码设计

public partial class login : Form {

public static string connectionString = \Catalog=Qyfx;Integrated Security=True\

//M_str_sqlcon = \Security=True\

//DateClass.SQL InfData = new Qyfx.DateClass.SQL(); public login() {

InitializeComponent(); }

private void button1_Click(object sender, EventArgs e) {

bool P;

pass Pa = new pass();

P = Pa.Veri(\ if (P) {

MessageBox.Show(\登陆成功!\

-25-

湖南文理学院本科毕业设计(论文) 第5章 系统实现

//this.Close();

stock_MainFrm mfa = new stock_MainFrm(); mfa.Show(); } }

private void button2_Click(object sender, EventArgs e) {

Application.Exit(); }

private void login_Load(object sender, EventArgs e) {

} }

class pass {

public bool Veri(string tb_table, string Id, string Pwd) {

SQL MyClass = new SQL(); bool jud = false;

if (Id != \ {

SqlDataReader temDR = MyClass.getcom(\tb_table + \ jud = temDR.Read(); if (jud) {

SQL.Login_Name = Id.Trim();

SQL.Login_ID = temDR.GetString(0); SQL.My_con.Close(); SQL.My_con.Dispose(); } else {

MessageBox.Show(\用户名或密码错误!\提示\MessageBoxButtons.OK, MessageBoxIcon.Information); }

-26-

湖南文理学院本科毕业设计(论文) 第5章 系统实现

MyClass.con_close(); } else

MessageBox.Show(\请将登录信息添写完整!\提示\MessageBoxButtons.OK, MessageBoxIcon.Information); return jud; } }

5.2 主界面的实现

5.2.1 说明:

此模块实现各分模块的进入。

5.2.2 系统主界面,如图5.3

图5.3系统主界面

5.2.3 代码设计

public partial class stock_MainFrm : Form {

public stock_MainFrm() {

InitializeComponent(); }

private void mnu_Stock_Stock_Click(object sender, EventArgs e) {

-27-

湖南文理学院本科毕业设计(论文) 第5章 系统实现

stock_Stock frm = new stock_Stock(); frm.MdiParent = this; frm.Show(); }

private void stock_MainFrm_Load(object sender, EventArgs e) {

//login frm = new login(); //frm.MdiParent = this; //frm.Show(); }

private void mnu_Stock_PurInStock_Click(object sender, EventArgs e) {

stock_PurInStock frm = new stock_PurInStock(); frm.MdiParent = this; frm.Show(); }

private void mnu_Stock_PurOutStock_Click(object sender, EventArgs e) {

stock_PurOutStock frm = new stock_PurOutStock(); frm.MdiParent =this; frm.Show();

}

private void mnu_Stock_SellOutStock_Click(object sender, EventArgs e) {

stock_SellOutStock frm = new stock_SellOutStock(); frm.MdiParent = this; frm.Show();

}

private void mnu_Stock_SellInStock_Click(object sender, EventArgs e) {

stock_SellInStock frm = new stock_SellInStock(); frm.MdiParent = this; frm.Show();

-28-

湖南文理学院本科毕业设计(论文) 第5章 系统实现

}

private void mnu_Stock_Details_Click(object sender, EventArgs e)

{

stock_StockHistoryDetails frm = new stock_StockHistoryDetails();

frm.MdiParent = this; frm.Show(); }

private void mnu_StockStatistic_Click(object sender, EventArgs e)

{

stock_StockHistoryStatistic frm = new stock_StockHistoryStatistic(); frm.MdiParent = this; frm.Show(); }

private void toolStripButton2_Click(object sender, EventArgs e) {

stock_PurInStock frm = new stock_PurInStock(); frm.MdiParent = this; frm.Show(); }

private void toolStripButton1_Click(object sender, EventArgs e) {

stock_SellOutStock frm = new stock_SellOutStock(); frm.MdiParent = this; frm.Show(); } }

5.3 各分界面的实现

5.3.1 说明

材料、用户、仓库信息的增、删、改等的实现

5.3.2 仓库基本信息管理及代码,如图5.4

-29-