Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            // Session["site_id"] = Request.Params["site_id"];
            Session["bustype"] = Request.Params["bustype"];
            int site_id = StringHelper.fnFormatNullOrBlankInt(Request.Params["site_id"], -1);

            FpSite site = null;
            if (FPSystemBiz.DictFpSites.ContainsKey(site_id))
            {
                site = FPSystemBiz.DictFpSites[site_id];
            }
            else
            {
                site = SimpleOrmOperator.Query <FpSite>(site_id);
                FPSystemBiz.DictFpSites.Add(site_id, site);
            }
            Session[typeof(FpSite).Name] = site;
            this.Title      = site.NAME;
            Session["host"] = site.HOST;
        }
        catch (Exception ex) {
            this.RedirectNotRight();
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int site_id = StringHelper.fnFormatNullOrBlankInt(Request.Params["site_id"], -1);

        if (site_id == -1)
        {
            return;
        }
        FpSite site = SimpleOrmOperator.Query <FpSite>(site_id);

        if (site == null)
        {
            return;
        }

        string lStrLimit = "无限制";

        if (site.LIMIT != null && site.LIMIT > 0)
        {
            lStrLimit = site.LIMIT.ToString();
        }

        lbSiteName.Text  = site.NAME;
        lbSiteLimit.Text = lStrLimit;
        lbToday.Text     = DateTime.Now.ToString("yyyy-MM-dd");
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Params[FPSystemBiz.PARAM_RESULT] == null || IsPostBack)
        {
            return;
        }
        string lStrIDCard = StringHelper.fnFormatNullOrBlankString(Request.Params[FPSystemBiz.PARAM_RESULT], "");

        if (lStrIDCard == "")
        {
            return;
        }
        FpStudentObject fso = SimpleOrmOperator.Query <FpStudentObject>(lStrIDCard);

        //lStrIDCard = Server.UrlDecode(lStrIDCard);
        //int lIntResultCode= FPSyst//////////emBiz.fnIdendityStudentLesson(lStrIDCard);
        bool     isCheckin = false;
        DateTime lDtToday  = DateTime.Now;

        if (fso == null)
        {
            this.lbStudentAlertMsg.Text = "学员个人信息不存在,可能是驾校未及时上传";
            WebTools.PlaySound("../../sound/学员个人信息不存在.wav");
            return;
        }
        else
        {
            ucStudentInfo.fnUILoadStudentRecord(fso);
            try
            {
                //int site_id = StringHelper.fnFormatNullOrBlankInt(Session["site_id"].ToString());
                FpSite fpSite = Session[typeof(FpSite).Name] as FpSite;
                isCheckin = FPSystemBiz.fnStudentCheckIn(ref fso, fpSite, lDtToday);
                if (isCheckin)
                {
                    if (fso.STATUE == FpStudentObject.STATUE_LESSON_END)
                    {
                        WebTools.PlaySound("../../sound/学员已完成上课.wav");
                    }
                    else
                    {
                        WebTools.PlaySound("../../sound/上课考勤有效.wav");
                    }
                }
                else
                {
                    WebTools.PlaySound("../../sound/上课考勤无效.wav");
                }
                this.fnUILoadStudentRecord(fso, 0);
            }
            catch (Exception ex) {
                lbStudentAlertMsg.Text = ex.Message;
            }
        }
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Params[FPSystemBiz.PARAM_RESULT] == null)
        {
            return;
        }
        string lStrIDCard = StringHelper.fnFormatNullOrBlankString(Request.Params[FPSystemBiz.PARAM_RESULT], "");

        if (lStrIDCard == "")
        {
            return;
        }
        //int lIntResultCode = FPSystemBiz.fnIdendityStudentTrain(lStrIDCard);

        FpStudentObject fso       = SimpleOrmOperator.Query <FpStudentObject>(lStrIDCard);
        bool            isCheckin = false;

        DateTime lDtToday = DateTime.Now;
        string   bustype  = "km";

        if (Session["bustype"] != null)
        {
            bustype = Session["bustype"].ToString();
        }
        if (fso == null)
        {
            this.lbStudentAlertMsg.Text = "学员个人信息不存在";
            WebTools.PlaySound("../../sound/学员个人信息不存在.wav");
            return;
        }
        else
        {
            ucStudentInfo.fnUILoadStudentRecord(fso);
            try
            {
                //int site_id = StringHelper.fnFormatNullOrBlankInt(Session["site_id"].ToString());
                FpSite fpSite = Session[typeof(FpSite).Name] as FpSite;
                isCheckin = FPSystemBiz.fnStudentCheckIn(ref fso, fpSite, lDtToday);
                if (isCheckin)
                {
                    WebTools.PlaySound("../../sound/考试入场考勤有效.wav");
                }
                else
                {
                    WebTools.PlaySound("../../sound/考试入场考勤无效.wav");
                }
                this.fnUILoadStudentRecord(fso, 0);
            }
            catch (Exception ex) {
                lbStudentAlertMsg.Text = ex.Message;
            }
        }
    }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ArrayList dllData = new ArrayList();
         FpSite    newStie = new FpSite();
         newStie.ID   = 0;
         newStie.NAME = "全部";
         dllData.Add(newStie);
         ArrayList listSite = SimpleOrmOperator.QueryConditionList <FpSite>("");
         dllData.AddRange(listSite);
         dllSite.DataSource     = dllData;
         dllSite.DataTextField  = "NAME";
         dllSite.DataValueField = "ID";
         dllSite.DataBind();
     }
 }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int    id   = StringHelper.fnFormatNullOrBlankInt(Request.Params["id"], -1);
         FpSite site = SimpleOrmOperator.Query <FpSite>(id);
         if (site == null)
         {
             return;
         }
         this.lbId.Text                = id.ToString();
         this.txtSiteName.Text         = site.NAME;
         this.txtSiteLimit.Text        = site.LIMIT == null ? "0" : site.LIMIT.ToString();
         this.dllBustype.SelectedValue = site.BUSTYPE;
         this.txtHost.Text             = site.HOST;
     }
 }
Ejemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ArrayList dllData = new ArrayList();
         FpSite newStie = new FpSite();
         newStie.ID = 0;
         newStie.NAME = "全部";
         dllData.Add(newStie);
         ArrayList listSite = SimpleOrmOperator.QueryConditionList<FpSite>("");
         dllData.AddRange(listSite);
         dllSite.DataSource = dllData;
         dllSite.DataTextField = "NAME";
         dllSite.DataValueField = "ID";
         dllSite.DataBind();
     }
 }
Ejemplo n.º 8
0
 protected void btnCommit_Click(object sender, EventArgs e)
 {
     FpSite site = new FpSite();
     site.ID = StringHelper.fnFormatNullOrBlankInt(this.lbId.Text,-1);
     site.NAME = txtSiteName.Text;
     site.LIMIT = StringHelper.fnFormatNullOrBlankInt(txtSiteLimit.Text,0);
     site.BUSTYPE = this.dllBustype.SelectedValue;
     site.HOST = this.txtHost.Text;
     if (SimpleOrmOperator.Update(site)) {
         WebTools.Alert("修改成功!");
     }
     else if (SimpleOrmOperator.Create(site))
     {
         WebTools.Alert("添加成功!");
     }
     else {
         WebTools.Alert("保存失败!");
     }
     FPSystemBiz.DictFpSites.Clear();
 }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["bustype"] == null || Session[typeof(FpSite).Name] == null)
        {
            return;
        }

        FpSite site      = Session[typeof(FpSite).Name] as FpSite;
        string bustype   = Session["bustype"].ToString();
        string lStrToday = DateTime.Now.ToString("yyyy-MM-dd");
        string condition = string.Format(" where SITE_ID={0} and BUSTYPE='{1}' and to_char(CHECKIN_DATE,'YYYY-MM-DD') = '{2}' order by CHECKIN_DATE ASC "
                                         , site.ID
                                         , bustype
                                         , lStrToday
                                         );
        ArrayList listLogs = SimpleOrmOperator.QueryConditionList <FpCheckinLog>(condition);

        ViewState[typeof(FpCheckinLog).Name] = listLogs;
        // rpLogs.DataSource = listLogs;
        // rpLogs.DataBind();
    }
Ejemplo n.º 10
0
    protected void btnCommit_Click(object sender, EventArgs e)
    {
        FpSite site = new FpSite();

        site.ID      = StringHelper.fnFormatNullOrBlankInt(this.lbId.Text, -1);
        site.NAME    = txtSiteName.Text;
        site.LIMIT   = StringHelper.fnFormatNullOrBlankInt(txtSiteLimit.Text, 0);
        site.BUSTYPE = this.dllBustype.SelectedValue;
        site.HOST    = this.txtHost.Text;
        if (SimpleOrmOperator.Update(site))
        {
            WebTools.Alert("修改成功!");
        }
        else if (SimpleOrmOperator.Create(site))
        {
            WebTools.Alert("添加成功!");
        }
        else
        {
            WebTools.Alert("保存失败!");
        }
        FPSystemBiz.DictFpSites.Clear();
    }
Ejemplo n.º 11
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;
    }
Ejemplo n.º 12
0
 public bool checkin(FpSite fpSite, FpLocalType fpLocalType, DateTime lDtIdentity)
 {
     int code=0;
       return checkin( fpSite,  fpLocalType,  lDtIdentity,out code);
 }
Ejemplo n.º 13
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);
    }
Ejemplo n.º 14
0
    public bool checkin(FpSite fpSite, FpLocalType fpLocalType, DateTime lDtIdentity)
    {
        int code = 0;

        return(checkin(fpSite, fpLocalType, lDtIdentity, out code));
    }
Ejemplo n.º 15
0
    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);
    }
Ejemplo n.º 16
0
    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;
    }