资源简介
这是一个方便的记账小工具,其中包括:记账功能、考勤功能、行程提醒、账目查询、报表导出(Excel)、用户注册等。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Text.Regularexpressions;
namespace MQCount
{
public partial class AccountManagement : Form
{
OleDbConnection conn = new OleDbConnection(@“provider = Microsoft.Jet.OleDB.4.0; data source = MQCount.mdb“);
public AccountManagement()
{
InitializeComponent();
}
private void btnCountIn_Click(object sender EventArgs e)
{
Variable.CountInFlag = true;
this.Close();
}
private void btnRecordInfo_Click(object sender EventArgs e)
{
Variable.RecordInfoFlag = true;
this.Close();
}
private void btnExit_Click(object sender EventArgs e)
{
if (MessageBox.Show(“退出系统?“ “退出“ MessageBoxButtons.YesNo) == DialogResult.Yes)
{
string sql = “update 用户注册 set 是否在线 = ‘否‘ where 工号 = ‘“ + Variable.UserNumber + “‘“;
OleDbCommand cmd = new OleDbCommand(sql conn);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
System.Environment.Exit(0);
}
}
private void AccountManagement_Load(object sender EventArgs e)
{
Variable.LoginFlag = false;
if (Variable.UserStatus != “管理员“)
{
btnUserRegister.Enabled = false;
btnPriceList.Enabled = false;
}
try
{
string UserNowDate = Variable.UserLoginTime.Substring(0 11);
string UserLastDate = Variable.UserLastDate.Substring(0 11);
if (UserNowDate != UserLastDate)
{
Variable.UserLastDate = Variable.UserLoginTime;
Variable.UserAttendenceCount++;
}
}
catch { }
string sql1 = “update 用户注册 set 上机时间 = ‘“ + Variable.UserLoginTime + “‘ 出勤次数 = “ + Variable.UserAttendenceCount + “ 是否在线 = ‘是‘“ + “ where 工号 = ‘“ + Variable.UserNumber + “‘“;
OleDbCommand oc = new OleDbCommand(sql1 conn);
try
{
conn.Open();
Variable.x = oc.ExecuteNonQuery();
conn.Close();
}
catch { }
string sql = “select * from 行程表“;
OleDbCommand cmd = new OleDbCommand(sql conn);
conn.Open();
OleDbDataReader or = cmd.ExecuteReader();
if (or.Read())
{
try
{
MatchCollection mc1 = Regex.Matches(or[“计划1时间“].ToString() @“[0-9]+“);
string hour = mc1[mc1.Count - 2].ToStri
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 8985 2012-04-12 15:57 MQCount\AccountManagement.cs
文件 7595 2012-04-12 15:57 MQCount\AccountManagement.Designer.cs
文件 155831 2012-04-12 15:57 MQCount\AccountManagement.resx
文件 1133 2012-02-10 15:39 MQCount\AddListItem.cs
文件 2345 2012-04-26 01:14 MQCount\AllRecord.cs
文件 5525 2012-04-26 01:14 MQCount\AllRecord.Designer.cs
文件 155637 2012-04-26 01:14 MQCount\AllRecord.resx
文件 427 2012-01-14 22:11 MQCount\app.config
文件 9218 2008-07-26 11:09 MQCount\bin\Debug\Emerald.ssk
文件 23040 2012-02-26 22:06 MQCount\bin\Debug\Interop.ADOX.dll
文件 1420800 2012-05-05 17:11 MQCount\bin\Debug\MQCount.exe
文件 427 2012-01-14 22:11 MQCount\bin\Debug\MQCount.exe.config
文件 307200 2012-05-05 17:28 MQCount\bin\Debug\MQCount.mdb
文件 325120 2012-05-05 17:11 MQCount\bin\Debug\MQCount.pdb
文件 11600 2012-05-05 17:23 MQCount\bin\Debug\MQCount.vshost.exe
文件 427 2012-01-14 22:11 MQCount\bin\Debug\MQCount.vshost.exe.config
文件 490 2009-08-31 00:40 MQCount\bin\Debug\MQCount.vshost.exe.manifest
文件 204800 2012-05-05 17:28 MQCount\bin\Debug\三月份账目存档.mdb
文件 1588 2012-04-25 23:54 MQCount\ColumnSort.cs
文件 30769 2012-04-27 09:46 MQCount\CountIn.cs
文件 14786 2012-04-20 23:06 MQCount\CountIn.Designer.cs
文件 156213 2012-04-20 23:06 MQCount\CountIn.resx
文件 8474 2012-02-17 23:34 MQCount\ExcelImport.cs
文件 5116 2012-05-05 17:06 MQCount\Login.cs
文件 9107 2012-05-05 17:06 MQCount\Login.Designer.cs
文件 155637 2012-04-12 15:54 MQCount\Login.resx
文件 12263 2012-05-05 17:11 MQCount\MQCount.csproj
文件 478 2012-03-01 18:26 MQCount\MQCount.csproj.user
文件 138935 2012-01-14 22:11 MQCount\MQCountDataSet.Designer.cs
文件 3 2012-01-14 22:11 MQCount\MQCountDataSet.xsc
............此处省略88个文件信息
评论
共有 条评论