收藏 分销(赏)

仓库管理系统代码模板.doc

上传人:w****g 文档编号:3025377 上传时间:2024-06-13 格式:DOC 页数:44 大小:110.04KB 下载积分:12 金币
下载 相关 举报
仓库管理系统代码模板.doc_第1页
第1页 / 共44页
仓库管理系统代码模板.doc_第2页
第2页 / 共44页


点击查看更多>>
资源描述
ϵͳÖ÷½çÃæ£¨frmMain.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.Diagnostics; namespace warehouse { public partial class frmMain : Form { public frmMain() { InitializeComponent(); } private void frmMain_Load(object sender, EventArgs e) { tsslUser.Text = "²Ù×÷Óû§È¨ÏÞ£º" + frmLogin.M_str_right.ToString().Trim(); tsslDate.Text = DateTime.Today.ToLongDateString(); tsslTime.Text = "µÇ¼ϵͳʱ¼ä£º" + DateTime.Now.ToShortTimeString(); if (frmLogin.M_str_right.ToString().Trim() == "ÆÕͨÓû§") { Èë¿â¹ÜÀíToolStripMenuItem.Enabled = false; ³ö¿â¹ÜÀíToolStripMenuItem.Enabled = false; ½è»õ»¹»õToolStripMenuItem.Enabled = false; ¹©»õÉÌÉèÖÃToolStripMenuItem.Enabled = false; »õÎïµµ°¸ÉèÖÃToolStripMenuItem.Enabled = false; ²Ö¿âÉèÖÃToolStripMenuItem.Enabled = false; ȨÏÞÉèÖÃToolStripMenuItem.Enabled = false; Óû§¹ÜÀíToolStripMenuItem.Enabled = false; btnIS.Enabled = false; btnOS.Enabled = false; btnBR.Enabled = false; btnPI.Enabled = false; btnGI.Enabled = false; btnSI.Enabled = false; btnRI.Enabled = false; btnUM.Enabled = false; } } private void btnIS_Click(object sender, EventArgs e)//Èë¿â¹ÜÀí { GoodsManage.frmISManage GMfism = new warehouse.GoodsManage.frmISManage(); //GMfism.Show(); GMfism.ShowDialog();//ÕâÁ½¸öº¯Êý¾Í¿´Ë­»ñµÃ½¹µã£¬Ç°Õ߸¸´°¿ÚÒ²¿É»ñµÃ½¹µã£¬ºóÕßÖ»ÓÐд´½¨µÄ´°Ìå } private void btnOS_Click(object sender, EventArgs e)//³ö¿â¹ÜÀí { GoodsManage.frmOSManage GMfosm = new warehouse.GoodsManage.frmOSManage(); GMfosm.ShowDialog(); } private void btnBR_Click(object sender, EventArgs e)//½è»õ»¹»õ¹ÜÀí { GoodsManage.frmBGManage GMfbgm = new warehouse.GoodsManage.frmBGManage(); GMfbgm.ShowDialog(); } private void btnPI_Click(object sender, EventArgs e)//¹©Ó¦ÉÌÉèÖà { BasicInfo.frmPrInfo BIfpi = new warehouse.BasicInfo.frmPrInfo(); BIfpi.ShowDialog(); } private void btnGI_Click(object sender, EventArgs e)//»õÎïµµ°¸ÉèÖà { BasicInfo.frmGoodsInfo BIfgi = new warehouse.BasicInfo.frmGoodsInfo(); BIfgi.ShowDialog(); } private void btnSI_Click(object sender, EventArgs e)//²Ö¿âÉèÖà { BasicInfo.frmStoreInfo BIfsi = new warehouse.BasicInfo.frmStoreInfo(); BIfsi.ShowDialog(); } private void btnISL_Click(object sender, EventArgs e)//Èë¿â²éѯ { LookandSum.frmISLook LSfisl = new warehouse.LookandSum.frmISLook(); LSfisl.ShowDialog(); } private void btnSL_Click(object sender, EventArgs e)//¿â´æ²éѯ { LookandSum.frmGILook LSfgil = new warehouse.LookandSum.frmGILook(); LSfgil.ShowDialog(); } private void btnGOL_Click(object sender, EventArgs e)//»õÎï½è³ö²éѯ { LookandSum.frmBGLook LSfbgl = new warehouse.LookandSum.frmBGLook(); LSfbgl.ShowDialog(); } private void btnGIL_Click(object sender, EventArgs e)//»õÎï¹é»¹²éѯ { LookandSum.frmRGLook LSfrgl = new warehouse.LookandSum.frmRGLook(); LSfrgl.ShowDialog(); } private void btnOSL_Click(object sender, EventArgs e)//³ö¿â²éѯ { LookandSum.frmOSLook LSfosl = new warehouse.LookandSum.frmOSLook(); LSfosl.ShowDialog(); } private void btnEP_Click(object sender, EventArgs e)//¸ü¸ÄÃÜÂë { SystemSet.frmEditPwd HPfep = new warehouse.SystemSet.frmEditPwd(); HPfep.ShowDialog(); } private void btnRI_Click(object sender, EventArgs e)//ȨÏÞ¹ÜÀí { SystemSet.frmRightManage HPfrm = new warehouse.SystemSet.frmRightManage(); HPfrm.ShowDialog(); } private void btnUM_Click(object sender, EventArgs e)//Óû§¹ÜÀí { SystemSet.frmUserManage HPfum = new warehouse.SystemSet.frmUserManage(); HPfum.ShowDialog(); } private void btnAU_Click(object sender, EventArgs e)//¹ØÓÚ±¾ÏµÍ³ { SystemSet.frmAboutUs HPfau = new warehouse.SystemSet.frmAboutUs(); HPfau.ShowDialog(); } private void btnCH_Click(object sender, EventArgs e) { if (MessageBox.Show("ÄãÕæµÄҪעÏúµ±Ç°Óû§", "Ìáʾ", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { warehouse.frmLogin frmlogin = new frmLogin(); this.Hide(); frmlogin.Show(); } } private void btnExit_Click(object sender, EventArgs e)//Í˳öϵͳ { this.Close();//<=>Application.Exit(); } private void frmMain_FormClosed(object sender, FormClosedEventArgs e) { if (MessageBox.Show("ÄúÕæµÄÒªÍ˳ö±¾ÏµÍ³Âð£¿", "Ìáʾ", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { Application.Exit(); } else { frmMain fmain = new frmMain(); fmain.Show(); } } private void Èë¿â¹ÜÀíToolStripMenuItem_Click(object sender, EventArgs e) { btnIS_Click(sender, e); } private void ³ö¿â¹ÜÀíToolStripMenuItem_Click(object sender, EventArgs e) { btnOS_Click(sender,e); } private void ½è»õ»¹»õToolStripMenuItem_Click(object sender, EventArgs e) { btnBR_Click(sender, e); } private void ¹©»õÉÌÉèÖÃToolStripMenuItem_Click(object sender, EventArgs e) { btnPI_Click(sender, e); } private void »õÎïµµ°¸ÉèÖÃToolStripMenuItem_Click(object sender, EventArgs e) { btnGI_Click(sender, e); } private void ²Ö¿âÉèÖÃToolStripMenuItem_Click(object sender, EventArgs e) { btnSI_Click(sender, e); } private void ¿â´æ²éѯToolStripMenuItem_Click(object sender, EventArgs e) { btnSL_Click(sender, e); } private void Èë¿â²éѯToolStripMenuItem_Click(object sender, EventArgs e) { btnISL_Click(sender, e); } private void ³ö¿â²éѯToolStripMenuItem_Click(object sender, EventArgs e) { btnOSL_Click(sender, e); } private void »õÎï½è³ö²éѯToolStripMenuItem_Click(object sender, EventArgs e) { btnGOL_Click(sender, e); } private void »õÎï¹é»¹²éѯToolStripMenuItem_Click(object sender, EventArgs e) { btnGIL_Click(sender, e); } private void ¸ü¸ÄÃÜÂëToolStripMenuItem_Click(object sender, EventArgs e) { btnEP_Click(sender, e); } private void ȨÏÞÉèÖÃToolStripMenuItem_Click(object sender, EventArgs e) { btnRI_Click(sender, e); } private void Óû§¹ÜÀíToolStripMenuItem_Click(object sender, EventArgs e) { btnUM_Click(sender, e); } private void ¹ØÓÚ±¾ÏµÍ³ToolStripMenuItem_Click(object sender, EventArgs e) { btnAU_Click(sender, e); } private void »õÎï¹ÜÀíToolStripMenuItem_Click(object sender, EventArgs e) { tabControl1.SelectedIndex = 0; } private void »ù±¾µµ°¸ToolStripMenuItem_Click(object sender, EventArgs e) { tabControl1.SelectedIndex = 1; } private void ²éѯͳ¼ÆToolStripMenuItem_Click(object sender, EventArgs e) { tabControl1.SelectedIndex = 2; } private void ϵͳÉèÖÃToolStripMenuItem_Click(object sender, EventArgs e) { tabControl1.SelectedIndex = 3; } private void ×¢ÏúToolStripMenuItem_Click(object sender, EventArgs e) { btnCH_Click(sender, e); } private void Í˳öϵͳToolStripMenuItem_Click(object sender, EventArgs e) { btnExit_Click(sender, e); } private void toolStripStatusLabel6_Click(object sender, EventArgs e) { System.Diagnostics.Process.Start(""); } } ¡¡¡¡} »õÎïµµ°¸¹ÜÀí£¨Èë¿â frmInManage.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; namespace warehouse.GoodsManage { public partial class frmISManage : Form { warehouse.BaseClass.DataCon datacon = new warehouse.BaseClass.DataCon(); warehouse.BaseClass.DataOperate doperate = new warehouse.BaseClass.DataOperate(); public frmISManage() { InitializeComponent(); } private void frmISManage_Load(object sender, EventArgs e) { dgvISManage.Controls.Add(hScrollBar1);//Êý¾ÝÔ´¿Ø¼þÖÐÌí¼ÓÁËÒ»¸öˮƽ¹ö¶¯Ìõ doperate.cboxBind("select StoreName from tb_Storage", "tb_Storage", "StoreName", cboxSName);//²Ö¿âÃû×ÖÏÔʾ³öÀ´ doperate.cboxBind("select PrName from tb_Provider", "tb_Provider", "PrName", cboxPName);//¼ÆÁ¿µ¥Î»ÏÔʾ³öÀ´ DataSet myds = datacon.getds("select ISID as Èë¿â±àºÅ,GoodsID as »õÎï±àºÅ,GoodsName as »õÎïÃû³Æ,PrName as ¹©Ó¦ÉÌÃû³Æ," + "StoreName as ²Ö¿âÃû³Æ,GoodsSpec as »õÎï¹æ¸ñ,GoodsUnit as ¼ÆÁ¿µ¥Î»,GoodsNum as Èë¿âÊýÁ¿," + "GoodsPrice as »õÎïµ¥¼Û,GoodsAPrice as ×ܽð¶î,ISDate as Èë¿âÈÕÆÚ,HandlePeople as ¾­ÊÖ," + "ISRemark as ±¸×¢from tb_InStore", "tb_InStore"); dgvISManage.DataSource = myds.Tables[0];//datasetÖеĵÚÒ»¸ödatatable 0<=>"tb_InStore" } private void btnAdd_Click(object sender, EventArgs e) { if (txtISGID.Text == "") { MessageBox.Show("»õÎï±àºÅ²»ÄÜΪ¿Õ£¡", "ÐÅÏ¢", MessageBoxButtons.OK, MessageBoxIcon.Information); } if (txtISGName.Text == "") { MessageBox.Show("»õÎïÃû³Æ²»ÄÜΪ¿Õ", "ÐÅÏ¢", MessageBoxButtons.OK, MessageBoxIcon.Information); } if (txtGIPrice.Text == "") { MessageBox.Show("»õÎïµ¥¼Û²»ÄÜΪ¿Õ£¡", "ÐÅÏ¢", MessageBoxButtons.OK, MessageBoxIcon.Information); } if (txtISGNum.Text == "") { MessageBox.Show("Èë¿âÊýÁ¿²»ÄÜΪ¿Õ", "ÐÅÏ¢", MessageBoxButtons.OK, MessageBoxIcon.Information); } if (txtGSpec.Text == "") { MessageBox.Show("»õÎï¹æ¸ñ²»ÄÜΪ¿Õ", "ÐÅÏ¢", MessageBoxButtons.OK, MessageBoxIcon.Information); } if (txtHPeople.Text == "") { MessageBox.Show("¾­ÊÖ²»ÄÜΪ¿Õ", "ÐÅÏ¢", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { int P_int_returnValue = doperate.InsertGoods(Convert.ToInt32(txtISGID.Text.Trim()), txtISGName.Text.Trim(), cboxPName.Text.Trim(), cboxSName.Text.Trim(), txtGSpec.Text.Trim(), cboxGUnit.Text.Trim(), Convert.ToInt32(txtISGNum.Text.Trim()), Convert.ToDecimal(txtGIPrice.Text.Trim()), txtHPeople.Text.Trim(), txtISRemark.Text.Trim()); if (P_int_returnValue == 100) { MessageBox.Show("¸Ã»õÎïºÅÒѾ­±»Õ¼Óã¡", "ÐÅÏ¢", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (P_int_returnValue == 200) { MessageBox.Show("ÕâÀà»õÎïÒѾ­´æÔÚΩһ±àºÅ£¡", "ÐÅÏ¢", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("»õÎïÈë¿â³É¹¦£¡", "ÐÅÏ¢", MessageBoxButtons.OK, MessageBoxIcon.Information); frmISManage_Load(sender, e); } } } private void btnDel_Click(object sender, EventArgs e) { // try // { //ɾ³ýÏÂÃæÊý¾ÝÔ´¿Ø¼þÖеģ¬Ö¸Ê¾µÄÊý¾ÝÏî datacon.getcom("delete from tb_InStore where ISID=" + Convert.ToString(dgvISManage[0, dgvISManage.CurrentCell.RowIndex].Value).Trim() + ""); //Convert.ToString(dataGridView1[1,dataGridView1.CurrentCell.RowIndex].Value).Trim(); // À´È¡µÃËùÑ¡ÖеÄÄÇÐÐÊý¾ÝijÁеÄÖµ... MessageBox.Show("»õÎïɾ³ý³É¹¦£¡", "ÐÅÏ¢", MessageBoxButtons.OK, MessageBoxIcon.Information); frmISManage_Load(sender, e); //} //catch (Exception ex) //{ // MessageBox.Show(ex.Message, "¾¯¸æ", MessageBoxButtons.OK, MessageBoxIcon.Warning); //} } private void btnExit_Click(object sender, EventArgs e) { this.Close(); } private void dgvISManage_CellClick(object sender, DataGridViewCellEventArgs e) /*datagridview¿Ø¼þÓÐÒ»¸öCellClickʼþÊǵ±µ¥»÷datagridview¿Ø¼þµÄÈÎÒⲿ·ÖÊÇ·¢Éú.È»ºóÔÙÓà Convert.ToString(dataGridView1[1,dataGridView1.CurrentCell.RowIndex].Value).Trim(); À´È¡µÃËùÑ¡ÖеÄÄÇÐÐÊý¾ÝijÁеÄÖµ*/ { txtISGID.Text = Convert.ToString(dgvISManage[1,dgvISManage.CurrentCell.RowIndex].Value).Trim(); txtISGName.Text = Convert.ToString(dgvISManage[2, dgvISManage.CurrentCell.RowIndex].Value).Trim(); cboxSName.Text = Convert.ToString(dgvISManage[4, dgvISManage.CurrentCell.RowIndex].Value).Trim(); cboxPName.Text = Convert.ToString(dgvISManage[3, dgvISManage.CurrentCell.RowIndex].Value).Trim(); txtGSpec.Text = Convert.ToString(dgvISManage[5, dgvISManage.CurrentCell.RowIndex].Value).Trim(); cboxGUnit.Text = Convert.ToString(dgvISManage[6, dgvISManage.CurrentCell.RowIndex].Value).Trim(); txtISGNum.Text = Convert.ToString(dgvISManage[7, dgvISManage.CurrentCell.RowIndex].Value).Trim(); txtGIPrice.Text = Convert.ToString(dgvISManage[8, dgvISManage.CurrentCell.RowIndex].Value).Trim(); txtGSPrice.Text = Convert.ToString(dgvISManage[9, dgvISManage.CurrentCell.RowIndex].Value).Trim(); txtHPeople.Text = Convert.ToString(dgvISManage[11, dgvISManage.CurrentCell.RowIndex].Value).Trim(); txtISRemark.Text = Convert.ToString(dgvISManage[12, dgvISManage.CurrentCell.RowIndex].Value).Trim(); } private void txtGIPrice_TextChanged(object sender, EventArgs e) { try { txtGSPrice.Text = Convert.ToString(Convert.ToDecimal(txtGIPrice.Text.Trim()) * Convert.ToInt32(txtISGNum.Text.Trim())).Trim(); //Convert.ToDecimal(txtGIPrice.Text.Trim())½«Îı¾Öµ×ªÎªDecimalÊýÖµ //½«Êý×ÖµÄÖ¸¶¨String ±íʾÐÎʽת»»ÎªµÈЧµÄDecimal Êý×Ö¡£ } catch (Exception ex) { MessageBox.Show(ex.Message, "¾¯¸æ", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } private void frmISManage_FormClosed(object sender, FormClosedEventArgs e) { this.Close(); } private void button1_Click(object sender, EventArgs e) { this.txtGIPrice.Text = ""; this.txtGSpec.Text = ""; this.txtHPeople.Text = ""; this.txtISGID.Text = ""; this.txtISGName.Text = ""; this.txtISGNum.Text = ""; this.txtISRemark.Text = ""; this.txtGIPrice.Text = ""; this.txtGSPrice.Text = ""; } } ¡¡¡¡} ³ö¿â¹ÜÀí£¨frmOsManage.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; namespace warehouse.GoodsManage { public partial class frmOSManage : Form { warehouse.BaseClass.DataCon datacon = new warehouse.BaseClass.DataCon(); warehouse.BaseClass.DataOperate doperate = new warehouse.BaseClass.DataOperate(); public frmOSManage() { InitializeComponent(); } private void frmOSManage_Load(object sender, EventArgs e) { dgvOSManage.Controls.Add(hScrollBar1); doperate.cboxBind("select distinct StoreName from tb_InStore", "tb_InStore", "StoreName", cboxSName); DataSet myds = datacon.getds("select OSID as ³ö¿â±àºÅ,StoreName as ²Ö¿âÃû³Æ,GoodsName as »õÎïÃû³Æ," + "GoodsSpec as ¹æ¸ñ,GoodsUnit as ¼ÆÁ¿µ¥Î»,GoodsNum as ³ö¿âÊýÁ¿,GoodsPrice as ¼Û¸ñ,GoodsAPrice as ×ܽð¶î," + "OSDate as ³ö¿âÈÕÆÚ,PGProvider as Ìá»õµ¥Î»,PGPeople as Ìá»õ," + "HandlePeople as ¾­ÊÖ,OSRemark as ±¸×¢from tb_OutStore", "tb_OutStore"); dgvOSManage.DataSource = myds.Tables["tb_OutStore"]; } private void btnAdd_Click(object sender, EventArgs e) { try { SqlDataReader sqlread = datacon.getread("select GoodsNum from tb_GoodsInfo" + " where StoreName='" + cboxSName.Text.Trim() + "' and GoodsName='" + cboxGName.Text.Trim() + "' and GoodsSpec='" + cboxGSpec.Text.Trim() + "'"); if (sqlread.Read()) { if (Convert.ToInt32(txtOSGNum.Text.Trim()) > Convert.ToInt32(sqlread["GoodsNum"].ToString().Trim())) { MessageBox.Show("²Ö¿âÖÐûÓÐ×ã¹»µÄ»õÎ", "Ìáʾ", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { datacon.getcom("insert into tb_OutStore(StoreName,GoodsName,GoodsSpec,GoodsUnit," + GoodsNum,GoodsPrice,PGProvider,PGPeople,HandlePeople,OSRemark)" + " values('" + cboxSName.Text.Trim() + "','" + cboxGName.Text.Trim() + "','" + cboxGSpec.Text.Trim() + "','" + cboxGUnit.Text.Trim() + "',"+ txtOSGNum.Text.Trim() + "," + txtGOPrice.Text.Trim() + ",'" + txtOSUnit.Text.Trim() + "','" +txtOSPeople.Text.Trim() + "','" + txtHPeople.Text.Trim() + "','" + txtOSRemark.Text.Trim() + "')"); MessageBox.Show("»õÎï³ö¿â³É¹¦£¡", "ÐÅÏ¢", MessageBoxButtons.OK, MessageBoxIcon.Information); frmOSManage_Loa
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服