爱家超市销售管理系统学士学位论文.doc

爱家超市销售管理系统学士学位论文.doc

ID:11437023

大小:661.50 KB

页数:100页

时间:2018-07-12

上传者:zhaojunhui
爱家超市销售管理系统学士学位论文.doc_第1页
爱家超市销售管理系统学士学位论文.doc_第2页
爱家超市销售管理系统学士学位论文.doc_第3页
爱家超市销售管理系统学士学位论文.doc_第4页
爱家超市销售管理系统学士学位论文.doc_第5页
资源描述:

《爱家超市销售管理系统学士学位论文.doc》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

中央广播电视大学开放教育试点计算机本科毕业论文爱家超市销售管理系统作者:梁茂俊专业:计算机科学与技术班级:13春计本学号:1365001211649指导教师:武昇工作单位:沙湾县委信息化管理办公室校花的贴身高手最新章节http://www.piaotian.com/html/1/1974/ 目录毕业设计任务书……………………………………………………………………1内容摘要……………………………………………………………………………3第一章可行性研究…………………………………………………………………4一、超市销售管理系统的意义………………………………………………………4二、可行性研究………………………………………………………………………4第二章需求分析……………………………………………………………………6一、客户需求分析……………………………………………………………6二、超市销售管理系统的目标………………………………………………8三、系统设计思想…………………………………………………………………8第三章系统分析…………………………………………………………………9第三章系统分析…………………………………………………………………9一、接口类型………………………………………………………………………9二、系统建模………………………………………………………………………9第四章系统的实现………………………………………………………………11第五章结束语……………………………………………………………………98致谢………………………………………………………………………………98参考文献…………………………………………………………………………98 毕业设计任务书学号1365001211649姓名梁茂俊班级13春计本设计课题爱家超市销售管理系统设计所用语言(工具)前台开发语言:C#后台数据库为MSSQL-server2005对选题的说明(来源、目的、独立课题还是系统子课题)本系统是针对大型超市的销售业务应用而开发。本系统包括销售业务、采购业务及统计模块,通过规范的数据录入可以清晰每一笔销售业务、库存业务。提高管理效率、掌握及时、准确、全面的销售全局。系统真正从用户的需求出发,参考了各类销售管理软件,集各家之优点并采纳听取了众多用户的宝贵意见,使管理者在使用本系统时能随时了解销售及库存存货情况,及时跟踪整个销售周期,更可以细致到查询库存业务的细节,避免库存积压情况,实现对市场的快速反应。本课题为独立课题。设计要求实现商品销售管理系统设计,包括以下模块:1、基本信息操作,包括添加公司信息(添加供应商及客户信息)、添加商品信息、公司信息管理(实现修改及删除公司信息)、商品信息管理(修改及删除商品信息);2、进货管理操作,包括添加进货信息、添加进货退货信息;3、销售管理操作,包括添加销售信息、添加销售退货;4、查询统计操作,包括商品进货查询(主要是对商品进货的详细信息进行查询,可根据供应商、商品名称、经手人和起止日期进行复合条件查询)、进货退货查询、商品销售查询、销售退货查询、商品库存查询、商品销售排行;97 5、往来管理操作,包括商品进货结账(主要是结算没有结算完的帐目)、进货退货结账、商品销售结账、销售退货结账;6、系统设置操作,包括添加用户、修改密码、用户管理、退出登录。设计安排①3月15日—3月22日:通过网上查阅资料,去本县各大超市做市场调查,了解销售管理系统主要完成的内容;②3月23日—3月31日:明确开发此系统的目标和用户的信息需求,进行可行性分析,提出系统的逻辑模型;③4月1日—4月15日:完成系统的设计与实现;④4月16日—4月30日进行软件测试,完善该系统,根据软件系统撰写论文;⑤5月1日—5月15日:提交论文,准备论文答辩。最后完成时间2015年5月中旬备注指导教师:武昇2015年3月22日97 内容摘要本论文从毕业设计的课题出发,基于VisualStudio.NET平台,在这个基础上利用C#作为 ASP.Net的开发语言,并结合SQLServer2005数据库。从网站建设宗旨与方向,网站形象设计方向,网站建设的总体设计思想,网站框架,数据库的设计,部分功能模块的设计及代码,并加入自己的感想来介绍网站开发的过程。关键词:ASP.NET,C#,VisualStudio.NETThepresentpaperembarksfromthegraduationprojecttopic,basedonVisualStudio.NETplatform,inthisfoundationusingC#tookASP.Netthedevelopmentlanguage,andunifiesSQLServer2005databaseFromthewebsiteconstructionobjectiveandthedirection,thewebsiteimagedesigndirection,thewebsiteconstructionsystemdesignthought,thewebsiteframe,thedatabasedesign,thepartialfunctionsmoduledesignandthecode,andjoinownfeelingstointroducethewebsitedevelopmenttheprocessKeywords:ASP.NET,C#,VisualStudio.NET97 第一章可行性研究一、超市销售管理系统的意义社会生活的现代化,使得市场的走向发生巨大变化,由于经济的发展,人们对生活的需求已经不再满足于丰衣足食的低度要求,许多人们往往不是单纯为满足生活必需去购买,而是凭着喜欢、意欲和感观去购买。如果一个商店能够打动顾客、吸引顾客,自然顾客盈门,而近几年新兴产业中超级市场(SUPERMARKET)的现代化管理方式和便捷的购物方式,尤其是它轻松的购物环境。往往是打动顾客,吸引顾客的最主要的原因,且良好的周密的销售服务更是赢得信誉、吸引顾客的优势所在。商品经济的高速现代化发展也促进了竞争,使一切不甘落后的商家都争先恐后地采用最新的管理方法来加强自己的竞争地位。因此,超市经营者如果不掌握当今市场发展的这一走向,不能将超市现代化经营作为努力开拓的目标,就无法使经营活络、财源茂盛。随着计算机网络技术以及数据库技术的迅速发展,管理信息系统得到了广泛应用。对于一个超市来讲:数量少则数以百计,多则数以万计;另外,不同超市的实际情况也有所不同。要对这些进行统一、高效的管理,靠人工完成工作量庞大、难免有错漏之处。为此,一个自动化的超市销售管理系统的开发非常必要。二、可行性研究可行性研究的目的是为了对问题进行研究,以最小的代价在最短的时间内确定问题是否可解。经过对此项目进行详细调查研究,明确开发风险及其所带来的经济效益。(一)、经济上可行性1、本系统的运行可以代替传统的超市销售管理方式,大大缩短了空间和时间上的距离;97 2、本系统的运行可以很大程度上降低了成本;3、本系统的运行可以大大的提高工作效率;4、本系统可以使敏感文档更加安全(二)、技术上可行性本系统的开发我利用MicrosoftSQLServer2005作为本系统的数据库,它是一种高效的关系数据库系统,具有独立于硬件平台、对称的多处理器结构、抢占式多任务管理、完善的安全系统和容错功能,并具有易于维护的特点。区别于FoxPro、Access小型数据库,SQLServer是一个功能完备的数据库管理系统。它包括支持开发的引擎、标准的SQL语言、扩展的特性(如复制、OLAP、分析)等功能。在MicrosoftVisualStudio.NET2008中创建ASP.NETWeb应用程序,使用ASP.NET作为系统的开发环境,本系统使用的编程语言是C#,该语言是一种由Microsoft公司开发的包含协助开发环境的事件驱动编程语言,是世界上使用人数最多的语言,特点易用。综上所述,本系统的设计与开发在技术上和硬件设备上的条件都是满足的,因此,它在技术上是可行的。(三)、运行上可行性本系统所需的硬件和软件的要求,都是完全可以达到的。因此,本系统在运行上是可行的。(四)、法律可行性本系统在开发过程中没有涉及合同、责任等与法律相抵触的方面。因此,本系统在法律上是可行的。97 第二章需求分析21世纪以来,人类经济高速发展,社会生活发生了日新月异的变化,特别是计算机的应用已经普及到经济和社会生活的各个领域。使原本的旧的管理方法越来越不适应现在社会的发展。许多人还停留在以前的手工操作,这大大地阻碍了人类经济的发展。场地预约的信息化程度体现在将计算机及网络与信息技术应用于经营与管理,以现代化工具代替传统手工作业。本系统采用C#作为编程语言,以ASP.NET作为一个平台,以数据库MicrosoftSQLServer2005作为系统的后台操作,其功能在系统内部有源代码直接完成,我们只需按系统要求输入即可操作。一、客户需求分析(一)、对开发超市销售管理系统的要求1、成本低2、易操作3、数据的安全性4、功能完善并且将来可以扩充(二)、对系统的功能要求1、基本信息操作:(1)添加公司信息(2)添加商品信息(3)公司信息管理(4)商品信息管理2、进货管理操作:97 (1)添加进货信息(2)添加进货退货3、销售管理操作:(1)添加销售信息(2)添加销售退货4、查询统计操作:(1)商品进货查询(2)进货退货查询(3)商品销售查询(4)销售退货查询(5)商品库存查询(6)商品销售排行5、往来管理操作:(1)商品进货结账(2)进货退货结账(3)商品销售结账(4)销售退货结账6、系统设置操作:(1)添加用户(2)修改密码(3)用户管理(4)退出登录97 二、超市销售管理系统的目标(一)、充分利用互联网,提高信息化水平通过互联网突破了时间和空间限制实现了便捷快速的商品销售信息。在对数据信息有效组织并整合了一定使用功能后,基于INTERNET的超市销售管理系统可以随时实现办公的自动化,信息化。(二)、方便快捷,节约成本与传统的手工管理销售信息相比,本系统具有相当高的管理效率和安全性,节省人力,物力和财力。三、系统设计思想(一)、页面模块化本系统把页面中的一些常用代码编写为独立的单元。这是程序设计的重要思想,应该重点掌握。(二)、三层结构架构本系统采用三层架构设计,它的工作原理如图所示:用户界面功能代码数据存储SQLServer数据库C#代码超市销售管理系统操作界面采用三层架构,用户界面层通过统一的接口向业务层发送请求,业务层按照自己的逻辑规则在请求处理之后进行数据库操作,然后将数据库返回的数据返回给用户界面层。这样,用户界面与数据存储相互独立,用户界面层甚至可以不知道数据库的结构,而只是通过接口实现操作。97 第三章系统分析一、接口类型(一)、外部接口软件接口:Windows2008ServerWindowsXP或更高的操作系统(二)、内部接口:模块之间的接口;验证模块:启动系统时,便激活登录口令界面初始化模块:对系统进行初始化系统功能模块:接收系统功能的相应消息,启动信息录入、信息查询、信息维护等模块。二、系统建模完成需求分析之后,就需要对系统进行UML(Unified Modeling Language)建模。UML建模是对需求分析结果的模型建立过程。(一)、超市销售管理系统的系统结构功能:管理员系统设置往来管理查询统计销售管理进货管理基本信息添加公司信息添加商品信息公司信息管理商品信息管理添加进货信息添加进货退货添加销售信息添加销售退货商品进货查询进货退货查询商品销售查询销售退货查询商品库存查询,商品销售排行商品进货结账进货退货结账商品销售结账销售退货结账添加用户修改密码用户管理退出登录97 (二)、超市销售管理系统的数据库结构:主要包括:用户信息表(tb_User)、商品信息表(tb_Commodity)、商品数量表(tb_Stock)、账单信息表(tb_Reckoning)、公司信息表(tb_Company)。可以在类图中将上面这些域以及它们之间的关系表示出来,如图(3.2)所示:97 第四章系统的实现一、系统模块实现(一)、用户登录页面登录页面的代码:protectedvoidImageButton1_Click(objectsender,ImageClickEventArgse){stringusername=Request["username"];stringuserpwd=Request["userpwd"];stockClasssc=newstockClass();if(sc.validate(username)){Response.Write("");return;}if(sc.validate(userpwd)){97 Response.Write("");return;}if(this.ValidateNumber.Text!=this.Label1.Text){Response.Write("");return;}SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();SqlCommandscd=newSqlCommand("selectcount(*)asfffromtb_userwhereusername='"+username+"'anduserpwd='"+userpwd+"'",strcon);intcount=Convert.ToInt32(scd.ExecuteScalar());if(count>0){Session["username"]=username;Response.Redirect("default.aspx");}97 else{Response.Write("");return;}}(二)、程序主界面页面代码<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="Default"%>97 爱家超市销售管理系统

         操作员:当前日期:97       97 97 97
(三)、添加公司信息页面97 界面代码:<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Company_add.aspx.cs"Inherits="Bedrock_Company_add"%>添加公司信息基本信息→添加公司信息

97 添加公司信息*公司名称:*公司简称: *地址:**邮政编码:**联系电话:**传真:*联系人:97 **E-mail:*开户银行:*银行账号:所属类型:供应商客户97
后台代码:usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;97 usingSystem.Web.UI.HtmlControls;usingSystem.Data.SqlClient;publicpartialclassBedrock_Company_add:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(Convert.ToString(Session["username"])==""){Response.Write("alert('请登录');location='../login.aspx'");}}protectedvoidButton1_Click(objectsender,EventArgse){stringCompanyName=this.CompanyName.Text.ToString();stringCompanyType=this.CompanyType.Text.ToString();stringCompanyShort=this.CompanyShort.Text.ToString();stringCompanyAddress=this.CompanyAddress.Text.ToString();stringPostalcode=this.Postalcode.Text.ToString();stringTel=this.Tel.Text.ToString();stringFax=this.Fax.Text.ToString();stringLinkman=this.Linkman.Text.ToString();stringEmail=this.Email.Text.ToString();97 stringBank=this.Bank.Text.ToString();stringBandAccounts=this.BandAccounts.Text.ToString();stringUsername=Convert.ToString(Session["username"]);stringAddTime=Convert.ToString(DateTime.Now);SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();SqlCommandscd=newSqlCommand("insertintotb_Company(CompanyName,CompanyType,CompanyShort,CompanyAddress,Postalcode,Tel,Fax,Linkman,Email,Bank,BandAccounts,Username,AddTime)values('"+CompanyName+"','"+CompanyType+"','"+CompanyShort+"','"+CompanyAddress+"','"+Postalcode+"','"+Tel+"','"+Fax+"','"+Linkman+"','"+Email+"','"+Bank+"','"+BandAccounts+"','"+Username+"','"+AddTime+"')",strcon);scd.ExecuteNonQuery();Response.Write("alert('您已经添加成功');location='Company_add.aspx'");strcon.Close();}}97 (四)、添加商品信息页面界面代码:<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Commodity_add.aspx.cs"Inherits="Bedrock_Commodity_add"%>添加商品信息97 基本信息→添加商品信息

添加商品信息*商品名称:97 *商品简称:*产地:97 *单位:*规格:*批号:*批准文号:供应商:97 备注:
97 后台代码:usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Data.SqlClient;publicpartialclassBedrock_Commodity_add:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(Convert.ToString(Session["username"])==""){Response.Write("alert('请登录');location='../login.aspx'");return;97 }if(!IsPostBack){SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();SqlDataAdaptersda=newSqlDataAdapter("select*fromtb_CompanywhereCompanyType='供应商'orderbyiddesc",strcon);DataSetds=newDataSet();sda.Fill(ds,"tb_Company");this.CompanyId.DataSource=ds;this.CompanyId.DataValueField="id";this.CompanyId.DataTextField="CompanyName";this.CompanyId.DataBind();}}protectedvoidButton1_Click(objectsender,EventArgse){stringCommodityName=this.CommodityName.Text.ToString();stringShortName=this.ShortName.Text.ToString();stringProducePlace=this.ProducePlace.Text.ToString();stringUnit=this.Unit.Text.ToString();97 stringSpecs=this.Specs.Text.ToString();stringPassNumber=this.PassNumber.Text.ToString();stringPassList=this.PassList.Text.ToString();stringCompanyId=this.CompanyId.Text.ToString();stringRemark=this.Remark.Text.ToString();stringUsername=Convert.ToString(Session["username"]);stringAddTime=Convert.ToString(DateTime.Now);SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();SqlCommandscd=newSqlCommand("insertintotb_Commodity(CommodityName,ShortName,ProducePlace,Unit,Specs,PassNumber,PassList,CompanyId,Remark,Username,AddTime)values('"+CommodityName+"','"+ShortName+"','"+ProducePlace+"','"+Unit+"','"+Specs+"','"+PassNumber+"','"+PassList+"','"+CompanyId+"','"+Remark+"','"+Username+"','"+AddTime+"')",strcon);scd.ExecuteNonQuery();strcon.Close();Response.Write("alert('您已经添加成功');location='Commodity_add.aspx'");}}97 (五)、添加进货信息页面界面代码:<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Stock_add.aspx.cs"Inherits="Stock_Stock_return"%>添加进货信息functionjisuan(){97 n1=document.form1.Pirce.value;n2=document.form1.Number.value;document.form1.Payment.value=n1*n2;fact();}functionfact(){varpayment;varfactpayment;payment=document.form1.Payment.value;factpayment=document.form1.FactPayment.value;if(payment-factpayment<0){alert('实际支付填写错误');form1.FactPayment.select();}else{document.form1.NotPayment.value=payment-factpayment;}}97
进货管理→添加进货信息
添加进货信息*商品名称:*供应商:**数        量:**单        价:结算方式:97 现金支票进货日期:97  *应付金额:**实付金额: *未付金额:*经手人:97 操作员:
后台代码:usingSystem;usingSystem.Data;97 usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Data.SqlClient;publicpartialclassStock_Stock_return:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){this.Label1.Text=Convert.ToString(Session["username"]);if(Convert.ToString(Session["username"])==""){Response.Write("alert('请登录');location='../login.aspx'");}SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);97 strcon.Open();SqlDataAdaptersda=newSqlDataAdapter("select*fromtb_Commodityorderbyiddesc",strcon);DataSetds=newDataSet();sda.Fill(ds,"tb_Commodity");DataRowViewrowview=ds.Tables["tb_Commodity"].DefaultView[0];intCommodityIds=Convert.ToInt32(rowview["CompanyId"]);this.CommodityId.DataSource=ds.Tables["tb_Commodity"];this.CommodityId.DataValueField="id";this.CommodityId.DataTextField="CommodityName";this.CommodityId.DataBind();SqlCommandscdc=newSqlCommand("selectCompanyNamefromtb_Companywhereid="+CommodityIds,strcon);this.CId.Text=Convert.ToString(scdc.ExecuteScalar());this.CompanyId.Value=CommodityIds.ToString();strcon.Close();this.StockDate.SelectedDate=DateTime.Now;}}protectedvoidButton1_Click(objectsender,EventArgse){stringCommodityId=this.CommodityId.Text.ToString();stringCompanyId=this.CompanyId.Value.ToString();97 intNumber=Math.Abs(Convert.ToInt32(this.Number.Text));intPirce=Math.Abs(Convert.ToInt32(this.Pirce.Text));stringStockDate=this.StockDate.SelectedDate.ToShortDateString();stringSettlementType=this.SettlementType.Text.ToString();intPayment=Math.Abs(Convert.ToInt32(Request["Payment"]));intFactPayment=Math.Abs(Convert.ToInt32(this.FactPayment.Text));intNotPayment=Math.Abs(Convert.ToInt32(Request["NotPayment"]));stringManageMan=this.ManageMan.Text.ToString();stringUsername=Convert.ToString(Session["username"]);stringAddTime=Convert.ToString(DateTime.Now);stringType="进货信息";//计算输入的金额是否正确if(Number*Pircealert('应付金额填写错误');history.back()");Response.End();}SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();97 SqlCommandscd=newSqlCommand("insertintotb_Stock(CommodityId,CompanyId,Number,Pirce,StockDate,SettlementType,Payment,FactPayment,NotPayment,ManageMan,Username,AddTime,Type)values('"+CommodityId+"','"+CompanyId+"','"+Number+"','"+Pirce+"','"+StockDate+"','"+SettlementType+"','"+Payment+"','"+FactPayment+"','"+NotPayment+"','"+ManageMan+"','"+Username+"','"+AddTime+"','"+Type+"')",strcon);scd.ExecuteNonQuery();strcon.Close();Response.Write("alert('添加成功');location='Stock_return.aspx'");}protectedvoidCommodityId_TextChanged(objectsender,EventArgse){SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();SqlDataAdaptersda=newSqlDataAdapter("select*fromtb_Commoditywhereid="+Request["CommodityId"],strcon);DataSetds=newDataSet();sda.Fill(ds,"tb_Commodity");DataRowViewrowview=ds.Tables["tb_Commodity"].DefaultView[0];97 stringCommodityIds=Convert.ToString(rowview["CompanyId"]);this.CommodityId.DataBind();SqlCommandscdc=newSqlCommand("selectCompanyNamefromtb_Companywhereid="+CommodityIds,strcon);this.CId.Text=Convert.ToString(scdc.ExecuteScalar());this.CompanyId.Value=CommodityIds;}}(六)、添加销售信息页面界面代码:<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Sell_add.aspx.cs"Inherits="Sell_Sell_add"%>97 添加销售信息functionjisuan(){n1=document.form1.Pirce.value;n2=document.form1.Number.value;document.form1.Payment.value=n1*n2;fact();}functionfact(){varpayment;varfactpayment;payment=document.form1.Payment.value;factpayment=document.form1.FactPayment.value;if(payment-factpayment<0){alert('实际支付填写错误');form1.FactPayment.select();97 }else{document.form1.NotPayment.value=payment-factpayment;}}销售管理→添加销售信息
 添加销售信息97 *商品名称:*供应商:客户名称:97 结算方式:现金支票**单        价:97 销售日期:97 **数        量: *应收金额:**实收金额: *未收金额:*经手人:操作员:
后台代码:usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Data.SqlClient;publicpartialclassSell_Sell_add:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse)97 {if(Convert.ToString(Session["username"])==""){Response.Write("alert('请登录');location='../login.aspx'");return;}if(!IsPostBack){this.Label1.Text=Convert.ToString(Session["username"]);SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();SqlDataAdaptersda=newSqlDataAdapter("select*fromtb_Commodityorderbyiddesc",strcon);DataSetds=newDataSet();sda.Fill(ds,"tb_Commodity");DataRowViewrowview=ds.Tables["tb_Commodity"].DefaultView[0];intCommodityIds=Convert.ToInt32(rowview["CompanyId"]);this.CommodityId.DataSource=ds.Tables["tb_Commodity"];this.CommodityId.DataValueField="id";this.CommodityId.DataTextField="CommodityName";97 this.CommodityId.DataBind();SqlCommandscdc=newSqlCommand("selectCompanyNamefromtb_Companywhereid="+CommodityIds,strcon);this.CId.Text=Convert.ToString(scdc.ExecuteScalar());this.CompanyId.Value=CommodityIds.ToString();//显示客户SqlDataAdaptersdac=newSqlDataAdapter("select*fromtb_CompanywhereCompanyType='客户'orderbyiddesc",strcon);sdac.Fill(ds,"tb_Company");this.ClientId.DataSource=ds.Tables["tb_Company"];this.ClientId.DataValueField="id";this.ClientId.DataTextField="CompanyName";this.ClientId.DataBind();//计算剩余商品数量stockClassss=newstockClass();Session["snum"]=ss.stock(Convert.ToInt32(rowview["id"]))-ss.sell(Convert.ToInt32(rowview["id"]));this.Number.Text=Convert.ToString(ss.stock(Convert.ToInt32(rowview["id"]))-ss.sell(Convert.ToInt32(rowview["id"])));this.StockDate.SelectedDate=DateTime.Now;}}protectedvoidButton1_Click(objectsender,EventArgse)97 {if(Convert.ToInt32(Session["snum"])alert('没有更多的库存,请重新填写');history.back()");Response.End();}stringCommodityId=this.CommodityId.Text.ToString();stringCompanyId=this.CompanyId.Value.ToString();intClientId=Convert.ToInt32(Request["ClientId"]);intNumber=Math.Abs(Convert.ToInt32(this.Number.Text));intPirce=Math.Abs(Convert.ToInt32(this.Pirce.Text));stringStockDate=this.StockDate.SelectedDate.ToShortDateString();stringSettlementType=this.SettlementType.Text.ToString();intPayment=Math.Abs(Convert.ToInt32(Request["Payment"]));intFactPayment=Math.Abs(Convert.ToInt32(this.FactPayment.Text));intNotPayment=Math.Abs(Convert.ToInt32(Request["NotPayment"]));stringManageMan=this.ManageMan.Text.ToString();stringUsername=Convert.ToString(Session["username"]);97 stringAddTime=Convert.ToString(DateTime.Now);stringType="销售信息";//计算输入的金额是否正确if(Number*Pircealert('应付金额填写错误');history.back()");Response.End();}SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();SqlCommandscd=newSqlCommand("insertintotb_Stock(CommodityId,CompanyId,Number,Pirce,StockDate,SettlementType,Payment,FactPayment,NotPayment,ManageMan,Username,AddTime,Type,ClientId)values('"+CommodityId+"','"+CompanyId+"','"+Number+"','"+Pirce+"','"+StockDate+"','"+SettlementType+"','"+Payment+"','"+FactPayment+"','"+NotPayment+"','"+ManageMan+"','"+Username+"','"+AddTime+"','"+Type+"','"+ClientId+"')",strcon);scd.ExecuteNonQuery();strcon.Close();Response.Write("alert('添加成功');location='Sell_add.aspx'");}protectedvoidCommodityId_TextChanged(objectsender,EventArgse){SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();SqlDataAdaptersda=newSqlDataAdapter("select*fromtb_Commoditywhereid="+Request["CommodityId"],strcon);DataSetds=newDataSet();sda.Fill(ds,"tb_Commodity");DataRowViewrowview=ds.Tables["tb_Commodity"].DefaultView[0];stringCommodityIds=Convert.ToString(rowview["CompanyId"]);SqlCommandscdc=newSqlCommand("selectCompanyNamefromtb_Companywhereid="+CommodityIds,strcon);this.CId.Text=Convert.ToString(scdc.ExecuteScalar());this.CompanyId.Value=CommodityIds;stockClassss=newstockClass();Session["snum"]=ss.stock(Convert.ToInt32(rowview["id"]))-ss.sell(Convert.ToInt32(rowview["id"]));97 this.Number.Text=Convert.ToString(ss.stock(Convert.ToInt32(rowview["id"]))-ss.sell(Convert.ToInt32(rowview["id"])));}}(七)、商品进货查询页面界面代码:<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Stock_search.aspx.cs"Inherits="Stock_Stock_search"%>97 商品进货查询查询统计→查询
 97 2006-01-01 至 97
97 后台代码:usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Data.SqlClient;publicpartialclassStock_Stock_search:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(Convert.ToString(Session["username"])==""){Response.Write("alert('请登录');location='../login.aspx'");}if(!IsPostBack){Session["sql"]="";this.bind();this.ED.Text=Convert.ToString(DateTime.Today.ToShortDateString());}}protectedvoidGridView1_PageIndexChanging(objectsender,GridViewPageEventArgse){GridView1.PageIndex=e.NewPageIndex;this.bind();}protectedvoidGridView1_RowEditing(objectsender,GridViewEditEventArgse){stringid=GridView1.DataKeys[e.NewEditIndex].Value.ToString();Response.Write("");Response.Write("");97 }protectedvoidGridView1_RowDataBound(objectsender,GridViewRowEventArgse){if(e.Row.RowType==DataControlRowType.DataRow){e.Row.Cells[4].Text=(Convert.ToDateTime(e.Row.Cells[4].Text)).ToShortDateString();if((e.Row.Cells[1].Text).Length>6){e.Row.Cells[1].Text=(e.Row.Cells[1].Text).Substring(0,6)+"…";}if((e.Row.Cells[0].Text).Length>6){e.Row.Cells[0].Text=(e.Row.Cells[0].Text).Substring(0,6)+"…";}}}protectedvoidButton1_Click(objectsender,EventArgse){stringSql="";97 if(CheckBox1.Checked){Sql=Sql+"andCompanyNamelike'%"+TN.Text+"%'";}if(CheckBox2.Checked){Sql=Sql+"andCommodityNamelike'%"+PN.Text+"%'";}if(CheckBox3.Checked){Sql=Sql+"andManageManlike'%"+MM.Text+"%'";}if(CheckBox4.Checked){Sql=Sql+"andStockDatebetween'"+SD.Text+"'and'"+ED.Text+"'";}Session["sql"]=Sql;this.bind();}publicvoidbind(){stringstrsql,type;if(Request["type"]=="st")97 {type="进货信息";this.Label1.Text=type;}else{type="进货退货";this.Label1.Text=type;}strsql="select*fromstockwheretype='"+type+"'"+Session["sql"]+"orderbyiddesc";SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();SqlDataAdaptersda=newSqlDataAdapter(strsql,strcon);DataSetds=newDataSet();sda.Fill(ds,"search");GridView1.DataSource=ds.Tables["search"];GridView1.DataKeyNames=newstring[]{"id"};GridView1.DataBind();}protectedvoidButton2_Click(objectsender,EventArgse){97 Session["sql"]="";this.bind();}}(八)、商品销售查询页面界面代码:<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Sell_search.aspx.cs"Inherits="Stock_Sell_search"%>商品销售查询97 查询统计→查询

 97 2006-01-01 至 97 97    97 后台代码:usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Data.SqlClient;publicpartialclassStock_Sell_search:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){if(Convert.ToString(Session["username"])==""){97 Response.Write("alert('请登录');location='../login.aspx'");}Session["sql"]="";this.bind();this.ED.Text=Convert.ToString(DateTime.Today.ToShortDateString());}}protectedvoidGridView1_PageIndexChanging(objectsender,GridViewPageEventArgse){GridView1.PageIndex=e.NewPageIndex;this.bind();}protectedvoidGridView1_RowEditing(objectsender,GridViewEditEventArgse){stringid=GridView1.DataKeys[e.NewEditIndex].Value.ToString();Response.Write("");97 Response.Write("");}protectedvoidGridView1_RowDataBound(objectsender,GridViewRowEventArgse){if(e.Row.RowType==DataControlRowType.DataRow){e.Row.Cells[4].Text=(Convert.ToDateTime(e.Row.Cells[4].Text)).ToShortDateString();if((e.Row.Cells[1].Text).Length>6){e.Row.Cells[1].Text=(e.Row.Cells[1].Text).Substring(0,6)+"…";}if((e.Row.Cells[0].Text).Length>6){e.Row.Cells[0].Text=(e.Row.Cells[0].Text).Substring(0,6)+"…";}if((e.Row.Cells[2].Text).Length>6){e.Row.Cells[2].Text=(e.Row.Cells[2].Text).Substring(0,6)+"…";97 }}}protectedvoidButton1_Click(objectsender,EventArgse){stringSql="";if(CheckBox1.Checked){Sql=Sql+"andCompanyNamelike'%"+TN.Text+"%'";}if(CheckBox2.Checked){Sql=Sql+"andCommodityNamelike'%"+PN.Text+"%'";}if(CheckBox3.Checked){Sql=Sql+"andkehulike'%"+MM.Text+"%'";}if(CheckBox4.Checked){Sql=Sql+"andStockDatebetween'"+SD.Text+"'and'"+ED.Text+"'";}Session["sql"]=Sql;this.bind();}publicvoidbind(){stringstrsql,type;if(Request["type"]=="se")97 {type="销售信息";}else{type="销售退货";}Label1.Text=type;strsql="select*fromsellwheretype='"+type+"'"+Session["sql"]+"orderbyiddesc";SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();SqlDataAdaptersda=newSqlDataAdapter(strsql,strcon);DataSetds=newDataSet();sda.Fill(ds,"search");GridView1.DataSource=ds.Tables["search"];GridView1.DataKeyNames=newstring[]{"id"};GridView1.DataBind();}protectedvoidButton2_Click(objectsender,EventArgse){Session["sql"]="";this.bind();}}97 (九)、商品库存查询页面界面代码:<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Stock_search.aspx.cs"Inherits="Stock_Stock_search"%>商品库存查询97 查询统计→查询
 2006-01-01 至    97 后台代码:usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Data.SqlClient;publicpartialclassStock_Stock_search:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(Convert.ToString(Session["username"])==""){Response.Write("alert('请登录');location='../login.aspx'");}if(!IsPostBack){97 Session["sql"]="";this.bind();this.ED.Text=Convert.ToString(DateTime.Today.ToShortDateString());}}protectedvoidGridView1_PageIndexChanging(objectsender,GridViewPageEventArgse){GridView1.PageIndex=e.NewPageIndex;this.bind();}protectedvoidGridView1_RowEditing(objectsender,GridViewEditEventArgse){stringid=GridView1.DataKeys[e.NewEditIndex].Value.ToString();Response.Write("");Response.Write("");}protectedvoidGridView1_RowDataBound(objectsender,97 GridViewRowEventArgse){if(e.Row.RowType==DataControlRowType.DataRow){e.Row.Cells[4].Text=(Convert.ToDateTime(e.Row.Cells[4].Text)).ToShortDateString();if((e.Row.Cells[1].Text).Length>6){e.Row.Cells[1].Text=(e.Row.Cells[1].Text).Substring(0,6)+"…";}if((e.Row.Cells[0].Text).Length>6){e.Row.Cells[0].Text=(e.Row.Cells[0].Text).Substring(0,6)+"…";}}}protectedvoidButton1_Click(objectsender,EventArgse){stringSql="";if(CheckBox1.Checked){97 Sql=Sql+"andCompanyNamelike'%"+TN.Text+"%'";}if(CheckBox2.Checked){Sql=Sql+"andCommodityNamelike'%"+PN.Text+"%'";}if(CheckBox3.Checked){Sql=Sql+"andManageManlike'%"+MM.Text+"%'";}if(CheckBox4.Checked){Sql=Sql+"andStockDatebetween'"+SD.Text+"'and'"+ED.Text+"'";}Session["sql"]=Sql;this.bind();}publicvoidbind(){stringstrsql,type;if(Request["type"]=="st"){type="进货信息";97 this.Label1.Text=type;}else{type="进货退货";this.Label1.Text=type;}strsql="select*fromstockwheretype='"+type+"'"+Session["sql"]+"orderbyiddesc";SqlConnectionstrcon=newSqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);strcon.Open();SqlDataAdaptersda=newSqlDataAdapter(strsql,strcon);DataSetds=newDataSet();sda.Fill(ds,"search");GridView1.DataSource=ds.Tables["search"];GridView1.DataKeyNames=newstring[]{"id"};GridView1.DataBind();}protectedvoidButton2_Click(objectsender,EventArgse){Session["sql"]="";97 this.bind();}}第五章结束语经过一个多月的设计和开发,本系统基本开发完毕。但是由于毕业设计时间较短,所以该系统还有许多不尽如人意的地方,比如功能上面的不够完善,出错处理不够等多方面问题。这些都有待进一步改善。致谢在毕业设计的这一个月里毕业设计中,指导老师们从他们繁忙的工作时间中不时抽出宝贵的时间对我们进行了耐心解答和指导,从开始的无从下手到看到基本正常运行的系统,凝聚老师们的辛勤心血,指导们的那种严谨的教学态度和丰富的理论和实践经验让我们受益非浅,从他们的身上学到了很多很多,无论是理论还是实践方面都使我们的知识有很大的提高,借此特提出感谢。同时感谢所有任课老师,谢谢他们为本系统提供的帮助,让我能够顺利地完成本系统的开发,顺利的完成毕业设计。也感谢那些对我提供帮助的同学,没有他们就不会有现在的系统。97 参考文献[1]王小科、徐薇,《C#从入门到精通》,清华大学出版社,2010年7月。[2]庞娅娟、吕双、房大伟,《ASP.NET从入门到精通》,清华大学出版社,2010年7月。[3]陈轮、刘蕾等,《程序天下ASP.NET3.5网络数据库开发实例自学手册》,电子工业出版社,2008年5月。[4]房大伟、吕双等编著,《ASP.NET1200例》,清华大学出版社,2011年6月。[5]秦婧、刘存勇编著,《21天学通SQLserver2005》,电子工业出版社,2011年10月。[6]赵松涛编著,《深入浅出SQLServer2005系统管理与应用研究开发》,电子工业出版社,2009年2月。[7]陈明主编,《软件工程》,中央电大出版社,2001年7月。97

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。
大家都在看
近期热门
关闭