2024年4月14日发(作者:)
.
系统主函数()
using System;
using c;
using ;
namespace warehouse
{
static class Program
{
///
/// 应用程序的主入口点。
///
[STAThread]
static void Main()
{
VisualStyles();
patibleTextRenderingDefault(false);
(new frmLogin());//运行一个登陆对象
}
}
}
集的常规信息
using tion;
using e pilerServices;
using pServices;
// 有关程序集的常规信息通过下列属性集
// 控制。更改这些属性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("warehouse")]
[assembly: AssemblyDescription("")]
1 / 74
.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("warehouse")]
[assembly: AssemblyCopyright("所有 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 属性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("063bd674-c4cc-4dc9-81ee-3791409e9189")]
// 程序集的版本信息由下面个值组成:
// 主版本
// 次版本
// 部版本号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
数据库连接类():
using System;
using c;
using ;
using ;
using ent;
namespace ass
{
class DataCon
{
#region 建立数据库连接
///
/// 建立数据库连接.
///
///
public SqlConnection getcon()
{
2 / 74
.
string M_str_sqlcon = "Data
Source=(local);Database=db_warehouse;user id=sa;pwd= ";
SqlConnection myCon = new SqlConnection(M_str_sqlcon);
return myCon;
}
#endregion
#region 执行SqlCommand命令
///
/// 执行SqlCommand
///
/// SQL语句
public void getcom(string M_str_sqlstr)
{
SqlConnection sqlcon = ();
();
SqlCommand sqlcom = new SqlCommand(M_str_sqlstr, sqlcon);
eNonQuery();//返回受影响的行数
e();
();
e();
}
#endregion
#region 创建DataSet对象 读取数据
///
/// 创建一个DataSet对象
///
/// SQL语句
/// 表名
///
public DataSet getds(string M_str_sqlstr, string M_str_table)
{
SqlConnection sqlcon = ();
();
SqlDataAdapter sqlda = new SqlDataAdapter(M_str_sqlstr, sqlcon);
DataSet myds = new DataSet();
(myds, M_str_table);
return myds;
}
3 / 74
.
#endregion
#region 创建SqlDataReader对象 读取数据
///
/// 创建一个SqlDataReader对象
///
/// SQL语句
///
public SqlDataReader getread(string M_str_sqlstr)
{
SqlConnection sqlcon = ();
SqlCommand sqlcom = new SqlCommand(M_str_sqlstr, sqlcon);
();
SqlDataReader sqlread =
eReader(onnection);//方法的参数表示如果关闭
关联的对象sqlread则关联的连接sqlcon也关闭了
return sqlread;
}
#endregion
}
}
数据库操作类():
using System;
using c;//命名空间包含定义泛型集合的接口和类,泛型
集合允许用户创建强类型集合,它能提供比非泛型强类型集合21的类型安全性和性能
using ;// 命名空间包含表示 ASCII、Unicode、UTF-7 和
UTF-8 字符编码的类;用于将字符块转换为字节块和将字节块转换为字符块的抽象基类;以
与操作和格式化 String 对象而不创建 String 的中间实例的 Helper 类.
using ;
using ;
using ent;
using tions;
//using g;//命名空间提供了对GDI+ 基本图形功能的访问.
using ;//提供用于创建、复制、删除、移动和打开文件的静态方法,并协助
创建FileStream 对象
using pression;//里面包括两个类GzipStream和DeflaterStream,它
们都可以用于解压缩,但是不支持ZIP、RAR等常用的压缩文件,
using ;
//using g2D;//命名空间提供高级的二维和矢量图形功能.
4 / 74
.
using g;//为源自 Bitmap 和 Metafile 的类提供功能的抽象
基类。
using rExpressions;//命名空间包含一些类,这些类提供对.NET
Framework 正则表达式引擎的访问。该命名空间提供正则表达式功能
namespace ass
{
class DataOperate
{
DataCon datacon = new DataCon();//声明DataCon类的一个对象,以调用其
方法
#region 绑定ComboBox控件
///
/// 对ComboBox控件进行数据绑定
///
/// SQL语句
/// 表名
/// 数据表中字段名
/// ComboBox控件ID
public void cboxBind(string M_str_sqlstr, string M_str_table, string
M_str_tbMember, ComboBox cbox)
{
DataSet myds = (M_str_sqlstr, M_str_table);
urce = [M_str_table];
yMember = M_str_tbMember;//显示username字段
}
#endregion
#region 验证文本框输入为数字
///
/// 验证文本框输入为数字
///
/// 输入字符
///
public bool validateNum(string M_str_num)
{
return h(M_str_num, "^[0-9]*$");
}
5 / 74
.
#endregion
#region 验证文本框输入为
///
/// 验证文本框输入为
///
/// 输入字符串
///
public bool validatePhone(string M_str_phone)
{
return h(M_str_phone, "d{3,4}-d{7,8}");
}
#endregion
#region 验证文本框输入为
///
/// 验证文本框输入为
///
/// 输入字符串
///
public bool validateFax(string M_str_fax)
{
return h(M_str_fax, "86-d{2,3}-d{7,8}");
}
#endregion
#region 用户登录
///
/// 用户登录
///
/// 用户名
/// 用户密码
///
public int UserLogin(string P_str_UserName, string P_str_UserPwd)
{
SqlConnection sqlcon = ();
SqlCommand sqlcom = new SqlCommand("proc_Login", sqlcon);
sqlcom mandType = Procedure;
("UserName", r, 20).Value =
P_str_UserName;
6 / 74
.
("UserPwd", r, 20).Value =
P_str_UserPwd;
SqlParameter returnValue = ("returnValue",
, 4);
ion = Value;//返回
值??
();
try
{
eNonQuery();
}
catch (Exception ex)
{
(e);
}
finally
{
e();
();
e();
}
int P_int_returnValue = (int);
return P_int_returnValue;
}
#endregion
#region 货物入库
///
/// 货物入库
///
/// 货物编号
/// 货物名称
/// 供应商名称
/// 仓库名称
/// 货物规格
/// 计量单位
/// 进货数量
/// 货物单价
/// 经手
7 / 74
.
/// 备注
///
public int InsertGoods(int P_int_GoodsID,string
P_str_GoodsName,string P_str_PrName,string P_str_StoreName,
string P_str_GoodsSpec,string P_str_GoodsUnit,int
P_int_GoodsNum,decimal P_dml_GoodsPrice,string P_str_HPeople,string
P_str_Remark)
{
SqlConnection sqlcon = ();
SqlCommand sqlcom = new SqlCommand("proc_insertInStore", sqlcon);
sqlcom mandType = Procedure;
("GoodsID", ).Value =
P_int_GoodsID;
("GoodsName", r, 50).Value
= P_str_GoodsName;
("PrName", r, 100).Value =
P_str_PrName;
("StoreName", r, 100).Value
= P_str_StoreName;
("GoodsSpec", r, 50).Value
= P_str_GoodsSpec;
("GoodsUnit", , 8).Value =
P_str_GoodsUnit;
("GoodsNum", ).Value =
P_int_GoodsNum;
("GoodsPrice", ).Value =
P_dml_GoodsPrice;
("HandlePeople", r,
20).Value = P_str_HPeople;
("ISRemark", r, 1000).Value
= P_str_Remark;
SqlParameter returnValue = ("returnValue",
, 4);
ion = Value;
();
try
{
eNonQuery();
8 / 74
.
}
catch (Exception ex)
{
(e);
}
finally
{
e();
();
e();
}
int P_int_returnValue = (int);
return P_int_returnValue;
}
#endregion
#region 添加供应商信息
///
/// 添加供应商信息
///
/// 供应商名称
/// 负责
/// 供应商联系
/// 供应商
/// 备注
///
public int InsertProvider(string P_str_PrName, string P_str_PrPeople,
string P_str_PrPhone, string P_str_PrFax, string P_int_PrRemark)
{
SqlConnection sqlcon = ();
SqlCommand sqlcom = new SqlCommand("proc_insertProvider",
sqlcon);
sqlcom mandType = Procedure;
("PrName", r, 100).Value =
P_str_PrName;
("PrPeople", r, 20).Value =
P_str_PrPeople;
("PrPhone", r, 20).Value =
P_str_PrPhone;
9 / 74
.
("PrFax", r, 20).Value =
P_str_PrFax;
("PrRemark", r, 1000).Value
= P_int_PrRemark;
SqlParameter returnValue = ("returnValue",
, 4);
ion = Value;
();
try
{
eNonQuery();
}
catch (Exception ex)
{
(e);
}
finally
{
e();
();
e();
}
int P_int_returnValue = (int);
return P_int_returnValue;
}
#endregion
#region 添加仓库信息
///
/// 添加仓库信息
///
/// 仓库名称
/// 仓库负责
/// 仓库
/// 仓库所属单位
/// 备注
///
10 / 74
.
public int InsertStorage(string P_str_StoreName, string
P_str_StorePeople, string P_str_StorePhone, string P_str_StoreUnit, string
P_int_StoreRemark)
{
SqlConnection sqlcon = ();
SqlCommand sqlcom = new SqlCommand("proc_insertStorage", sqlcon);
sqlcom mandType = Procedure;
("StoreName", r, 100).Value
= P_str_StoreName;
("StorePeople", r,
20).Value = P_str_StorePeople;
("StorePhone", r, 20).Value
= P_str_StorePhone;
("StoreUnit", r, 100).Value
= P_str_StoreUnit;
("StoreRemark", r,
1000).Value = P_int_StoreRemark;
SqlParameter returnValue = ("returnValue",
, 4);
ion = Value;
();
try
{
eNonQuery();
}
catch (Exception ex)
{
(e);
}
finally
{
e();
();
e();
}
int P_int_returnValue = (int);
return P_int_returnValue;
}
11 / 74
.
#endregion
#region 添加新用户
///
/// 添加新用户
///
/// 用户名
/// 用户密码
/// 用户权限
///
public int InsertUser(string P_str_UserName, string P_str_UserPwd,
string P_str_UserRight)
{
SqlConnection sqlcon = ();
SqlCommand sqlcom = new SqlCommand("proc_insertUser",sqlcon);
sqlcom mandType = Procedure;
("UserName", r, 20).Value =
P_str_UserName;
("UserPwd", r, 20).Value =
P_str_UserPwd;
("UserRight", , 10).Value =
P_str_UserRight;
SqlParameter returnValue = ("returnValue",
, 4);
ion = Value;
();
try
{
eNonQuery();
}
catch (Exception ex)
{
(e);
}
finally
{
e();
();
e();
12 / 74
.
}
int P_int_returnValue = (int);
return P_int_returnValue;
}
#endregion
#region 修改用户信息
///
/// 修改用户信息
///
/// 用户编号
/// 用户密码
/// 用户权限
///
public void updateUser(int P_int_UID,string P_str_UserPwd, string
P_str_UserRight)
{
SqlConnection sqlcon = ();
SqlCommand sqlcom = new SqlCommand("proc_updateUser", sqlcon);
sqlcom mandType = Procedure;
("UserID", ).Value =
P_int_UID;
("UserPwd", r, 20).Value =
P_str_UserPwd;
("UserRight", , 10).Value =
P_str_UserRight;
();
try
{
eNonQuery();
}
catch (Exception ex)
{
(e);
}
finally
{
e();
();
13 / 74
.
e();
}
}
#endregion
}
}
登陆界面()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
using ent;
namespace warehouse
{
public partial class frmLogin : Form
{
public static string M_str_name;//记录登录用户名字
public static string M_str_pwd;//记录登录用户密码
public static string M_str_right;//记录登录用户的权限
n datacon = new n();
erate doperate = new
erate();
public frmLogin()
{
InitializeComponent();
}
private void frmLogin_Load(object sender, EventArgs e)//窗口打开就
加载的信息
{
nd("select UserName from tb_User", "tb_User",
"UserName", cboxUName);
d("select UserPwd from tb_User where UserName='" +
+ "'", txtPwd);
}
private void btnLogin_Click(object sender, EventArgs e)
14 / 74
.
{
int P_int_returnValue = gin((),
());
if (P_int_returnValue == 100)
{
M_str_name = ();
M_str_pwd = ();
frmMain fmain = new frmMain();
();//this就是frmloginfmain
();
}
if (P_int_returnValue == -100)
{
("用户名或密码错误!", "提示",
, ation);
= "";
();
}
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void cboxUName_SelectedIndexChanged(object sender, EventArgs
e)
{
SqlDataReader sqlread = d("select
UserName,UserRight from tb_User where UserName='" + + "'");
if (())
{
= sqlread["UserRight"].ToString();
M_str_right = ;
d("select UserPwd from tb_User where UserName='" +
+ "'", txtPwd);
}
();
}
15 / 74
.
private void frmLogin_FormClosing(object sender, FormClosingEventArgs e)
{
();
}
}
}
系统主界面()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
using stics;
namespace warehouse
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}
private void frmMain_Load(object sender, EventArgs e)
{
= "操作用户权限:" +
frmLogin.M_str_ng().Trim();
= DateString();
= "登录系统时间:" + tTimeString();
if (frmLogin.M_str_ng().Trim() == "普通用户")
{
入库管理d = false;
出库管理d = false;
借货还货d = false;
供货商设置d = false;
货物档案设置d = false;
仓库设置d = false;
权限设置d = false;
16 / 74
.
用户管理d = false;
d = false;
d = false;
d = false;
d = false;
d = false;
d = false;
d = false;
d = false;
}
}
private void btnIS_Click(object sender, EventArgs e)//入库管理
{
anage GMfism = new
anage();
//();
alog();//这两个函数就看谁获得焦点,前者父窗口也可获得焦
点,后者只有新创建的窗体
}
private void btnOS_Click(object sender, EventArgs e)//出库管理
{
anage GMfosm = new
anage();
alog();
}
private void btnBR_Click(object sender, EventArgs e)//借货还货管理
{
anage GMfbgm = new
anage();
alog();
}
private void btnPI_Click(object sender, EventArgs e)//供应商设置
{
nfo BIfpi = new nfo();
alog();
}
private void btnGI_Click(object sender, EventArgs e)//货物档案设置
{
17 / 74
.
dsInfo BIfgi = new
dsInfo();
alog();
}
private void btnSI_Click(object sender, EventArgs e)//仓库设置
{
reInfo BIfsi = new
reInfo();
alog();
}
private void btnISL_Click(object sender, EventArgs e)//入库查询
{
ook LSfisl = new ook();
alog();
}
private void btnSL_Click(object sender, EventArgs e)//库存查询
{
ook LSfgil = new ook();
alog();
}
private void btnGOL_Click(object sender, EventArgs e)//货物借出查
询
{
ook LSfbgl = new ook();
alog();
}
private void btnGIL_Click(object sender, EventArgs e)//货物归还查询
{
ook LSfrgl = new ook();
alog();
}
private void btnOSL_Click(object sender, EventArgs e)//出库查询
{
ook LSfosl = new ook();
alog();
}
private void btnEP_Click(object sender, EventArgs e)//更改密码
{
18 / 74
.
tPwd HPfep = new tPwd();
alog();
}
private void btnRI_Click(object sender, EventArgs e)//权限管理
{
htManage HPfrm = new
htManage();
alog();
}
private void btnUM_Click(object sender, EventArgs e)//用户管理
{
rManage HPfum = new
rManage();
alog();
}
private void btnAU_Click(object sender, EventArgs e)//关于本系统
{
utUs HPfau = new utUs();
alog();
}
private void btnCH_Click(object sender, EventArgs e)
{
if (("你真的要注销当前用户", "提示",
el, ation) == )
{
in frmlogin = new frmLogin();
();
();
}
}
private void btnExit_Click(object sender, EventArgs e)//退出系统
{
();//<=>();
}
private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
{
if (("您真的要退出本系统吗?", "提示",
el, ation) == )
19 / 74
.
{
();
}
else
{
frmMain fmain = new frmMain();
();
}
}
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);
20 / 74
.
}
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)
{
21 / 74
.
edIndex = 0;
}
private void 基本档案ToolStripMenuItem_Click(object sender, EventArgs e)
{
edIndex = 1;
}
private void 查询统计ToolStripMenuItem_Click(object sender, EventArgs e)
{
edIndex = 2;
}
private void 系统设置ToolStripMenuItem_Click(object sender,
EventArgs e)
{
edIndex = 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)
{
}
}
}
货物档案管理(入库 )
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
using ent;
22 / 74
.
namespace anage
{
public partial class frmISManage : Form
{
n datacon = new n();
erate doperate = new
erate();
public frmISManage()
{
InitializeComponent();
}
private void frmISManage_Load(object sender, EventArgs e)
{
(hScrollBar1);//数据源控件中添加了一个水平
滚动条
nd("select StoreName from tb_Storage", "tb_Storage",
"StoreName", cboxSName);//仓库名字显示出来
nd("select PrName from tb_Provider", "tb_Provider",
"PrName", cboxPName);//计量单位显示出来
DataSet myds = ("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");
urce = [0];//dataset中的第一个datatable
0<=>"tb_InStore"
}
private void btnAdd_Click(object sender, EventArgs e)
{
if ( == "")
{
("货物编号不能为空!", "信息",
, ation);
}
23 / 74
.
if ( == "")
{
("货物名称不能为空", "信息", ,
ation);
}
if ( == "")
{
("货物单价不能为空!", "信息", ,
ation);
}
if ( == "")
{
("入库数量不能为空", "信息", ,
ation);
}
if ( == "")
{
("货物规格不能为空", "信息", ,
ation);
}
if ( == "")
{
("经手不能为空", "信息", ,
ation);
}
else
{
int P_int_returnValue =
Goods(32(()),
(),
(), (),
(), (),
32(()),
mal(()), (),
());
if (P_int_returnValue == 100)
{
("该货物号已经被占用!", "信息",
24 / 74
.
, ation);
}
else if (P_int_returnValue == 200)
{
("这类货物已经存在惟一编号!", "信息",
, ation);
}
else
{
("货物入库成功!", "信息",
, ation);
frmISManage_Load(sender, e);
}
}
}
private void btnDel_Click(object sender, EventArgs e)
{
// try
// {
//删除下面数据源控件中的,指示的数据项
("delete from tb_InStore where ISID="
+ ng(dgvISManage[0,
ex].Value).Trim() + "");
//ng(dataGridView1[1,ex].Value).T
rim();
// 来取得所选中的那行数据某列的值...
("货物删除成功!", "信息", ,
ation);
frmISManage_Load(sender, e);
//}
//catch (Exception ex)
//{
// (e, "警告", ,
g);
//}
}
private void btnExit_Click(object sender, EventArgs e)
25 / 74
.
{
();
}
private void dgvISManage_CellClick(object sender, DataGridViewCellEventArgs
e)
/*datagridview控件有一个CellClick事件是当单击datagridview控件的任意部分是
发生.然后再用
ng(dataGridView1[1,ex].Value).Tri
m(); 来取得所选中的那行数据某列的值*/
{
=
ng(dgvISManage[1,ex].Value).Trim();
= ng(dgvISManage[2,
ex].Value).Trim();
= ng(dgvISManage[4,
ex].Value).Trim();
= ng(dgvISManage[3,
ex].Value).Trim();
= ng(dgvISManage[5,
ex].Value).Trim();
= ng(dgvISManage[6,
ex].Value).Trim();
= ng(dgvISManage[7,
ex].Value).Trim();
= ng(dgvISManage[8,
ex].Value).Trim();
= ng(dgvISManage[9,
ex].Value).Trim();
= ng(dgvISManage[11,
ex].Value).Trim();
= ng(dgvISManage[12,
ex].Value).Trim();
}
private void txtGIPrice_TextChanged(object sender, EventArgs e)
{
try
{
=
26 / 74
.
ng(mal(()) *
32(())).Trim();
//mal(())将文本值转为Decimal
数值
//将数字的指定String 表示形式转换为等效的Decimal 数字。
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void frmISManage_FormClosed(object sender, FormClosedEventArgs e)
{
();
}
private void button1_Click(object sender, EventArgs e)
{
= "";
= "";
= "";
= "";
= "";
= "";
= "";
= "";
= "";
}
}
}
出库管理()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
27 / 74
.
using ;
using ent;
namespace anage
{
public partial class frmOSManage : Form
{
n datacon = new n();
erate doperate = new
erate();
public frmOSManage()
{
InitializeComponent();
}
private void frmOSManage_Load(object sender, EventArgs e)
{
(hScrollBar1);
nd("select distinct StoreName from tb_InStore",
"tb_InStore", "StoreName", cboxSName);
DataSet myds = ("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");
urce = ["tb_OutStore"];
}
private void btnAdd_Click(object sender, EventArgs e)
{
try
{
SqlDataReader sqlread = d("select GoodsNum from
tb_GoodsInfo"
+ " where StoreName='" + () + "' and GoodsName='"
+ () + "' and GoodsSpec='" + ()
+ "'");
if (())
{
28 / 74
.
if (32(()) >
32(sqlread["GoodsNum"].ToString().Trim()))
{
("仓库中没有足够的货物!", "提示", ,
ation);
}
else
{
("insert into
tb_OutStore(StoreName,GoodsName,GoodsSpec,GoodsUnit," +
GoodsNum,GoodsPrice,PGProvider,PGPeople,HandlePeople,OSRemark)"
+ " values('" + () + "','" + () + "','" +
() + "','" + () + "',"+ ()
+ "," + () + ",'" + () + "','"
+() + "','" + () + "','" +
() + "')"); ("货物出库成功!", "信息",
, ation);
frmOSManage_Load(sender, e);
}
}
();
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnDel_Click(object sender, EventArgs e)
{
try
{
("delete from tb_OutStore where OSID="
+ ng(dgvOSManage[0,
ex].Value).Trim() + "");
("货物删除成功!", "信息", ,
ation);
frmOSManage_Load(sender, e);
29 / 74
.
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void dgvOSManage_CellClick(object sender,
DataGridViewCellEventArgs e)
{
= ng(dgvOSManage[1,
ex].Value).Trim();
= ng(dgvOSManage[2,
ex].Value).Trim();
= ng(dgvOSManage[3,
ex].Value).Trim();
= ng(dgvOSManage[4,
ex].Value).Trim();
= ng(dgvOSManage[5,
ex].Value).Trim();
= ng(dgvOSManage[6,
ex].Value).Trim();
= ng(dgvOSManage[7,
ex].Value).Trim();
= ng(dgvOSManage[9,
ex].Value).Trim();
= ng(dgvOSManage[10,
ex].Value).Trim();
= ng(dgvOSManage[11,
ex].Value).Trim();
= ng(dgvOSManage[12,
ex].Value).Trim();
}
private void cboxSName_SelectedIndexChanged(object sender, EventArgs e)
30 / 74
.
{
nd("select distinct GoodsName from tb_InStore where
StoreName='"
+ () + "'", "tb_InStore", "GoodsName",
cboxGName);
}
private void cboxGName_SelectedIndexChanged(object sender, EventArgs e)
{
nd("select distinct GoodsSpec from tb_InStore where
StoreName='"
+ () + "' and GoodsName='" +
()
+ "'", "tb_InStore", "GoodsSpec", cboxGSpec);
SqlDataReader sqlread = d("select
GoodsUnit,GoodsOutPrice,GoodsNum from tb_GoodsInfo"
+ " where StoreName='" + ()
+ "' and GoodsName='" + () + "'");
if (())
{
= sqlread["GoodsUnit"].ToString().Trim();
=
qlread["GoodsOutPrice"].ToString().Trim();
= sqlread["GoodsNum"].ToString().Trim();
}
();
}
private void txtOSGNum_TextChanged(object sender, EventArgs e)
{
try
{
=
ng(mal(())*
32(())).Trim();
}
catch (Exception ex)
{
(e, "警告", ,
g);
31 / 74
.
}
}
private void frmOSManage_FormClosed(object sender, FormClosedEventArgs e)
{
();
}
}
}
借货管理()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
using ent;
namespace anage
{
public partial class frmBGManage : Form
{
n datacon = new n();
erate doperate = new
erate();
public frmBGManage()
{
InitializeComponent();
}
private void frmBGManage_Load(object sender, EventArgs e)
{
(hScrollBar1);
nd("select StoreName from tb_Storage", "tb_Storage",
"StoreName", cboxSName);
DataSet myds = ("select BGID as 借货编号,GoodsName as 货
物名称,StoreName as 仓库名称,"
+ "GoodsSpec as 货物规格,GoodsNum as 借出数量,BGDate as 借货日
期,HandlePeople as 经手,"
32 / 74
.
+ "BGPeople as 借货,BGUnit as 借货单位,BGRemark as 备注from
tb_BorrowGoods", "tb_BorrowGoods");
urce = [0];
}
private void btnAdd_Click(object sender, EventArgs e)
{
try
{
if (!teNum(()))
{
or(txtBGNum, "输入必须为数字!");
}
else
{
();
SqlDataReader sqlread = d("select GoodsName
StoreName,GoodsNum from tb_GoodsInfo"
+ " where StoreName='" + () + "' and GoodsName='"
+ () + "' and GoodsSpec='" + () + "'");
if (())
{
if (32(sqlread["GoodsNum"].ToString().Trim()) <=
1)
{
("该货物库存已经不足!", "警告",
, g);
}
else
{
if (32(()) >=
32(()))
{
("没有足够的货物供您借取!", "警告", ,
g);
= "";
();
}
else
33 / 74
.
{
("insert into
tb_BorrowGoods(StoreName,GoodsName,GoodsSpec,"
+
"GoodsNum,HandlePeople,BGPeople,BGUnit,BGRemark)"
+ " values('" + () + "','"
+ ()
+ "','" + () + "','" +
() + "','"
+ () + "','" +
() + "','"
+ () + "','" +
() + "')");
("借货成功!", "信息",
, ation);
frmBGManage_Load(sender, e);
}
}
}
();
}
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnDel_Click(object sender, EventArgs e)
{
try
{
("delete from tb_BorrowGoods where BGID="
+ ng(dgvBGManage[0,
ex].Value).Trim() + "");
("借货资料删除成功!", "信息",
, ation);
frmBGManage_Load(sender, e);
34 / 74
.
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnRGManage_Click(object sender, EventArgs e)
{
anage GMfrgm = new frmRGManage();
();
alog();
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void cboxSName_SelectedIndexChanged(object sender, EventArgs e)
{
nd("select distinct GoodsName from tb_GoodsInfo where
StoreName='"
+ () + "'", "tb_GoodsInfo", "GoodsName",
cboxGName);
}
private void cboxGName_SelectedIndexChanged(object sender, EventArgs e)
{
nd("select distinct GoodsSpec from tb_GoodsInfo where
StoreName='" + ()+ "' and GoodsName='" + ()
+ "'", "tb_GoodsInfo", "GoodsSpec", cboxGSpec);
SqlDataReader sqlreader = d("select
GoodsName,StoreName,GoodsNum from tb_GoodsInfo where StoreName='" +
() + "'and GoodsName='" + () + "'");
if (())
{
= sqlreader["GoodsNum"].ToString().Trim();
}
();
}
35 / 74
.
private void dgvBGManage_CellClick(object sender,
ataGridViewCellEventArgs e)
{
= ng(dgvBGManage[2,
ex].Value).Trim();
= ng(dgvBGManage[1,
ex].Value).Trim();
= ng(dgvBGManage[3,
ex].Value).Trim();
= ng(dgvBGManage[4,
ex].Value).Trim();
= ng(dgvBGManage[6,
ex].Value).Trim();
= ng(dgvBGManage[7,
ex].Value).Trim();
= ng(dgvBGManage[8,
ex].Value).Trim();
= ng(dgvBGManage[9,
ex].Value).Trim();
}
private void frmBGManage_FormClosed(object sender, FormClosedEventArgs e)
{
();
}
}
}
货物归还()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
using ent;
namespace anage
{
public partial class frmRGManage : Form
36 / 74
.
{
n datacon = new n();
erate doperate = new
erate();
public frmRGManage()
{
InitializeComponent();
}
private void frmRGManage_Load(object sender, EventArgs e)
{
(hScrollBar1);
nd("select BGID from tb_BorrowGoods", "tb_BorrowGoods",
"BGID", cboxBGID);
DataSet myds = ("select RGID as 还货编号,BGID as 借货编
号,StoreName as 仓库名称,GoodsName as 货物名称,"
+ "GoodsSpec as 货物规格, RGNum as 归还数量,NRGNum as 未归还数
量,RGDate as 还货日期,HandlePeople as 经手,"
+ "RGPeople as 还货,RGRemark as 备注,Editer as 修改,EditDate as
修改日期from tb_ReturnGoods", "tb_ReturnGoods");
urce = ["tb_ReturnGoods"];
}
private void btnAdd_Click(object sender, EventArgs e)
{
try
{
SqlDataReader sqlread = d("select GoodsNum from
tb_BorrowGoods"
+ " where BGID=" + 32(()) +
"");
if (())
{
if (32(()) >
32(sqlread["GoodsNum"].ToString().Trim()))
{
("您借的货物数目为" +
32(sqlread["GoodsNum"].ToString().Trim())
+ ",请重新填写还货的数量!", "提示",
, ation);
37 / 74
.
= "";
();
}
else
{
("insert into
tb_ReturnGoods(BGID,StoreName,GoodsName,GoodsSpec,RGNum,"
+ "NRGNum,HandlePeople,RGPeople,RGRemark) values(" + () + ",'"
+ ()
+ "','" + () + "','" + () + "'," +
() + ","
+ () + ",'" + () + "','"
+ () + "','" + () + "')");
("还货成功!", "提示", ,
ation);
frmRGManage_Load(sender, e);
}
}
();
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnEdit_Click(object sender, EventArgs e)
{
try
{
("update tb_ReturnGoods set HandlePeople='" +
() + "',RGPeople='" + () +
"',RGRemark='" + () + "',Editer='" +
in.M_str_name + "',EditDate='" +
tDateString() + "'where RGID="
+ ng(dgvRGManage[0, ex].Value).Trim()
+ "");
("还货档案资料修改成功!", "信息",
38 / 74
.
, ation);
frmRGManage_Load(sender, e);
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnDel_Click(object sender, EventArgs e)
{
try
{
("delete from tb_ReturnGoods where RGID="
+ ng(dgvRGManage[0,
ex].Value).Trim() + "");
("还货档案资料删除成功!", "信息",
, ation);
frmRGManage_Load(sender, e);
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void cboxBGID_SelectedIndexChanged(object sender, EventArgs e)
{
if ( == "wView")
{
}
else
{
SqlDataReader sqlreada = d("select GoodsNum from
39 / 74
.
tb_BorrowGoods" + " where BGID=" + 32(()) + "");
if (())
{
=
sqlreada["GoodsNum"].ToString().Trim();
}
SqlDataReader sqlreadNum = d("select sum(RGNum) as Num from
tb_ReturnGoods" + " where BGID=" + 32(()) + "");
if (())
{
if (sqlreadNum["Num"].ToString().Trim() == "")
{
("您没有还过该货物。");
}
else
{
("已归还数量为" +
sqlreadNum["Num"].ToString().Trim() + "。");
}
}
();
SqlDataReader sqlread = d("select
StoreName,GoodsName,GoodsSpec from tb_BorrowGoods"+ " where BGID=" +
32(()) + "");
if (())
{
= sqlread["StoreName"].ToString().Trim();
= sqlread["GoodsName"].ToString().Trim();
= sqlread["GoodsSpec"].ToString().Trim();
}
();
}
}
private void dgvRGManage_CellClick(object sender, DataGridViewCellEventArgs
e)
{
= ng(dgvRGManage[1,
ex].Value).Trim();
40 / 74
.
= ng(dgvRGManage[2,
ex].Value).Trim();
= ng(dgvRGManage[3,
ex].Value).Trim();
= ng(dgvRGManage[5,
ex].Value).Trim();
= ng(dgvRGManage[6,
ex].Value).Trim();
= ng(dgvRGManage[9,
ex].Value).Trim();
= ng(dgvRGManage[8,
ex].Value).Trim();
= ng(dgvRGManage[10,
ex].Value).Trim();
}
private void txtRGNum_TextChanged(object sender, EventArgs e)
{
try
{
SqlDataReader sqlread = d("select GoodsNum from
tb_BorrowGoods"
+ " where BGID=" + 32(()) +
"");
if (())
{
=
ng(32(sqlread["GoodsNum"].ToString().Trim()) -
32(())).Trim();
}
();
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void frmRGManage_FormClosed(object sender, FormClosedEventArgs e)
41 / 74
.
{
();
}
}
}
档案设置管理(仓库设置)
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
using ent;
namespace nfo
{
public partial class frmStoreInfo : Form
{
n datacon = new n();
erate doperate = new
erate();
public frmStoreInfo()
{
InitializeComponent();
}
private void frmStoreInfo_Load(object sender, EventArgs e)
{
(hScrollBar1);
DataSet myds = ("select StoreID as 仓库编号,StoreName as
仓库名称,StorePeople as 负责,"
+ "StorePhone as ,StoreUnit as 所属单位,StoreDate as 建库日
期,StoreRemark as 备注,"
+ "Editer as 修改,EditDate as 修改日期from tb_Storage",
"tb_Storage");
urce=["tb_Storage"];
}
private void btnAdd_Click(object sender, EventArgs e)
{
42 / 74
.
try
{
if (!tePhone(()))
{
or(txtSPhone, "格式不对");
}
else
{
();
if ( == "")
{
("仓库名称不能为空!", "信息",
, ation);
}
else
{
int P_int_returnValue =
Storage((),(),
(), (), ());
if (P_int_returnValue == 100)
{
("该仓库已经存在!", "信息",
, ation);
}
else
{
("仓库信息添加成功!", "信息",
, ation);
frmStoreInfo_Load(sender, e);
}
}
}
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
43 / 74
.
}
private void btnEdit_Click(object sender, EventArgs e)
{
try
{
if (!tePhone(()))
{
or(txtSPhone, "输入格式不正确");
}
else
{
();
("update tb_Storage set StoreName='"
+()+"', StorePeople='" + () +
',StorePhone='"
+ () + "',StoreUnit='" + ()+
"',StoreRemark='" + () + "',Editer='" +
in.M_str_name + "',EditDate='" + tDateString()
+ "'where StoreID=" + ng(dgvSInfo[0,
ex].Value).Trim() + "");
("仓库档案修改成功!", "信息",
, ation);
frmStoreInfo_Load(sender, e);
}
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnDel_Click(object sender, EventArgs e)
{
try
{
("delete from tb_Storage where StoreID="
+ ng(dgvSInfo[0,
44 / 74
.
ex].Value).Trim() + "");
("成功删除仓库!", "信息", ,
ation);
frmStoreInfo_Load(sender, e);
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void dgvSInfo_CellClick(object sender, DataGridViewCellEventArgs
e)
{
= ng(dgvSInfo[1,
ex].Value).Trim();
= ng(dgvSInfo[2,
ex].Value).Trim();
= ng(dgvSInfo[3,
ex].Value).Trim();
= ng(dgvSInfo[4,
ex].Value).Trim();
= ng(dgvSInfo[6,
ex].Value).Trim();
}
private void frmStoreInfo_FormClosed(object sender, FormClosedEventArgs
e)
{
();
}
}
}
供应商设置()
using System;
45 / 74
.
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
using ent;
namespace nfo
{
public partial class frmPrInfo : Form
{
n datacon = new n();
erate doperate = new
erate();
public frmPrInfo()
{
InitializeComponent();
}
private void frmPrInfo_Load(object sender, EventArgs e)
{
(hScrollBar1);
DataSet myds = ("select PrID as 供应商编号,PrName as 供
应商名称,PrPeople as 负责,"
+ "PrPhone as ,PrFax as ,PrRemark as 备注,Editer as 修
改,EditDate as 修改日期from tb_Provider", "tb_Provider");
urce=["tb_Provider"];
}
private void btnAdd_Click(object sender, EventArgs e)
{
try
{
if (!tePhone(()))
{
or(txtPPhone, "格式不正确");
}
else if (!teFax(()))
{
or(txtPFax, " 输入格式不正确");
46 / 74
.
}
else
{
();
();
if ( == "")
{
("供应商名称不能为空!", "信息",
, ation);
}
else
{
int P_int_returnValue =
Provider((),
(),(),(),
());
if (P_int_returnValue == 100)
{
("该供应商已经存在!", "信息",
, ation);
}
else
{
("供应商信息添加成功!", "信息",
, ation);
frmPrInfo_Load(sender, e);
}
}
}
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnEdit_Click(object sender, EventArgs e)
47 / 74
.
{
try
{
if (!tePhone(()))
{
or(txtPPhone, "格式不正确");
}
else if (!teFax(()))
{
or(txtPFax, " 输入格式不正确");
}
else
{
();
();
("update tb_Provider set PrPeople='" +
() + "',PrPhone='"
+ () + "',PrFax='" +
()
+ "',PrRemark='" + () + "',Editer='"
+ in.M_str_name + "',EditDate='" +
tDateString()
+ "'where PrID=" + ng(dgvPInfo[0,
ex].Value).Trim() + "");
("供应商档案修改成功!", "信息",
, ation);
frmPrInfo_Load(sender, e);
}
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnDel_Click(object sender, EventArgs e)
{
try
48 / 74
.
{
("delete from tb_Provider where PrID="
+ ng(dgvPInfo[0, ex].Value).Trim() +
"");
("成功删除供应商!", "信息", ,
ation);
frmPrInfo_Load(sender, e);
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void dgvPInfo_CellClick(object sender, DataGridViewCellEventArgs
e)
{
= ng(dgvPInfo[1,
ex].Value).Trim();
= ng(dgvPInfo[2,
ex].Value).Trim();
= ng(dgvPInfo[3,
ex].Value).Trim();
= ng(dgvPInfo[4,
ex].Value).Trim();
= ng(dgvPInfo[5,
ex].Value).Trim();
}
private void frmPrInfo_FormClosed(object sender, FormClosedEventArgs e)
{
();
}
}
}
49 / 74
.
库存货物管理()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
namespace nfo
{
public partial class frmGoodsInfo : Form
{
n datacon = new n();
erate doperate = new
erate();
public frmGoodsInfo()
{
InitializeComponent();
}
private void frmGoodsInfo_Load(object sender, EventArgs e)
{
(hScrollBar1);
DataSet myds = ("select GoodsID as 货物编号,GoodsName as
货物名称," + "StoreName as 仓库名称,GoodsSpec as 货物规格,GoodsUnit as 计量单
位," + "GoodsNum as 货物数量,GoodsInPrice as 进货价格,GoodsOutPrice as 出货价
格,"
+ "Editer as 修改,EditDate as 修改日期from tb_GoodsInfo", "tb_GoodsInfo");
urce = ["tb_GoodsInfo"];
}
private void btnEdit_Click(object sender, EventArgs e)
{
try
{
if (!teNum(()))
{
or(txtGOPrice, "输入必须为数字");
}
else
50 / 74
.
{
();
("update tb_GoodsInfo set GoodsOutPrice=" +
() + "',Editer='" + in.M_str_name +
"',EditDate='" + tDateString() + "'where GoodsID="
+ ng(dgvGInfo[0, ex].Value).Trim()
+ "");
("货物档案修改成功!", "信息", ,
ation);
frmGoodsInfo_Load(sender, e);
}
}
catch(Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnDel_Click(object sender, EventArgs e)
{
try
{
("delete from tb_GoodsInfo where GoodsID="
+ ng(dgvGInfo[0, ex].Value).Trim()
+ " and StoreName='" + ng(dgvGInfo[2,
ex].Value).Trim() + "'");
("货物删除成功!", "信息", ,
ation);
frmGoodsInfo_Load(sender, e);
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
51 / 74
.
();
}
private void dgvGInfo_CellClick(object sender, DataGridViewCellEventArgs
e)
{
= ng(dgvGInfo[1,
ex].Value).Trim();
= ng(dgvGInfo[3,
ex].Value).Trim();
= ng(dgvGInfo[4,
ex].Value).Trim();
= ng(dgvGInfo[5,
ex].Value).Trim();
= ng(dgvGInfo[6,
ex].Value).Trim();
= ng(dgvGInfo[7,
ex].Value).Trim();
}
private void frmGoodsInfo_FormClosed(object sender, FormClosedEventArgs
e)
{
();
}
}
}
查询管理(借出货物)
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
using ent;
namespace dSum
{
public partial class frmBGLook : Form
{
52 / 74
.
public frmBGLook()
{
InitializeComponent();
}
n datacon = new n();
private void frmBGLook_Load(object sender, EventArgs e)
{
(hScrollBar1);
DataSet myds = ("select BGID as 借货编号,GoodsName as 货
物名称,StoreName as 仓库名称,"
+ "GoodsSpec as 货物规格,GoodsNum as 借出数量,BGDate as 借货日
期,HandlePeople as 经手,"
+ "BGPeople as 借货,BGUnit as 借货单位,BGRemark as 备注from
tb_BorrowGoods", "tb_BorrowGoods");
urce = [0];
}
private void btnLook_Click(object sender, EventArgs e)
{
try
{
if (() == "")
{
frmBGLook_Load(sender, e);
}
else
{
if (() == "借货编号")
{
DataSet myds = ("select BGID as 借货编
号,GoodsName as 货物名称,StoreName as 仓库名称," + "GoodsSpec as 货物规
格,GoodsNum as 借出数量,BGDate as 借货日期,HandlePeople as 经手," +
"BGPeople as 借货,BGUnit as 借货单位,BGRemark as 备注from tb_BorrowGoods where
BGID = "
+ () + "", "tb_BorrowGoods"); urce =
[0];
}
if (() == "借货日期")
{
53 / 74
.
string P_str_dtime = ();
DataSet myds = ("select BGID as 借货编
号,GoodsName as 货物名称,StoreName as 仓库名称,"
+ "GoodsSpec as 货物规格,GoodsNum as 借出数量,BGDate
as 借货日期,HandlePeople as 经手,"
+ "BGPeople as 借货,BGUnit as 借货单位,BGRemark as 备
注from tb_BorrowGoods"
+ " where year(BGDate)=" + P_str_ing(0, 4)
+ " and month(BGDate)="
+ P_str_ing(5, P_str_ - 6) +
"", "tb_BorrowGoods");
urce = [0];
}
if (() == "仓库名称")
{
DataSet myds = ("select BGID as 借货编
号,GoodsName as 货物名称,StoreName as 仓库名称,"
+ "GoodsSpec as 货物规格,GoodsNum as 借出数量,BGDate
as 借货日期,HandlePeople as 经手,"
+ "BGPeople as 借货,BGUnit as 借货单位,BGRemark as 备
注from tb_BorrowGoods where StoreName like '%"
+ () + "%'", "tb_BorrowGoods");
urce = [0];
}
if (() == "货物名称")
{
DataSet myds = ("select BGID as 借货编
号,GoodsName as 货物名称,StoreName as 仓库名称,"+ "GoodsSpec as 货物规格,GoodsNum
as 借出数量,BGDate as 借货日期,HandlePeople as 经手," + "BGPeople as 借
货,BGUnit as 借货单位,BGRemark as 备注from tb_BorrowGoods where GoodsName like '%"
+ () + "%'", "tb_BorrowGoods");
urce = [0];
}
}
}
catch (Exception ex)
{
(e,"提示
54 / 74
.
",,ation);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void cboxLCondition_SelectedIndexChanged(object sender, EventArgs
e)
{
if (() == "借货日期")
{
= "查询年月份";
}
else
{
= "查询关键字";
}
}
private void frmBGLook_FormClosed(object sender, FormClosedEventArgs e)
{
();
}
}
}
库存查询()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
namespace dSum
{
public partial class frmGILook : Form
{
n datacon = new n();
55 / 74
.
public frmGILook()
{
InitializeComponent();
}
private void frmGILook_Load(object sender, EventArgs e)
{
(hScrollBar1);
DataSet myds = ("select GoodsID as 货物编号,GoodsName as
货物名称," + "StoreName as 仓库名称,GoodsSpec as 货物规格,GoodsUnit as 计量单位,"
+ "GoodsNum as 货物数量,GoodsInPrice as 进货价格,GoodsOutPrice as 出货价格," +
"Editer as 修改,EditDate as 修改日期from tb_GoodsInfo", "tb_GoodsInfo");
urce = [0];
}
private void btnLook_Click(object sender, EventArgs e)
{
try
{
if (() == "")
{
frmGILook_Load(sender, e);
}
else
{
if (() == "货物编号")
{
DataSet myds = ("select GoodsID as 货物编
号,GoodsName as 货物名称,"
+ "StoreName as 仓库名称,GoodsSpec as 货物规
格,GoodsUnit as 计量单位,"
+ "GoodsNum as 货物数量,GoodsInPrice as 进货价
格,GoodsOutPrice as 出货价格," + "GoodsLeast as 最低存储,GoodsMost as 最高
存储,Editer as 修改,EditDate as 修改日期" + " from tb_GoodsInfo where GoodsID
= " + () + "", "tb_GoodsInfo"); urce =
[0];
}
if (() == "货物名称")
{
DataSet myds = ("select GoodsID as 货物编
56 / 74
.
号,GoodsName as 货物名称," + "StoreName as 仓库名称,GoodsSpec as 货物规
格,GoodsUnit as 计量单位," +"GoodsNum as 货物数量,GoodsInPrice as 进货价
格,GoodsOutPrice as 出货价格," + "GoodsLeast as 最低存储,GoodsMost as 最高存
储,Editer as 修改,EditDate as 修改日期" + " from tb_GoodsInfo where GoodsName
like '%" + () + "%'", "tb_GoodsInfo");
urce = [0];
}
if (() == "仓库名称")
{
DataSet myds = ("select GoodsID as 货物编
号,GoodsName as 货物名称," + "StoreName as 仓库名称,GoodsSpec as 货物规
格,GoodsUnit as 计量单位," + "GoodsNum as 货物数量,GoodsInPrice as 进货价
格,GoodsOutPrice as 出货价格," + "GoodsLeast as 最低存储,GoodsMost as 最高
存储,Editer as 修改,EditDate as 修改日期" + " from tb_GoodsInfo where StoreName
like '%" + () + "%'", "tb_GoodsInfo");
urce = [0];
}
}
}
catch (Exception ex)
{
(e, "提示", ,
ation);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void frmGILook_FormClosed(object sender, FormClosedEventArgs e)
{
();
}
}
}
入库查询()
using System;
using c;
57 / 74
.
using System ponentModel;
using ;
using g;
using ;
using ;
namespace dSum
{
public partial class frmISLook : Form
{
public frmISLook()
{
InitializeComponent();
}
n datacon = new n();
private void frmISLook_Load(object sender, EventArgs e)
{
(hScrollBar1);
DataSet myds = ("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");
urce = [0];
}
private void btnLook_Click(object sender, EventArgs e)
{
try
{
if (() == "")
{
frmISLook_Load(sender, e);
}
else
{
if (() == "入库编号")
{
DataSet myds = ("select ISID as 入库编
号,GoodsID as 货物编号,GoodsName as 货物名称,PrName as 供应商名称,"
58 / 74
.
+ "StoreName as 仓库名称,GoodsSpec as 货物规格,GoodsUnit as 计量单位,GoodsNum as
入库数量," + "GoodsPrice as 进货价格,GoodsAPrice as 总金额,ISDate as 入库日
期,HandlePeople as 经手," + "ISRemark as 备注from tb_InStore where ISID = " +
() + "", "tb_InStore");
urce = [0];
}
if (() == "货物编号")
{
DataSet myds = ("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 where GoodsID = " +
() + "", "tb_InStore");
urce = [0];
}
if (() == "入库日期")
{
string P_str_dtime = ();
try
{
Time(P_str_dtime);
}
catch
{
("时间格式不正确,应为XXXX年-XX月-XX
日");
}
DataSet myds = ("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 where
year(ISDate)=" + P_str_ing(0, 4) + " and month(ISDate)=" +
P_str_ing(5, P_str_ - 6) + "", "tb_InStore");
urce = [0];
}
if (() == "仓库名称")
59 / 74
.
{
DataSet myds = ("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 where StoreName
like '%" + () + "%'", "tb_InStore");
urce = [0];
}
if (() == "货物名称")
{
DataSet myds = ("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 where GoodsName like
'%" + () + "%'", "tb_InStore");
urce = [0];
}
}
}
catch (Exception ex)
{
(e, "提示", ,
ation);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void cboxLCondition_SelectedIndexChanged(object sender, EventArgs
e)
{
if (() == "入库日期")
{
= "查询年月份";
}
60 / 74
.
else
{
= "查询关键字";
}
}
private void frmISLook_FormClosed(object sender, FormClosedEventArgs e)
{
();
}
}
}
货物出库查询()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
namespace dSum
{
public partial class frmOSLook : Form
{
public frmOSLook()
{
InitializeComponent();
}
n datacon = new n();
private void frmOSLook_Load(object sender, EventArgs e)
{
(hScrollBar1);
DataSet myds = ("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");
urce = [0];
}
61 / 74
.
private void btnLook_Click(object sender, EventArgs e)
{
try
{
if (() == "")
{
frmOSLook_Load(sender, e);
}
else
{
if (() == "出库编号")
{
DataSet myds = ("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 where OSID = " +
() + "", "tb_OutStore");
urce = [0];
}
if (() == "出库日期")
{
string P_str_dtime = ();
DataSet myds = ("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 where year(OSDate)=" +
P_str_ing(0, 4) + " and month(OSDate)=" + P_str_ing(5,
P_str_ - 6) + "", "tb_OutStore");
urce = [0];
}
if (() == "仓库名称")
{
DataSet myds = ("select OSID as 出库编
号,StoreName as 仓库名称,GoodsName as 货物名称," + "GoodsSpec as 规
格,GoodsUnit as 计量单位,GoodsNum as 出库数量,GoodsPrice as 价格,GoodsAPrice as
总金额," + "OSDate as 出库日期,PGProvider as 提货单位,PGPeople as 提货,"
62 / 74
.
+ "HandlePeople as 经手,OSRemark as 备注from tb_OutStore where StoreName like '%"
+ () + "%'", "tb_OutStore");
urce = [0];
}
if (() == "货物名称")
{
DataSet myds = ("select OSID as 出库编
号,StoreName as 仓库名称,GoodsName as 货物名称," + "GoodsSpec as 规格,GoodsUnit as
计量单位,GoodsNum as 出库数量,GoodsPrice as 价格,GoodsAPrice as 总金额,"
+ "OSDate as 出库日期,PGProvider as 提货单位,PGPeople as 提货," +
+ () + "%'", "tb_OutStore");
urce = [0];
}
}
}
catch (Exception ex)
{
(e, "提示", ,
ation);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void cboxLCondition_SelectedIndexChanged(object sender, EventArgs
e)
{
if (() == "出库日期")
{
= "查询年月份";
}
else
{
= "查询关键字";
}
}
"HandlePeople as 经手,OSRemark as 备注from tb_OutStore where GoodsName like '%"
63 / 74
.
private void frmOSLook_FormClosed(object sender, FormClosedEventArgs e)
{
();
}
}
}
货物归还查询()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
namespace dSum
{
public partial class frmRGLook : Form
{
public frmRGLook()
{
InitializeComponent();
}
n datacon = new n();
private void frmRGLook_Load(object sender, EventArgs e)
{
(hScrollBar1);
DataSet myds = ("select RGID as 还货编号,BGID as 借货编
号,StoreName as 仓库名称,GoodsName as 货物名称," + "RGNum as 归还数量,NRGNum
as 未归还数量,RGDate as 还货日期,HandlePeople as 经手,RGPeople as 还货,RGRemark
as 备注," + "Editer as 修改,EditDate as 修改日期from tb_ReturnGoods",
"tb_ReturnGoods");
urce = [0];
}
private void btnLook_Click(object sender, EventArgs e)
{
try
{
if (() == "")
64 / 74
.
{
frmRGLook_Load(sender, e);
}
else
{
if (() == "还货编号")
{
DataSet myds = ("select RGID as 还货编
号,BGID as 借货编号,StoreName as 仓库名称,GoodsName as 货物名称,"
+ "RGNum as 归还数量,NRGNum as 未归还数量,RGDate as
还货日期,HandlePeople as 经手,RGPeople as 还货,RGRemark as 备注,"
+ "Editer as 修改,EditDate as 修改日期from
tb_ReturnGoods where RGID = " + () + "", "tb_ReturnGoods");
urce = [0];
}
if (() == "借货编号")
{
DataSet myds = ("select RGID as 还货编
号,BGID as 借货编号,StoreName as 仓库名称,GoodsName as 货物名称," + "RGNum as 归
还数量,NRGNum as 未归还数量,RGDate as 还货日期,HandlePeople as 经手,RGPeople as
还货,RGRemark as 备注," + "Editer as 修改,EditDate as 修改日期from
tb_ReturnGoods where BGID = " + () + "", "tb_ReturnGoods");
urce = [0];
}
if (() == "还货日期")
{
string P_str_dtime=();
DataSet myds = ("select RGID as 还货编
号,BGID as 借货编号,StoreName as 仓库名称,GoodsName as 货物名称," +
"RGNum as 归还数量,NRGNum as 未归还数量,RGDate as 还货日期,HandlePeople as 经
手,RGPeople as 还货,RGRemark as 备注," + "Editer as 修改,EditDate as 修改日
期from tb_ReturnGoods where year(RGDate)=" + P_str_ing(0, 4) +
" and month(RGDate)=" + P_str_ing(5, P_str_ - 6) + "",
"tb_ReturnGoods");
urce = [0];
}
if (() == "仓库名称")
{
65 / 74
.
DataSet myds = ("select RGID as 还货编
号,BGID as 借货编号,StoreName as 仓库名称,GoodsName as 货物名称," + "RGNum as
归还数量,NRGNum as 未归还数量,RGDate as 还货日期,HandlePeople as 经手,RGPeople as
还货,RGRemark as 备注," + "Editer as 修改,EditDate as 修改日期from
tb_ReturnGoods where StoreName like '%" + () + "%'",
"tb_ReturnGoods");
urce = [0];
}
if (() == "货物名称")
{
DataSet myds = ("select RGID as 还货编
号,BGID as 借货编号,StoreName as 仓库名称,GoodsName as 货物名称," + "RGNum as
归还数量,NRGNum as 未归还数量,RGDate as 还货日期,HandlePeople as 经手,RGPeople as
还货,RGRemark as 备注," + "Editer as 修改,EditDate as 修改日期from
tb_ReturnGoods where GoodsName like '%" + () + "%'",
"tb_ReturnGoods");
urce = [0];
}
}
}
catch (Exception ex)
{
(e, "提示", ,
ation);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void cboxLCondition_SelectedIndexChanged(object sender, EventArgs
e)
{
if (() == "还货日期")
{
= "查询年月份";
}
else
66 / 74
.
{
= "查询关键字";
}
}
private void frmRGLook_FormClosed(object sender, FormClosedEventArgs e)
{
();
}
}
}
系统设置(关于本系统)
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
using ;//文件流的头文件
namespace Set
{
public partial class frmAboutUs : Form
{
public frmAboutUs()
{
InitializeComponent();
}
private void frmAboutUs_Load(object sender, EventArgs e)
{
string path = pPath + "";//获取可执行
文件的地址
Reader reader = new Reader(path,
t);
= End();
();
}
private void btnExit_Click(object sender, EventArgs e)
{
67 / 74
.
();
}
private void frmAboutUs_FormClosed(object sender, FormClosedEventArgs e)
{
();
}
}
}
密码修改()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
namespace Set
{
public partial class frmEditPwd : Form
{
public frmEditPwd()
{
InitializeComponent();
}
n datacon = new n();
private void frmEditPwd_Load(object sender, EventArgs e)
{
= in.M_str_name;
}
private void btnSure_Click(object sender, EventArgs e)
{
if (() != ())
{
or(txtFUNPwd, "两次输入密码不一致!");
}
else
{
if (() != in.M_str_pwd)
68 / 74
.
{
("用户旧密码输入错误,请重新输入!", "错误提
示", , );
}
else
{
("update tb_User set
UserPwd='"+()+"'where UserName='"+()+"'");
("密码修改成功!", "信息",
, ation);
}
}
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void frmEditPwd_FormClosed(object sender, FormClosedEventArgs e)
{
();
}
}
}
权限管理()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
using ent;
namespace Set
{
public partial class frmRightManage : Form
{
public frmRightManage()
{
69 / 74
.
InitializeComponent();
}
n datacon = new n();
erate doperate = new
erate();
private void frmRightManage_Load(object sender, EventArgs e)
{
nd("select UserName from tb_User", "tb_User",
"UserName", cboxUName);
}
private void btnSure_Click(object sender, EventArgs e)
{
("update tb_User set UserRight='"
+ () + "'where UserName='" +
() + "'");
("权限修改成功!","信息
",,ation);
}
private void btnExit_Click(object sender, EventArgs e)
{
();
}
private void cboxUName_SelectedIndexChanged(object sender, EventArgs e)//
选择不同的用户时显示不同的权限
{
SqlDataReader sqlread = d("select UserName,UserRight
from tb_User "
+ "where UserName='" + + "'");
if (())
{
= sqlread["UserRight"].ToString().Trim();
}
();
}
private void frmRightManage_FormClosed(object sender, FormClosedEventArgs
e)
{
();
70 / 74
.
}
}
}
用户管理()
using System;
using c;
using System ponentModel;
using ;
using g;
using ;
using ;
using ent;
namespace Set
{
public partial class frmUserManage : Form
{
public frmUserManage()
{
InitializeComponent();
}
n datacon = new n();
erate doperate = new
erate();
private void frmUserManage_Load(object sender, EventArgs e)
{
DataSet myds = ("select UserID as 用户编号,UserName as 用
户名,UserPwd as 用户密码," + "UserRight as 用户权限from tb_User", "tb_User");
urce=["tb_User"];
nd("select UserName from tb_User", "tb_User", "UserName",
cboxUName);
nd("select UserRight from tb_User", "tb_User",
"UserRight", cboxURight);
}
private void btnAdd_Click(object sender, EventArgs e)
{
try
{
int P_int_returnValue =
71 / 74
.
User((), (),
());
if (P_int_returnValue == 100)
{
("该用户已经存在", "警告",
, g);
}
else
{
("用户信息添加成功!", "信息",
, ation);
frmUserManage_Load(sender, e);
}
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void btnEdit_Click(object sender, EventArgs e)
{
try
{
User(32(dgvUInfo[0,
ex].Value),
(), ());
//( [1].(),"asdf" ,);
//("update tb_User set UserPwd='" +
() + "',UserRight='" + ng() + "' where
UserID= " + ng() + "");
//ng(dgvUInfo[0,
ex].Value).Trim() + "");
("用户信息修改成功!", "信息",
, ation);
frmUserManage_Load(sender, e);
}
catch (Exception ex)
72 / 74
.
{
(e, "信息", ,
ation);
}
}
private void btnDel_Click(object sender, EventArgs e)
{
try
{
("delete from tb_User where UserID="
+ ng(dgvUInfo[0,
ex].Value).Trim() + "");
("删除用户信息成功!", "信息",
, ation);
frmUserManage_Load(sender, e);
}
catch (Exception ex)
{
(e, "警告", ,
g);
}
}
private void dgvUInfo_CellClick(object sender, DataGridViewCellEventArgs
e)
{
= ng(dgvUInfo[1,
ex].Value).Trim();
= ng(dgvUInfo[2,
ex].Value).Trim();
= ng(dgvUInfo[3,
ex].Value).Trim();
}
private void frmUserManage_FormClosed(object sender, FormClosedEventArgs
e)
{
();
}
private void btnexit_Click(object sender, EventArgs e)
73 / 74
.
{
();
}
}
}
74 / 74
发布者:admin,转转请注明出处:http://www.yc00.com/news/1713053200a2173473.html
评论列表(0条)