广西工学院 计算机科学与技术 2011界毕业论文
图4-4 查询客户信息模块
其实现的核心代码:
private void buttonFind_Click(object sender, EventArgs e) {
textBoxName.Enabled = true; buttonFindCusInfo.Enabled = true; textBoxNo.Text = \;
textBoxName.Text = \请输入查询条件<客户名称>...\; textBoxCredit.Text = \; textBoxLevel.Text = \; textBoxTele.Text = \; }
private void buttonFindCusInfo_Click(object sender, EventArgs e) {
string customerName=textBoxName.Text.Trim(); string customerNo=null; if (customerName == \) {
MessageBox.Show(\客户名称不能为空\); return; }
string connectionString = \
Security=SSPI;Initial Catalog=ComputerSellingManagement;server=(local)\;
try {
string sqlString = \
cCustomerName='\+customerName+\;
31
广西工学院 计算机科学与技术 2011界毕业论文
SqlConnection cnn = new SqlConnection(connectionString); cnn.Open();
SqlDataAdapter dr = new SqlDataAdapter(sqlString, cnn); DataSet ds = new DataSet(); dr.Fill(ds, \);
if (ds.Tables[\].Rows.Count == 0) {
MessageBox.Show(\所查询客户不存在\); cnn.Close(); return; }
4.5进货管理模块实现
选择进货管理模块时有两个菜单(进货管理和退货),进入进货管管理功能窗体,需要管理员添加供应商编号或者供应商名称才可进行对供应商基本信息的查询,而进货的单据编号由系统自动生成,具体商品还得管理员在添加功能中添加所需求的商品,且需要管理员进行对商品的价格和数量进行补充,才算可以完成一个进货单,如图4-5所示:
图4-5(1) 进货管理模块
32
广西工学院 计算机科学与技术 2011界毕业论文
图4-5(2) 进货管理模块
实现的核心代码:
private void PurchaseMana_Load(object sender, EventArgs e) {
if (this.Text == \进货管理\) {
Purchase_Load(); }
if (this.Text == \退货管理\) {
Return_Load(); } }
private void Purchase_Load() {
buttonDelete.Enabled = false; csm = (CSManagement)this.Owner; textBoxSellerName.Text = csm.loginName;
textBoxDate.Text = DateTime.Today.ToShortDateString(); int count = 0;
string connectionString = \
Security=SSPI;Initial Catalog=ComputerSellingManagement;server=(local)\;
string sqlString = \;
33
广西工学院 计算机科学与技术 2011界毕业论文
try {
SqlConnection cnn = new SqlConnection(connectionString); cnn.Open();
SqlCommand cmd = new SqlCommand(sqlString, cnn); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) {
count++; }
textBoxBusinessNo.Text = \; count++;
textBoxBusinessNo.Text += CodeValue(count);
4.6售管理模块的实现
此模块完成了一个销售过程,由最开始的添加销售订单到付款,其中添加新销售模块中包含了客户,交易信息和商品信息,销售员需要确认客户,交易金额和交易商品的所有信息都完成才可以确认销售完成的一个过程。而中间还有关于商品出售价的价格管理,根据市场的发展,更新最新的商品价格,人性化的延时付款,可以售后付款;当中就需要销售员对客户和客户对应的商品有一定了解;如图4-6所示:
34
广西工学院 计算机科学与技术 2011界毕业论文
图4-6 销售管理模块
实现的核心代码:
private void buttonFind_Click(object sender, EventArgs e) {
string customerName = textBoxName.Text.Trim(); if (customerName == \) {
MessageBox.Show(\客户名称不能为空\); return; }
string connectionString = \
Security=SSPI;Initial Catalog=ComputerSellingManagement;server=(local)\;
try {
string sqlString = \ +
customerName + \;
SqlConnection cnn = new SqlConnection(connectionString); cnn.Open();
SqlDataAdapter dr = new SqlDataAdapter(sqlString, cnn); DataSet ds = new DataSet(); dr.Fill(ds, \);
if (ds.Tables[\].Rows.Count == 0) {
MessageBox.Show(\所查询客户不存在\); cnn.Close(); return; }
4.7库存管理模块的实现
库存管理模块是商品进货最后一道工序,在前面进货管理的进货单和商品在库存管理中再次确认就可以确认进货,到达库存了,而确认进货需要销售员必须记得单据编号,这是入库最后工序的唯一执行操作的数据,在数据库中确认此单据是否与入库商品相符。此外,库存管理模块还有一个特殊的功能,就是数据库初始化,把所有库存商品初始为0。如图4-7所示:
35