📄 brushkaidframe.cs
字号:
else if(h<10 && minute>=10 && second<10)
{
currentTimeStr="0"+h.ToString()+":"+minute.ToString()+":0"+second.ToString()+""+"PM";
}
#endregion
#region 如果时小于10,分大于10,秒大于10
else if(h<10 && minute>=10 && second>=10)//02;21;28
{
currentTimeStr="0"+h.ToString()+":"+minute.ToString()+":"+second.ToString()+""+"PM";
}
#endregion
#region 如果时大于10, 分小于10,秒小于10
else if(h>=10 && minute<10 && second<10)//如果时大于10,分小于10,秒小于10 例如:10;01;01
{
currentTimeStr=h.ToString()+":0"+minute.ToString()+":0"+second.ToString()+""+"PM";
}
#endregion
#region 如果时大于10,分小于10,秒大于10
else if(h>=10 && minute<10 && second>=10)//10;02;28
{
currentTimeStr=h.ToString()+":0"+minute.ToString()+":"+second.ToString()+""+"PM";
}
#endregion
#region 如果时大于10,分大于10,秒小于10
else if(h>=10 && minute>=10 && second<10)//如果时大于10,分大于10,秒小于10 10;10;05
{
currentTimeStr=h.ToString()+":"+minute.ToString()+":0"+second.ToString()+""+"PM";
}
#endregion
#region 如果时,分,秒都大于10..
else if(h>=10 && minute>=10 && second>=10)//如果时,分,秒都大于10 10;10;10
{
currentTimeStr=h.ToString()+":"+minute.ToString()+":"+second.ToString()+""+"PM";
}
#endregion
}
else if(hour<12)
{
w=hour;
#region 如果时,分,秒都小于10...
if(w<10 && minute<10 && second<10) //如果时,分,秒都小于10例如:02:01:01
{
currentTimeStr="0"+w.ToString()+":0"+minute.ToString()+":0"+second.ToString()+"AM";
}
#endregion
#region 如果时小于10,分小于10,秒大于10
else if(w<10 && minute<10 && second>=10)//05;02;28
{
currentTimeStr="0"+w.ToString()+":0"+minute.ToString()+":"+second.ToString()+"AM";
}
#endregion
#region 如果时小于10,分大于10,秒小于10 //01:21:01
else if(w<10 && minute>=10 && second<10)
{
currentTimeStr="0"+w.ToString()+":"+minute.ToString()+":0"+second.ToString()+"AM";
}
#endregion
#region 如果时小于10,分大于10,秒大于10
else if(w<10 && minute>=10 && second>=10)//02;21;28
{
currentTimeStr="0"+w.ToString()+":"+minute.ToString()+":"+second.ToString()+"AM";
}
#endregion
#region 如果时大于10, 分小于10,秒小于10
else if(w>=10 && minute<10 && second<10)//如果时大于10,分小于10,秒小于10 例如:10;01;01
{
currentTimeStr=w.ToString()+":0"+minute.ToString()+":0"+second.ToString()+"AM";
}
#endregion
#region 如果时大于10,分小于10,秒大于10
else if(w>=10 && minute<10 && second>=10)//10;02;28
{
currentTimeStr=w.ToString()+":0"+minute.ToString()+":"+second.ToString()+"AM";
}
#endregion
#region 如果时大于10,分大于10,秒小于10
else if(w>=10 && minute>=10 && second<10)//如果时大于10,分大于10,秒小于10 10;10;05
{
currentTimeStr=w.ToString()+":"+minute.ToString()+":0"+second.ToString()+"AM";
}
#endregion
#region 如果时,分,秒都大于10..
else if(w>=10 && minute>=10 && second>=10)//如果时,分,秒都大于10 10;10;10
{
currentTimeStr=w.ToString()+":"+minute.ToString()+":"+second.ToString()+"AM";
}
#endregion
}
else if(hour.Equals(12))
{
y=hour;
if(minute<10 && second<10)
{
currentTimeStr=y.ToString()+":0"+minute.ToString()+":0"+second.ToString()+"PM";
}
else if (minute<10 && second>=10)
{
currentTimeStr=y.ToString()+":0"+minute.ToString()+":"+second.ToString()+"PM";
}
else if(minute>=10 && second<10)
{
currentTimeStr=y.ToString()+":"+minute.ToString()+":0"+second.ToString()+"PM";
}
else if(minute>=10 && second>=10)
{
currentTimeStr=y.ToString()+":"+minute.ToString()+":"+second.ToString()+"PM";
}
}
else if(hour.Equals(24))
{
r=hour-24;
#region 如果时,分,秒都小于10...
if(r<10 && minute<10 && second<10) //如果时,分,秒都小于10例如:02:01:01
{
currentTimeStr="0"+r.ToString()+":0"+minute.ToString()+":0"+second.ToString()+""+"AM";
}
#endregion
#region 如果时小于10,分小于10,秒大于10
else if(r<10 && minute<10 && second>=10)//05;02;28
{
currentTimeStr="0"+r.ToString()+":0"+minute.ToString()+":"+second.ToString()+""+"AM";
}
#endregion
#region 如果时小于10,分大于10,秒小于10 //01:21:01
else if(r<10 && minute>=10 && second<10)
{
currentTimeStr="0"+r.ToString()+":"+minute.ToString()+":0"+second.ToString()+""+"AM";
}
#endregion
#region 如果时小于10,分大于10,秒大于10
else if(r<10 && minute>=10 && second>=10)//02;21;28
{
currentTimeStr="0"+r.ToString()+":"+minute.ToString()+":"+second.ToString()+""+"AM";
}
#endregion
#region 如果时大于10, 分小于10,秒小于10
else if(r>=10 && minute<10 && second<10)//如果时大于10,分小于10,秒小于10 例如:10;01;01
{
currentTimeStr=r.ToString()+":0"+minute.ToString()+":0"+second.ToString()+""+"AM";
}
#endregion
#region 如果时大于10,分小于10,秒大于10
else if(r>=10 && minute<10 && second>=10)//10;02;28
{
currentTimeStr=r.ToString()+":0"+minute.ToString()+":"+second.ToString()+""+"AM";
}
#endregion
#region 如果时大于10,分大于10,秒小于10
else if(r>=10 && minute>=10 && second<10)//如果时大于10,分大于10,秒小于10 10;10;05
{
currentTimeStr=r.ToString()+":"+minute.ToString()+":0"+second.ToString()+""+"AM";
}
#endregion
#region 如果时,分,秒都大于10..
else if(r>=10 && minute>=10 && second>=10)//如果时,分,秒都大于10 10;10;10
{
currentTimeStr=r.ToString()+":"+minute.ToString()+":"+second.ToString()+""+"AM";
}
#endregion
}
return currentTimeStr;
}
#endregion
#region 鼠标移动开始事件...
private void TitleLabel_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.blMove=true;
this.MouseX=e.X;
this.MouseY=e.Y;
}
#endregion
#region 鼠标移动正在进行中事件...
private void TitleLabel_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(this.blMove.Equals(true))
{
this.Top+=e.Y-this.MouseY;
this.Left+=e.X-this.MouseX;
}
}
#endregion
#region 鼠标移动结束事件...
private void TitleLabel_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.blMove=false;
}
#endregion
#region 退出系统...
private void menuExitSystem_Click(object sender, System.EventArgs e)
{
DialogResult result=MessageBox.Show(this,"是则退出系统,否则关闭当前窗体不退出系统,取消则没有关闭窗体啊!!!","提示信息",MessageBoxButtons.YesNoCancel,MessageBoxIcon.Information);
if(result.Equals(DialogResult.Yes))
{
Application.Exit();
}
else if(result.Equals(DialogResult.No))
{
//this.axMSComm1.PortOpen=false;
this.Dispose();
}
else
{
return;
}
}
#endregion
#region 清除按钮事件...
private void btnClear_Click(object sender, System.EventArgs e)
{
this.textBrushText.Text="";
this.btnClear.Enabled=false;
this.textBox.Text="";
}
#endregion
#region 处理非卡号的函数
private bool CheckBrushID(string temp)
{
bool f=false;
if(!(temp.StartsWith("39")))
{
MessageBox.Show(this,"此卡机不正确啊!!!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
f=true;
}
return f;
}
#endregion
#region BrushID()
private void BrushID()
{
string empidStr=brushEvent();
this.textBrushText.Text="";
string tempTimeStr=System.DateTime.Now.ToLongTimeString().Trim();
if(tempTimeStr.Length==7)
{
tempTimeStr="0"+System.DateTime.Now.ToLongTimeString().Trim();
}
int hour=Int32.Parse(tempTimeStr.ToString().Substring(0,2).Trim());
string insertSql="Insert into Emp_Time(职工名称,日期,时间) values('"+empidStr+"','"+System.DateTime.Now.ToLongDateString().Trim()+"','"+tempTimeStr+"')";
ConnectionData conn=new ConnectionData();
int u=conn.ExcuteStrSql(insertSql);
if(u>0)
{
}
else
{
MessageBox.Show(this,"刷卡失败!!!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}
#endregion
#region 非空函数
private bool CheckNull()
{
if(this.brushEvent().Equals(""))
{
this.tListBox.Items.Add(BrushIDStr);
brushUnCount++;
this.UnZhuCheLabel.Text="未注册:"+brushUnCount.ToString().Trim()+"个";
this.textBrushText.Text="";
return true;
}
return false;
}
#endregion
#region brushEvent()
private String brushEvent()
{
string sql="select 职工名称,ID号 from Employee",tempStr="";
try
{
DataSet dsSet=new DataSet();
DataTable dsTable=new DataTable();
ConnectionData conn=new ConnectionData();
dsSet=conn.ExcuteDataSetResult(sql,"Employee");
dsTable=dsSet.Tables[0];
int y=this.listBox.Items.Count;
for(int i=0;i<dsTable.Rows.Count;i++)
{
for(int j=brushCount;j<y;j++)
{
if(dsTable.Rows[i][1].ToString().Trim().Equals(this.listBox.Items[j].ToString().Trim()))
{
tempStr=dsTable.Rows[i][0].ToString();
strID=dsTable.Rows[i][0].ToString();
this.NameText.Text="姓名:"+dsTable.Rows[i][0].ToString().Trim();
string textname=dsTable.Rows[i][0].ToString().Trim();
this.textName.Text=dealStr(textname);
strZhuChe=this.listBox.Items[j].ToString().Trim();
}
else if(!(dsTable.Rows[i][1].ToString().Trim().Equals(this.listBox.Items[j].ToString().Trim())))
{
BrushIDStr=this.listBox.Items[j].ToString().Trim();
}
}
}
}
catch(Exception ele)
{
MessageBox.Show(this,ele.ToString(),"提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
return tempStr;
}
#endregion
#region 注册卡号....
private void getKaHao()
{
this.tZhuCheListBox.Items.Add(strZhuChe);
brushZhuChe++;
}
#endregion
#region brushIDText()
private void brushIDText()
{
try
{
if(this.CheckNull())
{
return;
}
BrushID();
getKaHao();
}
catch(Exception elses)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -