//SKByHand Section private void OKBtn_Click(object sender, EventArgs e) { ErrorLb.Text = ""; if (CreditNoTB.Text != "") { int SKMinutes = Convert.ToInt32(SKMinuteTB.Text.Trim()); DateTime[] SKDTArray = new DateTime[SKMinutes <= 0 ? 1 : 2]; if (SKMinutes <= 0) SKDTArray[0] = SKDTPicker.Value.AddMinutes(SKMinutes); else { SKDTArray[0] = SKDTPicker.Value; SKDTArray[1] = SKDTPicker.Value.AddMinutes(SKMinutes); } string SKMsg = ""; for (int i = 0; i < SKDTArray.Length; i++) { SKMsg += string.Format("卡号:{0} 姓名:{1} 刷卡日期:{2} 刷卡时间:{3}\n", KHTB.Text, LawyerNameLb.Text, SKDTArray[i].ToString("yyyy-MM-dd"), SKDTArray[i].ToString("HH-mm-ss")); } string Caption = "输入刷卡记录确认"; MessageBoxButtons Buttons = MessageBoxButtons.YesNo; if (MessageBox.Show(this, SKMsg, Caption, Buttons) == DialogResult.Yes) { Access SKDB = new Access(); for (int i = 0; i < SKDTArray.Length; i++) { string sql = string.Format("insert into yskq(bh,rq,sj,SKMode) values({0},'{1}','{2}','手动')", hzbh.Text, SKDTArray[i].ToString("yyyy-MM-dd"), SKDTArray[i].ToString("HH-mm-ss")); // System.Windows.Forms.MessageBox.Show(sql); SKDB.ExecuteSQL(sql); } } } else ErrorLb.Text = "请先查找律师的执业证号或卡号..."; }
private void btDelSKRecs_Click(object sender, System.EventArgs e) { if (cBSKLessons.Text != "") { Access DB = new Access(); OleDbDataReader DR = DB.ExecuteQuery(string.Format("select * from SKRecs where LessonName='{0}' and IsToRemote=false", cBSKLessons.Text)); bool CanDel = !DR.HasRows; DR.Close(); if (CanDel) { DB.ExecuteSQL(string.Format("delete from SKRecs where LessonName='{0}'", cBSKLessons.Text)); Thread.Sleep(1000); InitSKGL(); } else MessageBox.Show(string.Format("课程:【{0}】有未上传的考勤记录,请先上传有关记录......", cBSKLessons.Text)); } }