protected void btnCommit_Click(object sender, EventArgs e) { FpLocalType localtype = new FpLocalType(); localtype.ID = StringHelper.fnFormatNullOrBlankInt(this.lbId.Text, -1); localtype.NAME = txtLocalTypeName.Text; localtype.DESCP = txtLocalTypeDescp.Text; localtype.TRAIN_TIMES = StringHelper.fnFormatNullOrBlankInt(txtTrainTimes.Text, 8); localtype.KM3_VERIFY_IND = cbKm3VerifyInd.Checked ? "Y" : "N"; localtype.KM1_IND = cbKm1Ind.Checked ? "Y" : "N"; localtype.KM2_3IN9_IND = cbKm2_3in9Ind.Checked ? "Y" : "N"; localtype.KM2_IND = cbKm2Ind.Checked ? "Y" : "N"; localtype.KM3_IND = cbKm3Ind.Checked ? "Y" : "N"; localtype.LESSON_IND = cbLessonInd.Checked ? "Y" : "N"; if (SimpleOrmOperator.Update(localtype)) { WebTools.Alert("修改成功!"); } else if (SimpleOrmOperator.Create(localtype)) { WebTools.Alert("添加成功!"); } else { WebTools.Alert("保存失败!"); } FPSystemBiz.DictFpLocalTypes.Clear(); }
private void fnUILoadStudentRecord(FpStudentObject fso, TempStudentInfo tso) { if (fso == null) { this.lbAlertMsg.Visible = true; this.lbAlertMsg.Text = "没有该学员的指纹记录信息"; } else if (tso == null) { this.lbAlertMsg.Visible = true; this.lbAlertMsg.Text = "没有该学员的个人信息"; } else { //fso.fromTempStudentInfo(tso); try { this.lbName.Text = fso.NAME; // this.lbSex.Text = fso.SEX;/; this.lbIdCard.Text = fso.IDCARD; // this.imgPerson.ImageUrl = string.Format("~/ShowImage.aspx?idcardtype=A&idcard={0}", fso.IDCARD); // this.lbIDCardType.Text = "第二代身份证"; // this.lbBrithday.Text = DateTimeHelper.fnIsNewDateTime(fso.BRITHDAY) ? "" : fso.BRITHDAY.ToString(); // this.lbPhone.Text = fso.PHONE; // this.lbAddress.Text = fso.ADDRESS; // this.lbDrvSchool.Text = fso.DRV_SCHOOL; // this.lbDocNum.Text = fso.DRV_DOCNUM; // this.lbDrvType.Text = fso.DRV_TYPE; this.lbRemark.Text = fso.REMARK; this.lbAlertMsg.Text = ""; this.lbLsh.Text = fso.LSH; this.lbSchoolName.Text = fso.SCHOOL_NAME; this.lbStaute.Text = FpStudentObject.GetDictStatue()[fso.STATUE]; this.lbFeeStatue.Text = fso.FEE_STATUE == "Y" ? "是" : "否"; this.lbKm3Verify.Text = fso.KM3_VERIFY == "Y" ? "是" : "否"; this.lbCarType.Text = fso.CAR_TYPE; FpLocalType localType = SimpleOrmOperator.Query <FpLocalType>(fso.LOCALTYPE); this.lbLocalType.Text = localType == null ? "" : localType.NAME; } catch (NullReferenceException nre) { } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int id = StringHelper.fnFormatNullOrBlankInt(Request.Params["id"], -1); FpLocalType localtype = SimpleOrmOperator.Query <FpLocalType>(id); if (localtype == null) { return; } this.lbId.Text = id.ToString(); this.txtLocalTypeName.Text = localtype.NAME; this.txtLocalTypeDescp.Text = localtype.DESCP; this.txtTrainTimes.Text = localtype.TRAIN_TIMES == null ? "0" : localtype.TRAIN_TIMES.ToString(); this.cbKm3VerifyInd.Checked = (localtype.KM3_VERIFY_IND == "Y"); this.cbKm1Ind.Checked = localtype.KM1_IND == "Y"; this.cbKm2_3in9Ind.Checked = localtype.KM2_3IN9_IND == "Y"; this.cbKm2Ind.Checked = localtype.KM2_IND == "Y"; this.cbKm3Ind.Checked = localtype.KM3_IND == "Y"; this.cbLessonInd.Checked = localtype.LESSON_IND == "Y"; } }
public bool checkin(FpSite fpSite,FpLocalType fpLocalType, DateTime lDtIdentity,out int errorCode) { errorCode = 0; //int gIntLessonInterval = StringHelper.fnFormatNullOrBlankInt(SystemWholeXmlConfigManager.GetConfig("FP_LESSON_INTERVAL"), 45); //int gIntTrainInterval = StringHelper.fnFormatNullOrBlankInt(SystemWholeXmlConfigManager.GetConfig("FP_TRAIN_INTERVAL"), 45); if (string.IsNullOrEmpty(this.lsh)) { this.remark=string.Format("{2}学员 {0}({1}) 受理号未录入",this.name,this.idcard,schoolName); errorCode = -1; return false; } else if (this.isBl()) { this.feeStatue="Y"; } else if (this.feeStatue != "Y") { this.remark = string.Format("{2}学员 {0}({1}) 收费审核未通过", this.name, this.idcard, this.schoolName); errorCode = -2; return false; } FPConfig config = FPSystemBiz.GetCurrConfig(); int gIntLessonInterval = config.FP_LESSON_INTERVAL; int gIntTrainInterval = config.FP_TRAIN_INTERVAL; bool isCheckin = false; // DateTime lDtIdentity=DateTime.Now; DateTime lDtNull=new DateTime(0); string lStrIdentity= lDtIdentity.ToShortTimeString(); string msgPrefix = string.Format("{0} {1}学员 {2} ",lStrIdentity,this.schoolName,this.name); switch (fpSite.BUSTYPE) { case "lesson": { if (this.statue < STATUE_COLLECT) { this.remark = string.Format(msgPrefix+" 未进行指纹采集", lStrIdentity,this.name,this.schoolName); break; } //else if (fpLocalType.LESSON_IND != "Y") { // this.remark = string.Format("学员 类型:{0},无需进行上课",fpLocalType.NAME,this.name); //} //else if (this.feeStatue != "Y") // { // this.remark = string.Format("{0} 学员交费审核未通过,不能进行上课", lStrIdentity); // break; // } else if (this.statue >= STATUE_LESSON_END) { this.remark = string.Format(msgPrefix + " 已完成上课学时", lStrIdentity, this.name, this.schoolName); break; } DateTime dtLesson2Leavel = new DateTime(DateTime.Now.Year,DateTime.Now.Month,DateTime.Now.Day,config.FP_LESSON_ENTER_2_HH,config.FP_LESSON_ENTER_2_MM,0).AddMinutes(config.FP_LESSON_INTERVAL); if (DateTimeHelper.fnIsNewDateTime(this.LESSON_ENTER_1)) { if (!DateTimeHelper.fnIsBeforeTime(lDtIdentity, config.FP_LESSON_ENTER_1_HH, config.FP_LESSON_ENTER_1_MM) && fnIsVaildTime(lDtIdentity, dtLesson2Leavel)) { this.remark = string.Format(msgPrefix + " 早场第一节上课超过限制时间 {1}:{2},考勤无效", lStrIdentity, config.FP_LESSON_ENTER_1_HH, config.FP_LESSON_ENTER_1_MM,this.name,this.schoolName); break; } else if (!DateTimeHelper.fnIsBeforeTime(lDtIdentity, config.FP_LESSON_ENTER_3_HH, config.FP_LESSON_ENTER_3_MM)) { this.remark = string.Format(msgPrefix + " 晚场第一节上课超过限制时间 {1}:{2},考勤无效", lStrIdentity, config.FP_LESSON_ENTER_3_HH, config.FP_LESSON_ENTER_3_MM,this.name,this.schoolName); break; } //else if (!DateTimeHelper.fnIsBeforeTime(lDtIdentity, config.FP_LESSON_ENTER_1_HH, config.FP_LESSON_ENTER_1_MM)) //{ // this.remark = string.Format("{0} 上午上课超过限制时间 {1}:{2},考勤无效", // lStrIdentity, config.FP_LESSON_ENTER_1_HH, config.FP_LESSON_ENTER_1_MM); // break; //} this.LESSON_ENTER_1 = lDtIdentity; this.statue = STATUE_LESSON_START; this.remark = string.Format(msgPrefix + " 开始进行第一节上课", lStrIdentity, this.name, this.schoolName); isCheckin = true; } else if (!fnIsVaildTime(this.LESSON_ENTER_1, lDtIdentity, 0)) { //lStrUpdateSqlClearRecord = string.Format(lStrUpdateSqlClearRecord, lStrParm2); //FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql(lStrUpdateSqlClearRecord); //lIntReturn = LESSON_ENTER_1_FAILE; this.LESSON_ENTER_1= lDtNull; this.LESSON_ENTER_2 = lDtNull; this.LESSON_LEAVE_2 = lDtNull; this.LESSON_LEAVE_1 = lDtNull; this.remark = string.Format(msgPrefix + " 本次上课与上次不在同一天进行,旧上课记录已被清空,请再次确认上课", lStrIdentity, this.name, this.schoolName); this.statue = STATUE_COLLECT; } else if (DateTimeHelper.fnIsNewDateTime(this.LESSON_LEAVE_1)) { if (fnIsVaildTime(this.LESSON_ENTER_1, lDtIdentity, gIntLessonInterval)) { this.LESSON_LEAVE_1 = lDtIdentity; this.remark = string.Format(msgPrefix + " 第一节上课离场成功,请今天再来第二节上课入场确认", lStrIdentity, this.name); isCheckin = true; } else { // lIntReturn = LESSON_ENTER_2_FAILE; this.remark = string.Format(msgPrefix + " 第一节上课时间未达到{1}分钟,提早离场将被视为无效", lStrIdentity, gIntLessonInterval, this.name); } } else if (DateTimeHelper.fnIsNewDateTime(this.LESSON_ENTER_2)) { //if (fnIsVaildTime(this.LESSON_LEAVE_1, lDtIdentity, gIntLessonInterval)) if (!DateTimeHelper.fnIsBeforeTime(lDtIdentity,config.FP_LESSON_ENTER_2_HH,config.FP_LESSON_ENTER_2_MM) && fnIsVaildTime(lDtIdentity, dtLesson2Leavel) ) { // lIntReturn = LESSON_ENTER_2_FAILE; //this.remark = string.Format("{0} 上午上课时间未达到{1}分钟,不能进行下午上课", lStrIdentity,gIntLessonInterval); this.remark = string.Format(msgPrefix + " 早场第二节上课超过限制时间 {1}:{2},考勤无效", lStrIdentity,config.FP_LESSON_ENTER_2_HH,config.FP_LESSON_ENTER_2_MM,this.name); break; } else if (!DateTimeHelper.fnIsBeforeTime(lDtIdentity, config.FP_LESSON_ENTER_4_HH, config.FP_LESSON_ENTER_4_MM)) { // lIntReturn = LESSON_ENTER_2_FAILE; //this.remark = string.Format("{0} 上午上课时间未达到{1}分钟,不能进行下午上课", lStrIdentity,gIntLessonInterval); this.remark = string.Format(msgPrefix + " 晚场第二节上课超过限制时间 {1}:{2},考勤无效", lStrIdentity, config.FP_LESSON_ENTER_4_HH, config.FP_LESSON_ENTER_4_MM,this.name); break; } this.LESSON_ENTER_2 = lDtIdentity; this.remark = string.Format(msgPrefix + " 开始进行第二节上课", lStrIdentity, this.name); isCheckin = true; } else if (DateTimeHelper.fnIsNewDateTime(this.LESSON_LEAVE_2)) { if (fnIsVaildTime(this.LESSON_ENTER_2, lDtIdentity, gIntLessonInterval)) { // lStrParm0 = lStrPrfLESSON_LEAVE + "_2"; this.LESSON_LEAVE_2 = lDtIdentity; //this.statue = STATUE_LESSON_END; this.statue = fpLocalType.nextStatus(STATUE_LESSON_END); this.remark = string.Format(msgPrefix + " 完成上课学时要求", lStrIdentity, this.name); isCheckin = true; } else { this.remark = string.Format(msgPrefix + " 第二节上课时间未达到{1}分钟,提早离场将被视为无效", lStrIdentity, gIntLessonInterval, this.name); } } break; }//case "lesson" case "km1": { if (fpLocalType.KM1_IND != "Y") { this.remark = string.Format(msgPrefix + " 类型:{0},无需进行科目1考试", fpLocalType.NAME, this.name); break; } else if (fpLocalType.LESSON_IND=="Y" &&this.statue < STATUE_LESSON_END) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未完成上课,不能进行科目1考试", lStrIdentity, this.name); break; } } else if (!DateTimeHelper.fnIsNewDateTime(this.KM1_ENTER)) { this.remark = string.Format(msgPrefix + " 在{1}已进行科目1考试,不能重复考试", lStrIdentity, this.KM1_ENTER.ToString("yyyy-MM-dd HH:mm:ss"), this.name); break; } this.km1_enter = lDtIdentity; //this.statue = STATUE_KM1_ENTER; this.statue = fpLocalType.nextStatus(STATUE_KM1_ENTER); this.remark = string.Format(msgPrefix + " 科目1考试验证成功", lStrIdentity, this.name); isCheckin = true; break; } //case km1 case "km2": { if (fpLocalType.KM2_IND != "Y") { this.remark = string.Format(msgPrefix + " 类型:{0},无需进行科目2桩考", fpLocalType.NAME, this.name); break; } else if (fpLocalType.KM1_IND=="Y"&& this.statue < STATUE_KM1_ENTER) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未进行科目1考试,不能进行科目2考试", lStrIdentity, this.name); break; } } else if (!DateTimeHelper.fnIsNewDateTime(this.KM2_ENTER)) { this.remark = string.Format(msgPrefix + " 在{1}已进行科目2考试,不能重复考试", lStrIdentity, this.KM2_ENTER.ToString("yyyy-MM-dd HH:mm:ss"), this.name); break; } this.km2_enter = lDtIdentity; if (this.statue < STATUE_TRAIN_END) { //this.statue = STATUE_KM2_ENTER; this.statue = fpLocalType.nextStatus(STATUE_KM2_ENTER); } this.remark = string.Format(msgPrefix + " 科目2考试验证成功", lStrIdentity, this.name); isCheckin = true; break; } //case km2 case "train": { if (fpLocalType.TRAIN_TIMES <1) { this.remark = string.Format(msgPrefix + " 类型:{0},无需进行入场训练", fpLocalType.NAME, this.name); break; } else if (fpLocalType.KM1_IND=="Y"&& this.statue < STATUE_KM1_ENTER) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未进行科目1考试,不能进行入场训练", lStrIdentity, this.name); break; } } else if (this.statue >= STATUE_TRAIN_END) { this.remark = string.Format(msgPrefix + " 已完成入场训练", lStrIdentity, this.name); break; } int trainTimes = 0; string re = string.Empty; string patternTrainEnter = msgPrefix + " 开始进行第{1}次入场训练"; string patternTrainEnterNotToday = msgPrefix + " 第{1}次的训练未完成,第{1}次的记录将被清空,请再次验证"; string patternTrainLeave = msgPrefix + " 已完成今天的入场训练"; string patternTrainLeaveFaile = msgPrefix + " 今天的入场训练时间未达到{1}分钟,离场将被作为训练无效处理"; string patternTrainEnterIsToday = msgPrefix + " 今天的入场训练已完成,同一天不能入场两次"; string patternTrainFinish = msgPrefix + " 已进行{1}次入场训练,入场训练完成"; string patternTrainLeveeFaile2 = msgPrefix + " 未达到离场最早限制时间 {1}:{2},现在离场将被视为考勤无效"; //1 if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_1) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_1)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_1)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_1 = lDtIdentity; this.statue = STATUE_TRAIN_START; this.remark = string.Format(patternTrainEnter, lStrIdentity,1); isCheckin = true; } else if (!fnIsVaildTime(this.TRAIN_ENTER_1, lDtIdentity)) { this.train_enter_1 = lDtNull; this.train_leave_1 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 1); } else if (fnIsVaildTime(this.TRAIN_ENTER_1, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity,this.TRAIN_ENTER_1); if (re != string.Empty) { this.remark = re; break; } this.train_leave_1 = lDtIdentity; this.remark = string.Format(patternTrainLeave, lStrIdentity); isCheckin = true; trainTimes = 1; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_1, lDtIdentity)) { //lIntReturn = CHECK_SAMEDAY_FAILE; this.remark = string.Format(patternTrainEnterIsToday,lDtIdentity); } //2 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_2) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_2)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_2)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_2 = lDtIdentity; this.remark = string.Format(patternTrainEnter, lStrIdentity, 2); isCheckin = true; } else if (!fnIsVaildTime(this.TRAIN_ENTER_2, lDtIdentity)) { this.train_enter_2 = lDtNull; this.train_leave_2 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 2); } else if (fnIsVaildTime(this.TRAIN_ENTER_2, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_2); if (re != string.Empty) { this.remark = re; break; } this.train_leave_2 = lDtIdentity; this.remark = string.Format(patternTrainLeave, lStrIdentity); isCheckin = true; trainTimes = 2; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_2, lDtIdentity)) { this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //3 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_3) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_3)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_3)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_3 = lDtIdentity; this.remark = string.Format(patternTrainEnter, lStrIdentity,3); isCheckin = true; } else if (!fnIsVaildTime(this.TRAIN_ENTER_3, lDtIdentity)) { this.train_enter_3 = lDtNull; this.train_leave_3 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 3); } else if (fnIsVaildTime(this.TRAIN_ENTER_3, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_3); if (re != string.Empty) { this.remark = re; break; } this.train_leave_3 = lDtIdentity; this.remark = string.Format(patternTrainLeave, lStrIdentity); isCheckin = true; trainTimes = 3; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_3, lDtIdentity)) { this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //4 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_4) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_4)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_4)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_4 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainEnter, lStrIdentity, 4); } else if (!fnIsVaildTime(this.TRAIN_ENTER_4, lDtIdentity)) { this.train_enter_4 = lDtNull; this.train_leave_4 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 4); } else if (fnIsVaildTime(this.TRAIN_ENTER_4, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_4); if (re != string.Empty) { this.remark = re; break; } this.train_leave_4 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainLeave, lStrIdentity); trainTimes = 4; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_4, lDtIdentity)) { this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //5 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_5) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_5)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_5)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_5 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainEnter, lStrIdentity, 5); } else if (!fnIsVaildTime(this.TRAIN_ENTER_5, lDtIdentity)) { this.train_enter_5 = lDtNull; this.train_leave_5 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 5); } else if (fnIsVaildTime(this.TRAIN_ENTER_5, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_5); if (re != string.Empty) { this.remark = re; break; } this.train_leave_5 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainLeave, lStrIdentity); trainTimes = 5; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_5, lDtIdentity)) { //lStrClearParm0 = "5"; this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //6 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_6) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_6)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_6)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_6 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainEnter, lStrIdentity, 6); } else if (!fnIsVaildTime(this.TRAIN_ENTER_6, lDtIdentity)) { this.train_enter_6 = lDtNull; this.train_leave_6 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 6); } else if (fnIsVaildTime(this.TRAIN_ENTER_6, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_6); if (re != string.Empty) { this.remark = re; break; } this.train_leave_6 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainLeave, lStrIdentity); trainTimes = 6; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_6, lDtIdentity)) { //lStrClearParm0 = "6"; this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //7 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_7) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_7)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_7)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_7 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainEnter, lStrIdentity, 7); } else if (!fnIsVaildTime(this.TRAIN_ENTER_7, lDtIdentity)) { this.train_enter_7 = lDtNull; this.train_leave_7 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 7); } else if (fnIsVaildTime(this.TRAIN_ENTER_7, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_7); if (re != string.Empty) { this.remark = re; break; } this.train_leave_7 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainLeave, lStrIdentity); trainTimes = 7; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_7, lDtIdentity)) { //lStrClearParm0 = "7"; this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //8 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_8) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_8)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_8)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_8 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainEnter, lStrIdentity, 8); } else if (!fnIsVaildTime(this.TRAIN_ENTER_8, lDtIdentity)) { this.train_enter_8 = lDtNull; this.train_leave_8 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 8); } else if (fnIsVaildTime(this.TRAIN_ENTER_8, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_8); if (re != string.Empty) { this.remark = re; break; } this.train_leave_8 = lDtIdentity; isCheckin = true; this.statue = STATUE_TRAIN_END; this.remark = string.Format(patternTrainFinish, lStrIdentity,8); trainTimes = 8; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_8, lDtIdentity)) { // lStrClearParm0 = "8"; this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //入场训练学员分类 if (trainTimes >= fpLocalType.TRAIN_TIMES) { //this.statue = STATUE_TRAIN_END; this.statue = fpLocalType.nextStatus(STATUE_TRAIN_END); this.TRAIN_END_DATE = DateTime.Now; this.remark = string.Format(patternTrainLeave, lStrIdentity,trainTimes); } break; }//case "train" case "3in9": { if (fpLocalType.KM2_3IN9_IND != "Y") { this.remark = string.Format(msgPrefix + " 类型:{0},无需进行9选3考试", fpLocalType.NAME, this.name); break; } else if (fpLocalType.KM1_IND == "Y" && this.statue < STATUE_KM1_ENTER) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未完成科目1考试,不能进行9选3考试", lStrIdentity, this.name); break; } } else if (!DateTimeHelper.fnIsNewDateTime(this.KM2_3IN9_ENTER)) { this.remark = string.Format(msgPrefix + " 在{1}已进行9选3考试,不能重复考试", lStrIdentity, this.KM2_3IN9_ENTER.ToString("yyyy-MM-dd HH:mm:ss"), this.name); break; } this.km2_3in9_enter = lDtIdentity; isCheckin = true; if (this.statue < STATUE_TRAIN_END) { //this.statue = STATUE_3IN9_ENTER; this.statue = fpLocalType.nextStatus(STATUE_3IN9_ENTER); } this.remark = string.Format(msgPrefix + " 9选3考试验证成功", lStrIdentity, this.name); break; }//case 3in9 case "km3": { if (fpLocalType.KM3_IND != "Y") { this.remark = string.Format(msgPrefix + " 类型:{0},无需进行科目3考试", fpLocalType.NAME, this.name); break; } else if (fpLocalType.KM2_3IN9_IND == "Y" && DateTimeHelper.fnIsNewDateTime(this.KM2_3IN9_ENTER)) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未完成9选3考试,不能进行科目3考试", lStrIdentity, this.name); break; } } else if (fpLocalType.KM2_IND == "Y" && DateTimeHelper.fnIsNewDateTime(this.KM2_ENTER)) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未完成科目2考试,不能进行科目3考试", lStrIdentity, this.name); break; } } else if (this.statue < STATUE_TRAIN_END&&fpLocalType.TRAIN_TIMES>0) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未完成入场训练,不能进行科目3考试", lStrIdentity, this.name); break; } } else if (fpLocalType.KM3_VERIFY_IND == "Y" && this.KM3_VERIFY != "Y") { this.remark = string.Format(msgPrefix + " 未通过科目3审核,不能进行科目3考试", lStrIdentity, this.name); break; } else if (this.statue >= STATUE_KM3_ENTER) { this.remark = string.Format(msgPrefix + " 在{1}已进行科目3考试,不能重复考试", lStrIdentity, this.KM3_ENTER.ToString("yyyy-MM-dd HH:mm:ss"), this.name); break; } this.km3_enter = lDtIdentity; isCheckin = true; //this.statue = STATUE_KM3_ENTER; this.statue = fpLocalType.nextStatus(STATUE_KM3_ENTER); this.remark = string.Format(msgPrefix + " 科目3考试验证成功", lStrIdentity); break; }//case km3 default : break; } return isCheckin; }
public bool checkin(FpSite fpSite, FpLocalType fpLocalType, DateTime lDtIdentity) { int code=0; return checkin( fpSite, fpLocalType, lDtIdentity,out code); }
public bool checkin(FpSite fpSite, FpLocalType fpLocalType, DateTime lDtIdentity, out int errorCode) { errorCode = 0; //int gIntLessonInterval = StringHelper.fnFormatNullOrBlankInt(SystemWholeXmlConfigManager.GetConfig("FP_LESSON_INTERVAL"), 45); //int gIntTrainInterval = StringHelper.fnFormatNullOrBlankInt(SystemWholeXmlConfigManager.GetConfig("FP_TRAIN_INTERVAL"), 45); if (string.IsNullOrEmpty(this.lsh)) { this.remark = string.Format("{2}学员 {0}({1}) 受理号未录入", this.name, this.idcard, schoolName); errorCode = -1; return(false); } else if (this.isBl()) { this.feeStatue = "Y"; } else if (this.feeStatue != "Y") { this.remark = string.Format("{2}学员 {0}({1}) 收费审核未通过", this.name, this.idcard, this.schoolName); errorCode = -2; return(false); } FPConfig config = FPSystemBiz.GetCurrConfig(); int gIntLessonInterval = config.FP_LESSON_INTERVAL; int gIntTrainInterval = config.FP_TRAIN_INTERVAL; bool isCheckin = false; // DateTime lDtIdentity=DateTime.Now; DateTime lDtNull = new DateTime(0); string lStrIdentity = lDtIdentity.ToShortTimeString(); string msgPrefix = string.Format("{0} {1}学员 {2} ", lStrIdentity, this.schoolName, this.name); switch (fpSite.BUSTYPE) { case "lesson": { if (this.statue < STATUE_COLLECT) { this.remark = string.Format(msgPrefix + " 未进行指纹采集", lStrIdentity, this.name, this.schoolName); break; } //else if (fpLocalType.LESSON_IND != "Y") { // this.remark = string.Format("学员 类型:{0},无需进行上课",fpLocalType.NAME,this.name); //} //else if (this.feeStatue != "Y") // { // this.remark = string.Format("{0} 学员交费审核未通过,不能进行上课", lStrIdentity); // break; // } else if (this.statue >= STATUE_LESSON_END) { this.remark = string.Format(msgPrefix + " 已完成上课学时", lStrIdentity, this.name, this.schoolName); break; } DateTime dtLesson2Leavel = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, config.FP_LESSON_ENTER_2_HH, config.FP_LESSON_ENTER_2_MM, 0).AddMinutes(config.FP_LESSON_INTERVAL); if (DateTimeHelper.fnIsNewDateTime(this.LESSON_ENTER_1)) { if (!DateTimeHelper.fnIsBeforeTime(lDtIdentity, config.FP_LESSON_ENTER_1_HH, config.FP_LESSON_ENTER_1_MM) && fnIsVaildTime(lDtIdentity, dtLesson2Leavel)) { this.remark = string.Format(msgPrefix + " 早场第一节上课超过限制时间 {1}:{2},考勤无效", lStrIdentity, config.FP_LESSON_ENTER_1_HH, config.FP_LESSON_ENTER_1_MM, this.name, this.schoolName); break; } else if (!DateTimeHelper.fnIsBeforeTime(lDtIdentity, config.FP_LESSON_ENTER_3_HH, config.FP_LESSON_ENTER_3_MM)) { this.remark = string.Format(msgPrefix + " 晚场第一节上课超过限制时间 {1}:{2},考勤无效", lStrIdentity, config.FP_LESSON_ENTER_3_HH, config.FP_LESSON_ENTER_3_MM, this.name, this.schoolName); break; } //else if (!DateTimeHelper.fnIsBeforeTime(lDtIdentity, config.FP_LESSON_ENTER_1_HH, config.FP_LESSON_ENTER_1_MM)) //{ // this.remark = string.Format("{0} 上午上课超过限制时间 {1}:{2},考勤无效", // lStrIdentity, config.FP_LESSON_ENTER_1_HH, config.FP_LESSON_ENTER_1_MM); // break; //} this.LESSON_ENTER_1 = lDtIdentity; this.statue = STATUE_LESSON_START; this.remark = string.Format(msgPrefix + " 开始进行第一节上课", lStrIdentity, this.name, this.schoolName); isCheckin = true; } else if (!fnIsVaildTime(this.LESSON_ENTER_1, lDtIdentity, 0)) { //lStrUpdateSqlClearRecord = string.Format(lStrUpdateSqlClearRecord, lStrParm2); //FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql(lStrUpdateSqlClearRecord); //lIntReturn = LESSON_ENTER_1_FAILE; this.LESSON_ENTER_1 = lDtNull; this.LESSON_ENTER_2 = lDtNull; this.LESSON_LEAVE_2 = lDtNull; this.LESSON_LEAVE_1 = lDtNull; this.remark = string.Format(msgPrefix + " 本次上课与上次不在同一天进行,旧上课记录已被清空,请再次确认上课", lStrIdentity, this.name, this.schoolName); this.statue = STATUE_COLLECT; } else if (DateTimeHelper.fnIsNewDateTime(this.LESSON_LEAVE_1)) { if (fnIsVaildTime(this.LESSON_ENTER_1, lDtIdentity, gIntLessonInterval)) { this.LESSON_LEAVE_1 = lDtIdentity; this.remark = string.Format(msgPrefix + " 第一节上课离场成功,请今天再来第二节上课入场确认", lStrIdentity, this.name); isCheckin = true; } else { // lIntReturn = LESSON_ENTER_2_FAILE; this.remark = string.Format(msgPrefix + " 第一节上课时间未达到{1}分钟,提早离场将被视为无效", lStrIdentity, gIntLessonInterval, this.name); } } else if (DateTimeHelper.fnIsNewDateTime(this.LESSON_ENTER_2)) { //if (fnIsVaildTime(this.LESSON_LEAVE_1, lDtIdentity, gIntLessonInterval)) if (!DateTimeHelper.fnIsBeforeTime(lDtIdentity, config.FP_LESSON_ENTER_2_HH, config.FP_LESSON_ENTER_2_MM) && fnIsVaildTime(lDtIdentity, dtLesson2Leavel) ) { // lIntReturn = LESSON_ENTER_2_FAILE; //this.remark = string.Format("{0} 上午上课时间未达到{1}分钟,不能进行下午上课", lStrIdentity,gIntLessonInterval); this.remark = string.Format(msgPrefix + " 早场第二节上课超过限制时间 {1}:{2},考勤无效", lStrIdentity, config.FP_LESSON_ENTER_2_HH, config.FP_LESSON_ENTER_2_MM, this.name); break; } else if (!DateTimeHelper.fnIsBeforeTime(lDtIdentity, config.FP_LESSON_ENTER_4_HH, config.FP_LESSON_ENTER_4_MM)) { // lIntReturn = LESSON_ENTER_2_FAILE; //this.remark = string.Format("{0} 上午上课时间未达到{1}分钟,不能进行下午上课", lStrIdentity,gIntLessonInterval); this.remark = string.Format(msgPrefix + " 晚场第二节上课超过限制时间 {1}:{2},考勤无效", lStrIdentity, config.FP_LESSON_ENTER_4_HH, config.FP_LESSON_ENTER_4_MM, this.name); break; } this.LESSON_ENTER_2 = lDtIdentity; this.remark = string.Format(msgPrefix + " 开始进行第二节上课", lStrIdentity, this.name); isCheckin = true; } else if (DateTimeHelper.fnIsNewDateTime(this.LESSON_LEAVE_2)) { if (fnIsVaildTime(this.LESSON_ENTER_2, lDtIdentity, gIntLessonInterval)) { // lStrParm0 = lStrPrfLESSON_LEAVE + "_2"; this.LESSON_LEAVE_2 = lDtIdentity; //this.statue = STATUE_LESSON_END; this.statue = fpLocalType.nextStatus(STATUE_LESSON_END); this.remark = string.Format(msgPrefix + " 完成上课学时要求", lStrIdentity, this.name); isCheckin = true; } else { this.remark = string.Format(msgPrefix + " 第二节上课时间未达到{1}分钟,提早离场将被视为无效", lStrIdentity, gIntLessonInterval, this.name); } } break; } //case "lesson" case "km1": { if (fpLocalType.KM1_IND != "Y") { this.remark = string.Format(msgPrefix + " 类型:{0},无需进行科目1考试", fpLocalType.NAME, this.name); break; } else if (fpLocalType.LESSON_IND == "Y" && this.statue < STATUE_LESSON_END) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未完成上课,不能进行科目1考试", lStrIdentity, this.name); break; } } else if (!DateTimeHelper.fnIsNewDateTime(this.KM1_ENTER)) { this.remark = string.Format(msgPrefix + " 在{1}已进行科目1考试,不能重复考试", lStrIdentity, this.KM1_ENTER.ToString("yyyy-MM-dd HH:mm:ss"), this.name); break; } this.km1_enter = lDtIdentity; //this.statue = STATUE_KM1_ENTER; this.statue = fpLocalType.nextStatus(STATUE_KM1_ENTER); this.remark = string.Format(msgPrefix + " 科目1考试验证成功", lStrIdentity, this.name); isCheckin = true; break; } //case km1 case "km2": { if (fpLocalType.KM2_IND != "Y") { this.remark = string.Format(msgPrefix + " 类型:{0},无需进行科目2桩考", fpLocalType.NAME, this.name); break; } else if (fpLocalType.KM1_IND == "Y" && this.statue < STATUE_KM1_ENTER) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未进行科目1考试,不能进行科目2考试", lStrIdentity, this.name); break; } } else if (!DateTimeHelper.fnIsNewDateTime(this.KM2_ENTER)) { this.remark = string.Format(msgPrefix + " 在{1}已进行科目2考试,不能重复考试", lStrIdentity, this.KM2_ENTER.ToString("yyyy-MM-dd HH:mm:ss"), this.name); break; } this.km2_enter = lDtIdentity; if (this.statue < STATUE_TRAIN_END) { //this.statue = STATUE_KM2_ENTER; this.statue = fpLocalType.nextStatus(STATUE_KM2_ENTER); } this.remark = string.Format(msgPrefix + " 科目2考试验证成功", lStrIdentity, this.name); isCheckin = true; break; } //case km2 case "train": { if (fpLocalType.TRAIN_TIMES < 1) { this.remark = string.Format(msgPrefix + " 类型:{0},无需进行入场训练", fpLocalType.NAME, this.name); break; } else if (fpLocalType.KM1_IND == "Y" && this.statue < STATUE_KM1_ENTER) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未进行科目1考试,不能进行入场训练", lStrIdentity, this.name); break; } } else if (this.statue >= STATUE_TRAIN_END) { this.remark = string.Format(msgPrefix + " 已完成入场训练", lStrIdentity, this.name); break; } int trainTimes = 0; string re = string.Empty; string patternTrainEnter = msgPrefix + " 开始进行第{1}次入场训练"; string patternTrainEnterNotToday = msgPrefix + " 第{1}次的训练未完成,第{1}次的记录将被清空,请再次验证"; string patternTrainLeave = msgPrefix + " 已完成今天的入场训练"; string patternTrainLeaveFaile = msgPrefix + " 今天的入场训练时间未达到{1}分钟,离场将被作为训练无效处理"; string patternTrainEnterIsToday = msgPrefix + " 今天的入场训练已完成,同一天不能入场两次"; string patternTrainFinish = msgPrefix + " 已进行{1}次入场训练,入场训练完成"; string patternTrainLeveeFaile2 = msgPrefix + " 未达到离场最早限制时间 {1}:{2},现在离场将被视为考勤无效"; //1 if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_1) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_1)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_1)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_1 = lDtIdentity; this.statue = STATUE_TRAIN_START; this.remark = string.Format(patternTrainEnter, lStrIdentity, 1); isCheckin = true; } else if (!fnIsVaildTime(this.TRAIN_ENTER_1, lDtIdentity)) { this.train_enter_1 = lDtNull; this.train_leave_1 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 1); } else if (fnIsVaildTime(this.TRAIN_ENTER_1, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_1); if (re != string.Empty) { this.remark = re; break; } this.train_leave_1 = lDtIdentity; this.remark = string.Format(patternTrainLeave, lStrIdentity); isCheckin = true; trainTimes = 1; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_1, lDtIdentity)) { //lIntReturn = CHECK_SAMEDAY_FAILE; this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //2 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_2) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_2)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_2)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_2 = lDtIdentity; this.remark = string.Format(patternTrainEnter, lStrIdentity, 2); isCheckin = true; } else if (!fnIsVaildTime(this.TRAIN_ENTER_2, lDtIdentity)) { this.train_enter_2 = lDtNull; this.train_leave_2 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 2); } else if (fnIsVaildTime(this.TRAIN_ENTER_2, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_2); if (re != string.Empty) { this.remark = re; break; } this.train_leave_2 = lDtIdentity; this.remark = string.Format(patternTrainLeave, lStrIdentity); isCheckin = true; trainTimes = 2; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_2, lDtIdentity)) { this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //3 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_3) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_3)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_3)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_3 = lDtIdentity; this.remark = string.Format(patternTrainEnter, lStrIdentity, 3); isCheckin = true; } else if (!fnIsVaildTime(this.TRAIN_ENTER_3, lDtIdentity)) { this.train_enter_3 = lDtNull; this.train_leave_3 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 3); } else if (fnIsVaildTime(this.TRAIN_ENTER_3, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_3); if (re != string.Empty) { this.remark = re; break; } this.train_leave_3 = lDtIdentity; this.remark = string.Format(patternTrainLeave, lStrIdentity); isCheckin = true; trainTimes = 3; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_3, lDtIdentity)) { this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //4 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_4) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_4)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_4)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_4 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainEnter, lStrIdentity, 4); } else if (!fnIsVaildTime(this.TRAIN_ENTER_4, lDtIdentity)) { this.train_enter_4 = lDtNull; this.train_leave_4 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 4); } else if (fnIsVaildTime(this.TRAIN_ENTER_4, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_4); if (re != string.Empty) { this.remark = re; break; } this.train_leave_4 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainLeave, lStrIdentity); trainTimes = 4; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_4, lDtIdentity)) { this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //5 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_5) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_5)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_5)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_5 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainEnter, lStrIdentity, 5); } else if (!fnIsVaildTime(this.TRAIN_ENTER_5, lDtIdentity)) { this.train_enter_5 = lDtNull; this.train_leave_5 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 5); } else if (fnIsVaildTime(this.TRAIN_ENTER_5, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_5); if (re != string.Empty) { this.remark = re; break; } this.train_leave_5 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainLeave, lStrIdentity); trainTimes = 5; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_5, lDtIdentity)) { //lStrClearParm0 = "5"; this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //6 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_6) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_6)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_6)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_6 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainEnter, lStrIdentity, 6); } else if (!fnIsVaildTime(this.TRAIN_ENTER_6, lDtIdentity)) { this.train_enter_6 = lDtNull; this.train_leave_6 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 6); } else if (fnIsVaildTime(this.TRAIN_ENTER_6, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_6); if (re != string.Empty) { this.remark = re; break; } this.train_leave_6 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainLeave, lStrIdentity); trainTimes = 6; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_6, lDtIdentity)) { //lStrClearParm0 = "6"; this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //7 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_7) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_7)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_7)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_7 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainEnter, lStrIdentity, 7); } else if (!fnIsVaildTime(this.TRAIN_ENTER_7, lDtIdentity)) { this.train_enter_7 = lDtNull; this.train_leave_7 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 7); } else if (fnIsVaildTime(this.TRAIN_ENTER_7, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_7); if (re != string.Empty) { this.remark = re; break; } this.train_leave_7 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainLeave, lStrIdentity); trainTimes = 7; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_7, lDtIdentity)) { //lStrClearParm0 = "7"; this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //8 else if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_8) || DateTimeHelper.fnIsNewDateTime(this.TRAIN_LEAVE_8)) { if (DateTimeHelper.fnIsNewDateTime(this.TRAIN_ENTER_8)) { re = config.checkTrainEnter(lDtIdentity); if (re != string.Empty) { this.remark = re; break; } this.train_enter_8 = lDtIdentity; isCheckin = true; this.remark = string.Format(patternTrainEnter, lStrIdentity, 8); } else if (!fnIsVaildTime(this.TRAIN_ENTER_8, lDtIdentity)) { this.train_enter_8 = lDtNull; this.train_leave_8 = lDtNull; this.remark = string.Format(patternTrainEnterNotToday, lStrIdentity, 8); } else if (fnIsVaildTime(this.TRAIN_ENTER_8, lDtIdentity, gIntTrainInterval)) { re = config.checkTrainLeave(lDtIdentity, this.TRAIN_ENTER_8); if (re != string.Empty) { this.remark = re; break; } this.train_leave_8 = lDtIdentity; isCheckin = true; this.statue = STATUE_TRAIN_END; this.remark = string.Format(patternTrainFinish, lStrIdentity, 8); trainTimes = 8; } else { this.remark = string.Format(patternTrainLeaveFaile, lStrIdentity, gIntTrainInterval); } } else if (fnIsVaildTime(this.TRAIN_ENTER_8, lDtIdentity)) { // lStrClearParm0 = "8"; this.remark = string.Format(patternTrainEnterIsToday, lDtIdentity); } //入场训练学员分类 if (trainTimes >= fpLocalType.TRAIN_TIMES) { //this.statue = STATUE_TRAIN_END; this.statue = fpLocalType.nextStatus(STATUE_TRAIN_END); this.TRAIN_END_DATE = DateTime.Now; this.remark = string.Format(patternTrainLeave, lStrIdentity, trainTimes); } break; } //case "train" case "3in9": { if (fpLocalType.KM2_3IN9_IND != "Y") { this.remark = string.Format(msgPrefix + " 类型:{0},无需进行9选3考试", fpLocalType.NAME, this.name); break; } else if (fpLocalType.KM1_IND == "Y" && this.statue < STATUE_KM1_ENTER) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未完成科目1考试,不能进行9选3考试", lStrIdentity, this.name); break; } } else if (!DateTimeHelper.fnIsNewDateTime(this.KM2_3IN9_ENTER)) { this.remark = string.Format(msgPrefix + " 在{1}已进行9选3考试,不能重复考试", lStrIdentity, this.KM2_3IN9_ENTER.ToString("yyyy-MM-dd HH:mm:ss"), this.name); break; } this.km2_3in9_enter = lDtIdentity; isCheckin = true; if (this.statue < STATUE_TRAIN_END) { //this.statue = STATUE_3IN9_ENTER; this.statue = fpLocalType.nextStatus(STATUE_3IN9_ENTER); } this.remark = string.Format(msgPrefix + " 9选3考试验证成功", lStrIdentity, this.name); break; } //case 3in9 case "km3": { if (fpLocalType.KM3_IND != "Y") { this.remark = string.Format(msgPrefix + " 类型:{0},无需进行科目3考试", fpLocalType.NAME, this.name); break; } else if (fpLocalType.KM2_3IN9_IND == "Y" && DateTimeHelper.fnIsNewDateTime(this.KM2_3IN9_ENTER)) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未完成9选3考试,不能进行科目3考试", lStrIdentity, this.name); break; } } else if (fpLocalType.KM2_IND == "Y" && DateTimeHelper.fnIsNewDateTime(this.KM2_ENTER)) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未完成科目2考试,不能进行科目3考试", lStrIdentity, this.name); break; } } else if (this.statue < STATUE_TRAIN_END && fpLocalType.TRAIN_TIMES > 0) { if (!this.isBl()) { this.remark = string.Format(msgPrefix + " 未完成入场训练,不能进行科目3考试", lStrIdentity, this.name); break; } } else if (fpLocalType.KM3_VERIFY_IND == "Y" && this.KM3_VERIFY != "Y") { this.remark = string.Format(msgPrefix + " 未通过科目3审核,不能进行科目3考试", lStrIdentity, this.name); break; } else if (this.statue >= STATUE_KM3_ENTER) { this.remark = string.Format(msgPrefix + " 在{1}已进行科目3考试,不能重复考试", lStrIdentity, this.KM3_ENTER.ToString("yyyy-MM-dd HH:mm:ss"), this.name); break; } this.km3_enter = lDtIdentity; isCheckin = true; //this.statue = STATUE_KM3_ENTER; this.statue = fpLocalType.nextStatus(STATUE_KM3_ENTER); this.remark = string.Format(msgPrefix + " 科目3考试验证成功", lStrIdentity); break; } //case km3 default: break; } return(isCheckin); }
public bool checkin(FpSite fpSite, FpLocalType fpLocalType, DateTime lDtIdentity) { int code = 0; return(checkin(fpSite, fpLocalType, lDtIdentity, out code)); }
public static Boolean fnStudentCheckIn(ref FpStudentObject fso, FpSite fpSite, DateTime lDtCheckin) { bool isCheckin = false; //FpSite fpSite = SimpleOrmOperator.Query<FpSite>(site_id); string bustype = fpSite.BUSTYPE; int localType = fso.LOCALTYPE; if (fpSite.LIMIT > 0) { string condition = string.Format(" where SITE_ID={0} and BUSTYPE='{1}' and to_char(CHECKIN_DATE,'YYYY-MM-DD') = '{2}' order by CHECKIN_DATE DESC " , fpSite.ID , bustype , lDtCheckin ); int checkinCount = SimpleOrmOperator.QueryCounts <FpSite>(condition); if (checkinCount >= fpSite.LIMIT) { string fullMsg = string.Format("场地:{0} 今天的入场人数已超过{1},不能再入场", fpSite.NAME, fpSite.LIMIT); throw new Exception(fullMsg); } } FpLocalType fpLocalType = null; if (DictFpLocalTypes.ContainsKey(localType)) { fpLocalType = DictFpLocalTypes[localType]; } else { fpLocalType = SimpleOrmOperator.Query <FpLocalType>(localType); DictFpLocalTypes.Add(localType, fpLocalType); } isCheckin = fso.checkin(fpSite, fpLocalType, lDtCheckin); //fso.IDCARD="'"+fso.IDCARD+"'"; SimpleOrmOperator.Update(fso); fso.IDCARD = fso.IDCARD.Trim('\'');; if (isCheckin) { FpCheckinLog log = new FpCheckinLog(); log.BUSTYPE = bustype; log.SITE_ID = fpSite.ID; log.CHECKIN_NAME = fso.NAME; log.CHECKIN_IDCARD = fso.IDCARD; log.CHECKIN_DATE = lDtCheckin; log.REMARK = fso.REMARK; log.CHECKIN_STATUE = fso.STATUE; int statue = fso.STATUE; if (statue == FpStudentObject.STATUE_KM1_ENTER) { log.REMARK = "科目1进场"; } else if (statue == FpStudentObject.STATUE_KM2_ENTER) { log.REMARK = "科目2进场"; } else if (statue == FpStudentObject.STATUE_KM1_ENTER) { log.REMARK = "科目3进场"; } else if (statue == FpStudentObject.STATUE_LESSON_START) { log.REMARK = "上课进场"; } else if (statue == FpStudentObject.STATUE_LESSON_END) { log.REMARK = "下课离场"; } isCheckin = SimpleOrmOperator.Create(log); } return(isCheckin); }