資源簡介
界面清新美觀,有背景音樂。
可動態設置獎項,
導入人員,導出結果至Excel。
可設置過濾條件,比如一年以下員工,不可抽大獎。
你所想到的,基本上都有。如果是非程序員下載此軟件使用,只要使用可執行文件,通過界面修改配置數據即可使用.
此軟件耗費了一定的精力,要分不高,希望能給大家帶來幫助.
代碼片段和文件信息
using?System;
using?System.Data;
using?System.Configuration;
using?System.Data.OleDb;
using?System.Text;
using?System.Windows.Forms;
///?
///?DataAccess?為數據庫操作等全局定義的一些類
///?
public?class?DataAccess
{
????public?DataAccess()
????{
????}
????public?static?bool?DataIsChange;
????#region?配置數據庫連接字符串
????///?
????///?獲取C/S系統根目錄
????///?
????public?static?string?SysRootPath()
????{
????????string?resultPath?=?string.Empty;
????????string?sysPath?=?Application.StartupPath;
????????if?(sysPath.LastIndexOf(“bin“)?>?0)
????????{
????????????resultPath?=?sysPath.Substring(0?sysPath.LastIndexOf(“bin“));
????????}
????????else
????????{
????????????resultPath?=?sysPath;
????????}
????????return?resultPath;
????}
????///?
????///?配置數據庫連接字符串
????///?
????private?static?string?ConnectionString?=?“Provider=Microsoft.Jet.OLEDB.4.0;Data?Source=“?+?System.Environment.CurrentDirectory?+?“\\data\\LD.mdb;Persist?Security?Info=False;Jet?OLEDB:Database?Password=shiyanexperiment;“;
????#endregion
????#region??執行SQL語句,返回Bool值
????///?
????///?執行SQL語句,返回Bool值
????///?
????///?要執行的SQL語句
????///?返回BOOL值,True為執行成功
????public?bool?ExecuteSQL(string?sql)
????{
????????OleDbConnection?con?=?new?OleDbConnection(ConnectionString);
????????OleDbCommand?cmd?=?new?OleDbCommand(sql?con);
????????try
????????{
????????????con.Open();
????????????cmd.ExecuteNonQuery();
????????????return?true;
????????}
????????catch
????????{
????????????return?false;
????????}
????????finally
????????{
????????????con.Close();
????????????con.Dispose();
????????????cmd.Dispose();
????????}
????}
????#endregion
????#region?讀取帶參數的結果集
????///?
????///?讀取帶參數的結果集
????///?
????///?SQL語句
????///?參數列表
????///?結果集
????public?OleDbDataReader?ExecuteReader(string?sql)
????{
????????OleDbDataReader?reader?=?null;
????????OleDbConnection?con?=?new?OleDbConnection(ConnectionString);
????????OleDbCommand?cmd?=?new?OleDbCommand(sql?con);
????????try
????????{
????????????con.Open();
????????????reader?=?cmd.ExecuteReader(CommandBehavior.CloseConnection);
????????}
????????catch
????????{
????????}
????????
????????return?reader;
????}
????#endregion
????#region??執行SQL語句,返回DataTable
????///?
????///?執行SQL語句,返回DataTable
????///?
????///?要執行的SQL語句
????///?返回DataTable類型的執行結果
????public?DataTable?GetDataTable(string?sql)
????{
????????DataSet?ds?=?new?DataSet();
????????OleDbConnection?con?=?new?OleDbConnection(ConnectionString);
????????OleDbDataAdapter?da?=?new?OleDbDataAdapter(sql?con);
????????try
????????{
????????????da.Fill(ds?“tb“);
????????}
????????catch?(Exception?ex)
????????{
????????????throw?new?Ex
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????530028??2014-01-01?15:14??Lucky?Draw\Lucky?Draw\bin\data\choujiang.wav
?????文件????1764112??2014-01-01?21:14??Lucky?Draw\Lucky?Draw\bin\data\gongxi.wav
?????文件????1764112??2014-01-01?21:14??Lucky?Draw\Lucky?Draw\bin\data\join.wav
?????文件????1249280??2014-01-11?08:44??Lucky?Draw\Lucky?Draw\bin\data\LD.mdb
?????文件???28887664??2013-12-31?17:33??Lucky?Draw\Lucky?Draw\bin\data\喜洋洋.wav
?????文件??????25214??2009-11-01?03:49??Lucky?Draw\Lucky?Draw\bin\Debug\app.publish\Application?Files\抽獎系統_1_0_0_4\logo.ico.deploy
?????文件?????808448??2012-10-25?08:14??Lucky?Draw\Lucky?Draw\bin\Debug\app.publish\Application?Files\抽獎系統_1_0_0_4\抽獎系統.exe.deploy
?????文件???????7134??2012-10-25?08:14??Lucky?Draw\Lucky?Draw\bin\Debug\app.publish\Application?Files\抽獎系統_1_0_0_4\抽獎系統.exe.manifest
?????文件??????25214??2009-11-01?03:49??Lucky?Draw\Lucky?Draw\bin\Debug\app.publish\Application?Files\神仙抽獎系統_1_0_0_1\logo.ico.deploy
?????文件?????806912??2012-10-23?16:31??Lucky?Draw\Lucky?Draw\bin\Debug\app.publish\Application?Files\神仙抽獎系統_1_0_0_1\神仙抽獎系統.exe.deploy
?????文件???????7170??2012-10-23?16:31??Lucky?Draw\Lucky?Draw\bin\Debug\app.publish\Application?Files\神仙抽獎系統_1_0_0_1\神仙抽獎系統.exe.manifest
?????文件?????475576??2012-10-25?08:14??Lucky?Draw\Lucky?Draw\bin\Debug\app.publish\setup.exe
?????文件???????5320??2012-10-25?08:14??Lucky?Draw\Lucky?Draw\bin\Debug\app.publish\抽獎系統.application
?????文件???????5356??2012-10-23?16:31??Lucky?Draw\Lucky?Draw\bin\Debug\app.publish\神仙抽獎系統.application
?????文件??????25588??2012-10-24?16:00??Lucky?Draw\Lucky?Draw\bin\Debug\pm3.wav
?????文件???????1587??2012-10-25?08:14??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎系統.application
?????文件?????808448??2012-10-25?08:14??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎系統.exe
?????文件???????3476??2012-10-25?08:14??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎系統.exe.manifest
?????文件??????75264??2012-10-25?08:14??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎系統.pdb
?????文件???????9216??2012-10-23?15:02??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎結果20121023030202.xls
?????文件???????9216??2012-10-23?15:08??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎結果20121023030853.xls
?????文件??????13824??2012-10-23?15:26??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎結果20121023032612.xls
?????文件??????13824??2012-10-23?15:28??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎結果20121023032801.xls
?????文件??????13824??2012-10-23?15:28??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎結果20121023032808.xls
?????文件???????9216??2012-10-23?16:24??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎結果20121023042456.xls
?????文件???????9728??2012-10-23?16:25??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎結果20121023042534.xls
?????文件???????9728??2012-10-23?16:26??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎結果20121023042650.xls
?????文件??????10752??2012-10-23?16:28??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎結果20121023042831.xls
?????文件???????9728??2012-10-24?16:38??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎結果20121024043849.xls
?????文件???????9216??2012-10-24?08:23??Lucky?Draw\Lucky?Draw\bin\Debug\抽獎結果20121024082330.xls
............此處省略105個文件信息
評論
共有 條評論