版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
1、各類專業(yè)好文檔,值得你下載,教育,管理,論文,制度,方案手冊,應(yīng)有盡有各類專業(yè)好文檔,值得你下載,教育,管理,論文,制度,方案手冊,應(yīng)有盡有源代碼及運行界面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; / / 得到設(shè)備類別列表 / 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 / 得到一條設(shè)備類別記錄 / /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 / 修改設(shè)備類別記錄 / /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; / / 刪除一條設(shè)備類別記錄 / /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 / 增加一個設(shè)備類別記錄 / /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 / 得到設(shè)備類型列表 / 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 / 修改設(shè)備類型記錄 / / /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 / 插入一條設(shè)備類型記錄 / /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 / 刪除一條設(shè)備類型記錄 / / 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,F(xiàn)aultCause,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 / 得到用戶權(quán)限列表 / /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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 前臺試用期工作總結(jié)
- 2024年商超貨架項目發(fā)展計劃
- 2024年無汞可充電堿錳電池合作協(xié)議書
- 2024年粘結(jié)稀土永磁材料項目發(fā)展計劃
- 2024-2025學(xué)年九年級物理上學(xué)期第一次月考模擬卷(蘇科版)
- 2024年SPI環(huán)氧乙烷銀催化劑項目發(fā)展計劃
- 中班數(shù)學(xué)教案《禮物排排隊》
- 中班數(shù)學(xué)公開課教案《數(shù)字卡片找朋友》
- 2023年上半年自考試00184市場營銷策劃部分原題含解析
- 2023年4月自考工商管理專業(yè)本科市場營銷策劃試題含解析
- 2024年交通學(xué)院招考聘用8人高頻考題難、易錯點模擬試題(共500題)附帶答案詳解
- 2024年美國移動USB Type-C快速充電器市場現(xiàn)狀及上下游分析報告
- 楊小微-終身視野下教學(xué)過程的“育德”與“養(yǎng)性”
- 人教新課標(biāo)二年級數(shù)學(xué)上冊2.2.2《退位減 》說課稿3
- 無結(jié)核校園主題健康教育
- 二級公立醫(yī)院績效考核三級手術(shù)目錄(2020版)
- 設(shè)備采購 投標(biāo)方案(技術(shù)方案)
- 新蘇教版六年級上冊《科學(xué)》全一冊全部課件(含19課時)
- 芯片測試的幾個術(shù)語及解釋
- 河北省各地醫(yī)院大全
- not-until-課件.ppt
評論
0/150
提交評論