コード例 #1
0
ファイル: FPSystemBiz.cs プロジェクト: radtek/fivemen
 public static FPConfig GetCurrConfig()
 {
     if (CacheFpConfig == null)
     {
         CacheFpConfig = SimpleOrmOperator.QueryListAll(typeof(FPConfig))[0] as FPConfig;
     }
     return(CacheFpConfig);
 }
コード例 #2
0
ファイル: FPConfigEdit.aspx.cs プロジェクト: radtek/fivemen
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        FPConfig config = FPSystemBiz.GetCurrConfig();

        config.FP_LESSON_INTERVAL       = StringHelper.fnFormatNullOrBlankInt(tbFp_lesson_interval.Text, 1);
        config.FP_TRAIN_INTERVAL        = StringHelper.fnFormatNullOrBlankInt(tbFp_train_interval.Text, 1);
        config.FP_LESSON_ENTER_1_HH     = ddlLessonEnter1HH.SelectedIndex;
        config.FP_LESSON_ENTER_1_MM     = ddlLessonEnter1MM.SelectedIndex;
        config.FP_LESSON_ENTER_2_HH     = ddlLessonEnter2HH.SelectedIndex;
        config.FP_LESSON_ENTER_2_MM     = ddlLessonEnter2MM.SelectedIndex;
        config.FP_LESSON_ENTER_3_HH     = ddlLessonEnter3HH.SelectedIndex;
        config.FP_LESSON_ENTER_3_MM     = ddlLessonEnter3MM.SelectedIndex;
        config.FP_LESSON_ENTER_4_HH     = ddlLessonEnter4HH.SelectedIndex;
        config.FP_LESSON_ENTER_4_MM     = ddlLessonEnter4MM.SelectedIndex;
        config.FP_TRAIN_1_ENTER_FROM_HH = ddlTrain1EnterFromHH.SelectedIndex;
        config.FP_TRAIN_1_ENTER_FROM_MM = ddlTrain1EnterFromMM.SelectedIndex;
        config.FP_TRAIN_1_ENTER_TO_HH   = ddlTrain1EnterToHH.SelectedIndex;
        config.FP_TRAIN_1_ENTER_TO_MM   = ddlTrain1EnterToMM.SelectedIndex;

        config.FP_TRAIN_2_ENTER_FROM_HH = ddlTrain2EnterFromHH.SelectedIndex;
        config.FP_TRAIN_2_ENTER_FROM_MM = ddlTrain2EnterFromMM.SelectedIndex;
        config.FP_TRAIN_2_ENTER_TO_HH   = ddlTrain2EnterToHH.SelectedIndex;
        config.FP_TRAIN_2_ENTER_TO_MM   = ddlTrain2EnterToMM.SelectedIndex;

        config.FP_TRAIN_3_ENTER_FROM_HH = ddlTrain3EnterFromHH.SelectedIndex;
        config.FP_TRAIN_3_ENTER_FROM_MM = ddlTrain3EnterFromMM.SelectedIndex;
        config.FP_TRAIN_3_ENTER_TO_HH   = ddlTrain3EnterToHH.SelectedIndex;
        config.FP_TRAIN_3_ENTER_TO_MM   = ddlTrain3EnterToMM.SelectedIndex;

        config.FP_TRAIN_1_LEAVE_HH = ddlTrain1LeaveHH.SelectedIndex;
        config.FP_TRAIN_1_LEAVE_MM = ddlTrain1LeaveMM.SelectedIndex;
        config.FP_TRAIN_2_LEAVE_HH = ddlTrain2LeaveHH.SelectedIndex;
        config.FP_TRAIN_2_LEAVE_MM = ddlTrain2LeaveMM.SelectedIndex;
        config.FP_TRAIN_3_LEAVE_HH = ddlTrain3LeaveHH.SelectedIndex;
        config.FP_TRAIN_3_LEAVE_MM = ddlTrain3LeaveMM.SelectedIndex;


        if (SimpleOrmOperator.Update(config))
        {
            WebTools.Alert("配置修改成功");
        }
        else
        {
            WebTools.Alert("配置修改失败");
        }
        FPSystemBiz.CacheFpConfig = null;
    }
コード例 #3
0
ファイル: FPConfigEdit.aspx.cs プロジェクト: radtek/fivemen
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            for (int hh = 0; hh < 24; hh++)
            {
                // ListItem li = new ListItem(hh.ToString(),hh.ToString());
                ddlTrain1EnterFromHH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));
                ddlTrain1EnterToHH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));
                ddlTrain2EnterFromHH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));
                ddlTrain2EnterToHH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));
                ddlTrain3EnterFromHH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));
                ddlTrain3EnterToHH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));

                ddlTrain1LeaveHH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));
                ddlTrain2LeaveHH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));
                ddlTrain3LeaveHH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));

                ddlLessonEnter1HH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));
                ddlLessonEnter2HH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));
                ddlLessonEnter3HH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));
                ddlLessonEnter4HH.Items.Add(new ListItem(hh.ToString(), hh.ToString()));
            }

            for (int mm = 0; mm < 60; mm++)
            {
                ddlTrain1EnterFromMM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
                ddlTrain1EnterToMM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
                ddlTrain2EnterFromMM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
                ddlTrain2EnterToMM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
                ddlTrain3EnterFromMM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
                ddlTrain3EnterToMM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));

                ddlTrain1LeaveMM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
                ddlTrain2LeaveMM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
                ddlTrain3LeaveMM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
                ddlLessonEnter1MM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
                ddlLessonEnter2MM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
                ddlLessonEnter3MM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
                ddlLessonEnter4MM.Items.Add(new ListItem(mm.ToString(), mm.ToString()));
            }

            FPConfig config = FPSystemBiz.GetCurrConfig();
            tbFp_lesson_interval.Text = config.FP_LESSON_INTERVAL.ToString();
            tbFp_train_interval.Text  = config.FP_TRAIN_INTERVAL.ToString();

            ddlLessonEnter1HH.SelectedIndex = config.FP_LESSON_ENTER_1_HH;
            ddlLessonEnter1MM.SelectedIndex = config.FP_LESSON_ENTER_1_MM;
            ddlLessonEnter2HH.SelectedIndex = config.FP_LESSON_ENTER_2_HH;
            ddlLessonEnter2MM.SelectedIndex = config.FP_LESSON_ENTER_2_MM;
            ddlLessonEnter3HH.SelectedIndex = config.FP_LESSON_ENTER_3_HH;
            ddlLessonEnter3MM.SelectedIndex = config.FP_LESSON_ENTER_3_MM;
            ddlLessonEnter4HH.SelectedIndex = config.FP_LESSON_ENTER_4_HH;
            ddlLessonEnter4MM.SelectedIndex = config.FP_LESSON_ENTER_4_MM;



            ddlTrain1EnterFromHH.SelectedIndex = config.FP_TRAIN_1_ENTER_FROM_HH;
            ddlTrain1EnterFromMM.SelectedIndex = config.FP_TRAIN_1_ENTER_FROM_MM;
            ddlTrain1EnterToHH.SelectedIndex   = config.FP_TRAIN_1_ENTER_TO_HH;
            ddlTrain1EnterToMM.SelectedIndex   = config.FP_TRAIN_1_ENTER_TO_MM;


            ddlTrain2EnterFromHH.SelectedIndex = config.FP_TRAIN_2_ENTER_FROM_HH;
            ddlTrain2EnterFromMM.SelectedIndex = config.FP_TRAIN_2_ENTER_FROM_MM;
            ddlTrain2EnterToHH.SelectedIndex   = config.FP_TRAIN_2_ENTER_TO_HH;
            ddlTrain2EnterToMM.SelectedIndex   = config.FP_TRAIN_2_ENTER_TO_MM;


            ddlTrain3EnterFromHH.SelectedIndex = config.FP_TRAIN_3_ENTER_FROM_HH;
            ddlTrain3EnterFromMM.SelectedIndex = config.FP_TRAIN_3_ENTER_FROM_MM;
            ddlTrain3EnterToHH.SelectedIndex   = config.FP_TRAIN_3_ENTER_TO_HH;
            ddlTrain3EnterToMM.SelectedIndex   = config.FP_TRAIN_3_ENTER_TO_MM;

            ddlTrain1LeaveHH.SelectedIndex = config.FP_TRAIN_1_LEAVE_HH;
            ddlTrain1LeaveMM.SelectedIndex = config.FP_TRAIN_1_LEAVE_MM;
            ddlTrain2LeaveHH.SelectedIndex = config.FP_TRAIN_2_LEAVE_HH;
            ddlTrain2LeaveMM.SelectedIndex = config.FP_TRAIN_2_LEAVE_MM;
            ddlTrain3LeaveHH.SelectedIndex = config.FP_TRAIN_3_LEAVE_HH;
            ddlTrain3LeaveMM.SelectedIndex = config.FP_TRAIN_3_LEAVE_MM;
        }
    }
コード例 #4
0
    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);
    }
コード例 #5
0
ファイル: FPSystemBiz.cs プロジェクト: romanu6891/fivemen
 public static FPConfig GetCurrConfig()
 {
     if (CacheFpConfig == null)
     {
         CacheFpConfig= SimpleOrmOperator.QueryListAll(typeof(FPConfig))[0] as FPConfig;
     }
     return CacheFpConfig;
 }