设备管理系统-源代码及运行界面_第1页
设备管理系统-源代码及运行界面_第2页
设备管理系统-源代码及运行界面_第3页
设备管理系统-源代码及运行界面_第4页
设备管理系统-源代码及运行界面_第5页
已阅读5页,还剩59页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、各类专业好文档,值得你下载,教育,管理,论文,制度,方案手册,应有尽有各类专业好文档,值得你下载,教育,管理,论文,制度,方案手册,应有尽有源代码及运行界面model类Depart。cs using System;using System.Collections。Generic;using System.Linq;using System。Text;namespace model public class Depart public Depart() #region model private int _departid; private string _departname; private

2、 int _parentid; public int DepartID set _departid = value; get return _departid; public string DepartName set _departname = value; get return _departname; public int ParentID set _parentid = value; get return _parentid; #endregion model Device.cs using System;using System.Collections。Generic;using S

3、ystem.Linq;using System.Text;namespace model public class Device public Device() #region model private int _deviceid; private string _devicetypeid; private int _typeid; private int _classid; private string _devicestate; private Single _price; private int _useofyear; private Single _svp; private stri

4、ng _manufacture; private DateTime _stocktime; public int DeviceID set _deviceid = value; get return _deviceid; public string DeviceTypeID set _devicetypeid = value; get return _devicetypeid; public int TypeID set _typeid = value; get return _typeid; public int ClassID set _classid = value; get retur

5、n _classid; public string DeviceState set _devicestate = value; get return _devicestate; public Single Price set _price = value; get return _price; public int UseOfYear set _useofyear = value; get return _useofyear; public Single SVP set _svp = value; get return _svp; public string Manufacture set _

6、manufacture = value; get return _manufacture; public DateTime StockDate set _stocktime = value; get return _stocktime; #endregion model DeviceClass.cs using System;using System。Collections。Generic;using System.Linq;using System。Text;namespace model public class DeviceClass public DeviceClass() #regi

7、on model private int _classid; private string _classname; private int _typeid; public int ClassID set _classid = value; get return _classid; public string ClassName set _classname = value; get return _classname; public int TypeID set _typeid = value; get return _typeid; endregion model DeviceType.cs

8、 using System;using System.Collections.Generic;using System。Linq;using System。Text;namespace model public class DeviceType public DeviceType() #region model private int _typeid; private string _typename; public int TypeID set _typeid = value; get return _typeid; public string TypeName set _typename

9、= value; get return _typename; endregion model RepairInfo。cs using System;using System.Collections.Generic;using System。Linq;using System.Text;namespace model public class RepairInfo public RepairInfo() #region model private int _repairid; private int _deviceid; private string _repairpeople; private

10、 DateTime _beginrepairdate; private Single _repairprice; private int _repairoftime; private string _faultcause; private string _remark; public int RepairID set _repairid = value; get return _repairid; public int DeviceID set _deviceid = value; get return _deviceid; public string RepairPeople set _re

11、pairpeople = value; get return _repairpeople; public DateTime BeginRepairDate set _beginrepairdate = value; get return _beginrepairdate; public Single RepairPrice set _repairprice = value; get return _repairprice; public int RepairOfTime set _repairoftime = value; get return _repairoftime; public st

12、ring FaultCause set _faultcause = value; get return _faultcause; public string Remark set _remark = value; get return _remark; endregion model TransInfo。cs using System;using System。Collections。Generic;using System.Linq;using System。Text;namespace model public class TransInfo public TransInfo() #reg

13、ion model private int _transid; private int _deviceid; private int _departid; private string _usepeople; private DateTime _begintransdate; private int _useofmonth; private string _remark; public int TransID set _transid = value; get return _transid; public int DeviceID set _deviceid = value; get ret

14、urn _deviceid; public int DepartID set _departid = value; get return _departid; public string UsePeople set _usepeople = value; get return _usepeople; public DateTime BeginTransDate set _begintransdate = value; get return _begintransdate; public int UseOfMonth set _useofmonth = value; get return _us

15、eofmonth; public string Remark set _remark = value; get return _remark; endregion model UserLevel。cs using System;using System。Collections.Generic;using System.Linq;using System.Text;namespace model public class UserLevel public UserLevel() region model private string _levelid; private string _level

16、name; private string _description; public string LevelID set _levelid = value; get return _levelid; public string LevelName set _levelname = value; get return _levelname; public string Description set _description = value; get return _description; #endregion model Users.cs using System;using System.

17、Collections。Generic;using System.Linq;using System.Text;namespace model public class Users public Users() #region model private string _userid; private string _userpwd; private string _levelid; public string UserID set _userid = value; get return _userid; public string UserPwd set _userpwd = value;

18、get return _userpwd; public string LevelID set _levelid = value; get return _levelid; #endregion model DAL类Depart.cs using System;using System。Collections.Generic;using System。Linq;using System。Text;using System。Collections;using System。Data;using System。Data。SqlClient;namespace DAL public class Dep

19、art sqlhelp sql = new sqlhelp(); public Depart() #region 成员方法 public ArrayList GetListByParentID(int pid) ArrayList al = new ArrayList(); string s = select from Depart where ParentID= + pid; DataTable dt = null; dt = sql.Execusql(s); for (int i = 0; i dt.Rows.Count; i+) model.Depart modeldepart = ne

20、w model.Depart(); modeldepart.DepartID = Convert.ToInt32(dt.RowsiDepartID”); modeldepart。ParentID = Convert。ToInt32(dt.Rowsi”ParentID”); modeldepart.DepartName = dt.RowsiDepartName。ToString(); al。Add(modeldepart); return al; public int Insert(model.Depart mod) int n = 0; string s = Insert into Depar

21、t(DepartName,ParentID) values( + mod.DepartName + ”,” + mod.ParentID + ); n = sql。Execsql(s); return n; public ArrayList GetList() ArrayList al = new ArrayList(); string s = select from Depart where DepartID!=1; DataTable dt = null; dt = sql.Execusql(s); for (int i = 0; i dt。Rows.Count; i+) model.De

22、part modeldepart = new model。Depart(); modeldepart.DepartID = Convert。ToInt32(dt.Rowsi”DepartID”); modeldepart.ParentID = Convert。ToInt32(dt.RowsiParentID”); modeldepart.DepartName = dt。RowsiDepartName”。ToString(); al。Add(modeldepart); return al; public DataTable GetDepartList(string strwhere) DataT

23、able dt = null; string s = select * from View2 where ” + strwhere; if (strwhere = ”) s = select * from View2”; dt = sql.Execusql(s); return dt; public DataTable GetDepartByID(int id) DataTable dt = null; string s = select * from Depart where DepartID=+id; dt = sql。Execusql(s); return dt; public int

24、Update(model.Depart mod) int n = 0; string s = ”Update Depart Set DepartName=” + mod。DepartName + ”,ParentID= + mod.ParentID + where DepartID= + mod。DepartID; n = sql。Execsql(s); return n; public int Delete(int id) int n = 0; string s = ”delete from Depart where DepartID=”+id; n = sql.Execsql(s); re

25、turn n; #endregion 成员方法 Device.cs using System;using System。Collections.Generic;using System。Linq;using System.Text;using System。Data;using System.Data。SqlClient;namespace DAL public class Device sqlhelp sql = new sqlhelp(); public Device() #region 成员方法 public DataTable GetDeviceByID(int deviceid) s

26、tring s = ”select * from Device where DeviceID= + deviceid; DataTable dt = null; dt = sql。Execusql(s); return dt; public int Insert(model.Device modeldevice) int n = 0; string s = Insert into Device values( + modeldevice。DeviceID + ”,” + modeldevice.DeviceTypeID + ”,” + modeldevice。TypeID + ,+modeld

27、evice.ClassID+”, + modeldevice.DeviceState + , + modeldevice.Price + ,” + modeldevice.UseOfYear+ ”, + modeldevice。SVP+ ,” + modeldevice。Manufacture+ ,+modeldevice。StockDate+”)”; n = sql。Execsql(s); return n; public DataTable GetList(string strwhere) DataTable dt = null; string s = Select * from View

28、1 where ” + strwhere; if (strwhere = ) s = select from View1”; dt = sql.Execusql(s); return dt; public DataTable GetDeviceList(string strwhere) DataTable dt = null; string s = Select * from Device where ” + strwhere; if (strwhere = ”) s = select * from Device”; dt = sql。Execusql(s); return dt; publi

29、c int Delete(int id) int n = 0; string s = ”delete from Device where DeviceID=” +id; n = sql。Execsql(s); return n; public int Update(model。Device mod) int n = 0; string s = Update Device set DeviceState= + mod。DeviceState + ,TypeID=+mod。TypeID+”,ClassID=+mod。ClassID+, DeviceTypeID= + mod。DeviceTypeI

30、D + ”,Price=” + mod。Price + ,SVP= + mod。SVP + ”,StockDate= + mod。StockDate + ,Manufacture=” + mod.Manufacture + ”,UseOfYear= + mod.UseOfYear + where DeviceID=” + mod。DeviceID ; n = sql。Execsql(s); return n; endregion 成员方法 DeviceClass。cs using System;using System.Collections。Generic;using System。Linq

31、;using System.Text;using System。Data;using System。Data。SqlClient;namespace DAL public class DeviceClass sqlhelp sql = new sqlhelp(); public DeviceClass() #region 成员方法 public DataTable GetClass(int id) string s = select * from DeviceClass where TypeID=” + id; DataTable dt = null; dt = sql.Execusql(s)

32、; return dt; / / 得到设备类别列表 / public DataTable getDeviceClassList() string sqlstr = select from DeviceClass; DataTable dt = sql。Execusql(sqlstr); return dt; / summary / 条件查询 / / param name=strClassId / param name=strClassName/param / param name=strTypeID / public DataTable findDeviceClassList(string s

33、trClassId,string strClassName,string strTypeID) if (strClassId。Trim()。Length = 0) strClassId = ”; if (strClassName.Trim()。Length = 0) strClassName = ”; if (strTypeID。Trim().Length = 0) strTypeID = %; string sqlstr = ”select * from DeviceClass where ClassId like + strClassId.Trim() + and ClassName li

34、ke %” + strClassName。Trim() + and TypeID like %” + strTypeID.Trim() + %”; DataTable dt = sql。Execusql(sqlstr); return dt; / summary / 得到一条设备类别记录 / /param / returns public model.DeviceClass getDeviceClassModel(int id) model.DeviceClass model = new model。DeviceClass(); string sqlstr = ”select * from D

35、eviceClass where ClassID= + id; DataTable dt = sql。Execusql(sqlstr); if (dt.Rows。Count 0) if (dt。Rows0”ClassID。ToString() != ”) model.ClassID = int。Parse(dt。Rows0ClassID。ToString()); model.ClassName = dt.Rows0”ClassName。ToString(); return model; else return null; / summary / 修改设备类别记录 / /summary / pa

36、ram name=model / returns public int updateDeviceClass(model.DeviceClass model) int n = 0; string sqlstr = update DeviceClass set ClassName=” + model。ClassName + ”,TypeID=”+model。TypeID+ where ClassID=” + model.ClassID; n = sql.Execsql(sqlstr); return n; / / 删除一条设备类别记录 / /summary / /param / returns p

37、ublic int deleteDeviceClass(int id) int n = 0; string sqlstr = delete from DeviceClass where ClassID=” + id; n = sql。Execsql(sqlstr); return n; / summary / 获得类别最大编号 / public int getMaxId() int n = 0; string sqlstr = ”select max(ClassID) from DeviceClass”; DataTable dt = sql。Execusql(sqlstr); n = Con

38、vert。ToInt32(dt.Rows00); return n; / summary / 增加一个设备类别记录 / /summary / param name=”model / returns/returns public int addDeviceClass(model。DeviceClass model) int n = 0; int id = getMaxId() + 1; string sqlstr = insert into DeviceClass(ClassID,ClassName,TypeID) values( + id + ”,” + model。ClassName + ”

39、,” + model。TypeID + ”)”; n = sql。Execsql(sqlstr); return n; #endregion 成员方法 DeviceType.cs using System;using System。Collections。Generic;using System。Linq;using System。Text;using System.Data;using System.Data。SqlClient;namespace DAL public class DeviceType sqlhelp sql = new sqlhelp(); public DeviceTy

40、pe() #region 成员方法 public DataTable GetTypeList() DataTable dt = null; string s = select * from DeviceType”; dt = sql。Execusql(s); return dt; / summary / 得到设备类型列表 / public DataTable getDeviceTypeList() string sqlstr = select * from DeviceType; DataTable dt=sql。Execusql(sqlstr); return dt; / /param /

41、returns public model。DeviceType getDeviceTypeModel(int id) model.DeviceType model = new model.DeviceType(); string sqlstr = select from DeviceType where TypeID=”+id; DataTable dt = sql.Execusql(sqlstr); if (dt.Rows.Count 0) if (dt.Rows0”TypeID”。ToString() != ”) model.TypeID = int.Parse(dt。Rows0”Type

42、ID.ToString(); model。TypeName = dt。Rows0”TypeName.ToString(); return model; else return null; / summary / 修改设备类型记录 / / /returns public int updateDeviceType(model。DeviceType model) int n = 0; string sqlstr = ”update DeviceType set TypeName= + model。TypeName + where TypeID=”+model.TypeID; n=sql。Execsq

43、l(sqlstr); return n; / summary / 插入一条设备类型记录 / /summary / / returns/returns public int addDeviceType(model.DeviceType model) int n = 0; string sqlstr = insert into DeviceType(TypeName) values( + model。TypeName + ); n = sql。Execsql(sqlstr); return n; / summary / 删除一条设备类型记录 / / param name=”id / /return

44、s public int deleteDeviceType(int id) int n = 0; string sqlstr = ”delete from DeviceType where TypeID= + id; n = sql。Execsql(sqlstr); return n; / / 条件查询 / / param name=”strUserID/param / param name=strLevelID”/param / returns/returns public DataTable findDeviceTypeList(string strTypeID, String strTy

45、peName) string sqlstr = ”; if (strTypeID.Trim().Length = 0) if (strTypeName。Trim()。Length = 0) strTypeName = ”%”; sqlstr = ”select from DeviceType where TypeName like + strTypeName。Trim() + %; else if (strTypeName.Trim().Length = 0) strTypeName = ”; sqlstr = select from DeviceType where TypeID=” +Co

46、nvert。ToInt32(strTypeID.Trim()) + and TypeName like % + strTypeName.Trim() + ; DataTable dt = sql。Execusql(sqlstr); return dt; #endregion 成员方法 RepairInfo。cs using System;using System。Collections.Generic;using System。Linq;using System。Text;using System.Data;using System。Data.SqlClient;namespace DAL p

47、ublic class RepairInfo sqlhelp sql = new sqlhelp(); public RepairInfo() #region 成员方法 public int Insert(model.RepairInfo mod) int n = 0,m=0 ; string s = Insert into RepairInfo(DeviceID,RepairPeople,BeginRepairDate,RepairPrice,RepairOfTime,FaultCause,Remark) values(”+mod.DeviceID+,”+mod.RepairPeople+,

48、+mod。BeginRepairDate+”,”+mod。RepairPrice+”,”+mod.RepairOfTime+”,”+mod.FaultCause+,”+mod.Remark+”)”; n = sql。Execsql(s); if (mod。Remark = 正在维修) s = ”Update Device set DeviceState=故障where DeviceID=” + mod。DeviceID; m = sql。Execsql(s); else s = Update Device set DeviceState=空闲 where DeviceID= + mod.Dev

49、iceID; m = sql.Execsql(s); if (m = 1 & n = 1) n = 1; else n = 0; return n; public DataTable GetList(string strwhere) DataTable dt = null; string s = Select * from RepairInfo where + strwhere; if (strwhere = ) s = ”select from RepairInfo; dt = sql.Execusql(s); return dt; public DataTable GetRepairInf

50、oByID(int id) DataTable dt = null; string s = select * from RepairInfo where RepairID= + id; dt = sql。Execusql(s); return dt; public int Update(model.RepairInfo mod) int n = 0,m=0; string s = ”update RepairInfo set DeviceID= + mod.DeviceID + ,RepairPeople= + mod.RepairPeople + ,BeginRepairDate= + mo

51、d.BeginRepairDate + ”,Repairprice= + mod。RepairPrice + ”,RepairOfTime= + mod.RepairOfTime + ”,FaultCause=” + mod。FaultCause + ,Remark=” + mod。Remark + ” where RepairID= + mod。RepairID + ”; n = sql。Execsql(s); if (mod。Remark = 正在维修”) s = ”Update Device set DeviceState=故障where DeviceID=” + mod.DeviceI

52、D; m = sql。Execsql(s); else s = ”Update Device set DeviceState=空闲 where DeviceID= + mod.DeviceID; m = sql。Execsql(s); if (m = 1 & n = 1) n = 1; else n = 0; return n; public int Delete(int id) int n = 0; string s = delete from RepairInfo where RepairID=” + id; n = sql。Execsql(s); return n; #endregion

53、 成员方法 TransInfo。cs using System;using System.Collections。Generic;using System.Linq;using System.Text;using System。Collections;using System.Data;using System。Data.SqlClient;namespace DAL public class TransInfo sqlhelp sql = new sqlhelp(); public TransInfo() region 成员方法 public int Insert(model.TransIn

54、fo mod) int n = 0,m=0; string s = Insert into TransInfo(DeviceID,DepartID,UsePeople,BeginTransDate,UseOfMonth,Remark) values(+mod.DeviceID+,+mod。DepartID+”,”+mod。UsePeople+,+mod.BeginTransDate+”,”+mod.UseOfMonth+”,”+mod.Remark+”); n = sql。Execsql(s); if(mod。Remark=”未归还) s = ”Update Device set Device

55、State=忙碌 where DeviceID=+mod.DeviceID; m = sql。Execsql(s); if (m = 1 n = 1) n = 1; else n = 0; return n; public DataTable GetList(string strwhere) DataTable dt = null; string s = ”select from View3 where + strwhere; if (strwhere = ”) s = ”select * from View3; dt = sql.Execusql(s); return dt; public

56、DataTable GetTransByID(int id) DataTable dt = null; string s = select from TransInfo where TransID= + id; dt = sql。Execusql(s); return dt; public int Update(model.TransInfo mod) int n = 0,m=0; string s = ”update TransInfo set DepartID=+mod.DepartID+”,UsePeople=”+mod.UsePeople+,BeginTransDate=”+mod.B

57、eginTransDate+,UseOfMonth=+mod。UseOfMonth+,Remark=”+mod.Remark+” where TransID=+mod。TransID; n = sql.Execsql(s); if (mod.Remark = 未归还) s = Update Device set DeviceState=忙碌 where DeviceID= + mod.DeviceID; else s = Update Device set DeviceState=空闲 where DeviceID=” + mod.DeviceID; m = sql.Execsql(s); i

58、f (m = 1 n = 1) n = 1; else n = 0; return n; public int Delete(int id) int n = 0; string s = delete from TransInfo where TransID=” + id; n = sql.Execsql(s); return n; #endregion 成员方法 UserLevel。cs using System;using System。Collections。Generic;using System.Linq;using System。Text;using System。Data;name

59、space DAL public class UserLevel sqlhelp sql = new sqlhelp(); public UserLevel() #region 成员方法 / summary / 得到用户权限列表 / /summary / returns/returns public DataTable getUsersLevelList() string sqlstr = ”select from UserLevel; DataTable dt = sql。Execusql(sqlstr); return dt; #endregion 成员方法 Users.cs using

60、System;using System。Collections.Generic;using System。Linq;using System.Text;using System。Data;namespace DAL public class Users sqlhelp sql = new sqlhelp(); public Users() #region 成员方法 / / 得到用户列表 / /summary / public DataTable getUsersList() string sqlstr = ”select * from Users; DataTable dt = sql.Exe

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论