public static bool Check(int id, string optname)
    {
        bool                    isChecked = false;
        StudentApplyInfo        info      = SimpleOrmOperator.Query <StudentApplyInfo>(id);
        StudentApplyInfoChecked infoCheck = SimpleOrmOperator.Query <StudentApplyInfoChecked>(id);
        string                  glbm      = System.Configuration.ConfigurationManager.AppSettings["DrvHelperSystem_glbm"];
        TmriResponse            resp      = null;

        string[] res = new string[] {};
        try
        {
            string useold = System.Configuration.ConfigurationManager.AppSettings["Drv_Apply_Use_Old"];
            if (useold == "true")
            {
                resp = new TmriResponse();
                bool resultold = DriverInterface.WriteApplyOld(ConvertInfoToRequest(info));
                // resultold ? 0 : 2;
                if (resultold)
                {
                    resp.Code    = 0;
                    resp.Message = "更新成功";
                }
                else
                {
                    resp.Code    = 2;
                    resp.Message = "更新不成功";
                }
            }
            // resp = DriverInterface.WriteDrvBaseTmriRequest(ConvertInfoToRequest(info));
            //resp= DriverInterface.yuyueInfo(info);
            info.Hmcd = "1";

            string xml = ConvertInfoToRequest(info).ToXml();
            res = DrvNewInterface.WritePresign(xml);
        }
        catch (Exception exe)
        {
            SaveInfoCheckFail(info, optname, exe.Message);
            //info.CheckResult = exe.Message;
            // SimpleOrmOperator.Update(info);
            return(false);
        }
        if (res.Length == 2)
        //if (resp.Code == 0 || resp.Code == 1)
        {
            infoCheck.Checked     = 1;
            infoCheck.CheckResult = res[1];
            isChecked             = true;
            //DataAccessFactory.GetDataAccess().ExecuteSql("update table_student_apply_info set i_tpchecked_num=i_tpchecked_num+1 where i_tpchecked_num<i_tpused_num and id=" + info.PaibanId);
        }
        else if (res.Length == 3)
        {
            infoCheck.Checked     = 2;
            infoCheck.CheckResult = res[1];
        }
        infoCheck.CheckOperator = optname;
        SimpleOrmOperator.Update(infoCheck);
        return(isChecked);
    }
Beispiel #2
0
        protected override void DoTask()
        {
            string    sql    = "select idacard,c_new_phone,c_new_postcode,c_new_address,c_old_phone,c_email,id from table_person_change_info where i_syn=0";
            DataTable dt     = DataAccessFactory.GetDataAccess().SelectDataTable(sql, "tmpdb");
            string    logstr = string.Empty;
            string    id     = string.Empty;

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DrvPresonInfoChangeRequest request = new DrvPresonInfoChangeRequest();
                    request.sfzmhm = dt.Rows[i][0] == null ? "" : dt.Rows[i][0].ToString();
                    request.lxdh   = dt.Rows[i][1] == null ? "" : dt.Rows[i][1].ToString();
                    request.yzbm   = dt.Rows[i][2] == null ? "" : dt.Rows[i][2].ToString();
                    request.lxzs   = dt.Rows[i][3] == null ? "" : dt.Rows[i][3].ToString();
                    request.sjhm   = dt.Rows[i][4] == null ? "" : dt.Rows[i][4].ToString();
                    request.dzyx   = dt.Rows[i][5] == null ? "" : dt.Rows[i][5].ToString();
                    logstr         = "正在处理身份证号码为:" + request.sfzmhm + "的信息本案变更!";
                    this.SetHintText(logstr);
                    this.CreateLog(logstr);
                    TmriResponse response = DriverInterface.WritePersonInfoChange(request);
                    id = dt.Rows[i][6].ToString();
                    if (response.Code == 0)
                    {
                        logstr = "成功处理身份证号码:" + request.sfzmhm;
                        this.SetHintText(logstr);
                        this.CreateLog(logstr);
                        sql = "update table_person_change_info set  i_syn=1,I_CHECKED=1,C_CHECK_DATE='" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',C_CHECK_RESULT='" + response.Message + "',C_CHECK_OPERATOR='" + this.monitorname + "'";
                    }
                    else
                    {
                        logstr = "失败处理身份证号码:" + request.sfzmhm + ";code:" + response.Code;
                        this.SetHintText(logstr);
                        this.CreateLog(logstr);
                        sql = "update table_person_change_info set  i_syn=1,I_CHECKED=0,C_CHECK_DATE='" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',C_CHECK_RESULT='" + response.Message + "',C_CHECK_OPERATOR='" + this.monitorname + "'";
                    }
                    sql += " where id=" + id;

                    DataAccessFactory.GetDataAccess().ExecuteSql(sql);
                }
            }
        }
Beispiel #3
0
    public static void Check(int id, string name)
    {
        try
        {
            // throw new Exception("测试异常");
            YuyueInfo info   = SimpleOrmOperator.Query <YuyueInfo>(id);
            string    glbm   = System.Configuration.ConfigurationManager.AppSettings["DrvHelperSystem_glbm"];
            int       bkjg   = int.Parse(ConfigurationManager.AppSettings["DrvHelperSystem_bkjg"].ToString());
            string    idcard = info.IdCard;
            DateTime  yyrq   = Convert.ToDateTime(info.Ksrq);
            int       km     = info.Km;

            /*
             * TempStudentInfo student = DrvQueryHelper.QueryStudent(glbm, info.IdCard);
             * if (student == null)
             * {
             *  SaveInfoCheckFail(info, name, "该学员不是本地车管所报名的!");
             *  return;
             * }
             * info.Dlr = student.jxmc;
             * info.DlrCode = student.jxdm;
             * info.JlyIdCard = student.jly;
             * info.Km = km;
             * info.Lsh = student.lsh;
             * info.Xm = student.name;
             * info.Zjcx = student.zkcx;
             * /*
             * try
             * {
             *  if (DateTime.Parse(student.yxqz).CompareTo(yyrq) < 0)
             *  {
             *      SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "的准考证明有效期到" + student.yxqz + "截止!");
             *      return;
             *
             *  }
             * }
             * catch (System.Exception e)
             * {
             *
             * }
             *
             *
             * if (student.jxdm != null && student.jxdm != info.DlrCode)
             * {
             *  SaveInfoCheckFail(info, name, "驾校学员只能通过相关驾校帮您预约!");
             *  return;
             *
             * }
             * */


            //ArrayList daylimits = SimpleOrmOperator.QueryConditionList<YuyueDayLimit>(" where c_cartype like '%" + student.zkcx + "%' and i_km=" + km);
            ArrayList     daylimits = SimpleOrmOperator.QueryConditionList <YuyueDayLimit>(" where c_cartype like '%" + "C1" + "%' and i_km=" + km);
            TempKscjInfo  kscj      = DrvQueryHelper.QueryKscj(glbm, idcard);
            YuyueDayLimit daylimit  = null;
            if (daylimits != null && daylimits.Count > 0)
            {
                daylimit = daylimits[0] as YuyueDayLimit;
            }
            if (kscj != null)
            {
                if (km == 1)
                {
                    if (kscj.km1 == 1)
                    {
                        SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "的科目一已经合格!");
                        return;
                    }
                }
                else if (km == 2)
                {
                    if (kscj.km2yyrq != null)
                    {
                        if (kscj.km2 == 1)
                        {
                            SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "的科目二已经合格!");
                            return;
                        }
                        if (kscj.km2 == 2)
                        {
                            if (yyrq.CompareTo(DateTime.Parse(kscj.km2yyrq).AddDays(bkjg)) < 0)
                            {
                                SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "上次考试时间为:" + kscj.km2yyrq + ",科目二补考必须在上一次考试" + bkjg + "天之后!");
                                return;
                            }
                        }
                    }
                    else if (kscj.km1 == 1 && daylimit != null)
                    {
                        if (yyrq.CompareTo(DateTime.Parse(kscj.km1yyrq).AddDays(daylimit.Days)) < 0)
                        {
                            SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "科目一考试时间为:" + kscj.km1yyrq + ",申请" + daylimit.CarType + "牌照的科目二考试必须在" + daylimit.Days + "天之后!");
                            return;
                        }
                    }
                    else
                    {
                        SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "科目一还没有合格!");
                        return;
                    }
                }

                else if (km == 3)
                {
                    if (kscj.km3yyrq != null)
                    {
                        if (kscj.km3 == 1)
                        {
                            SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "的科目三已经合格!");
                            return;
                        }
                        if (kscj.km3 == 2)
                        {
                            if (yyrq.CompareTo(DateTime.Parse(kscj.km3yyrq).AddDays(bkjg)) < 0)
                            {
                                SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "上次考试时间为:" + kscj.km2yyrq + ",科目三补考必须在上一次考试" + bkjg + "天之后!");
                                return;
                            }
                        }
                    }
                    else if (kscj.km2 == 1 && daylimit != null)
                    {
                        if (yyrq.CompareTo(DateTime.Parse(kscj.km1yyrq).AddDays(daylimit.Days)) < 0)
                        {
                            SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "科目一考试时间为:" + kscj.km1yyrq + ",申请" + daylimit.CarType + "牌照的科目三考试必须在" + daylimit.Days + "天之后!");
                            return;
                        }
                    }
                    else
                    {
                        SaveInfoCheckFail(info, name, "身份证明号码" + idcard + "科目二还没有合格!");
                        return;
                    }
                }
            }

            //&& info.Checked == 0
            if (info != null)
            {
                info.CheckOperator = name;
                info.Jbr           = name;
                TmriResponse resp = null;
                try
                {
                    string useold = System.Configuration.ConfigurationManager.AppSettings["Drv_Yuyue_Use_Old"];
                    if (useold == "true")
                    {
                        resp = new TmriResponse();
                        bool resultold = DriverInterface.WritePreasignOld(ConvertInfoToRequest(info));
                        // resultold ? 0 : 2;
                        if (resultold)
                        {
                            resp.Code    = 0;
                            resp.Message = "更新成功";
                        }
                        else
                        {
                            resp.Code    = 2;
                            resp.Message = "更新不成功";
                        }
                    }
                    else
                    {
                        resp = DriverInterface.WriteDrvBaseTmriRequest(ConvertInfoToRequest(info));
                    }
                    //resp= DriverInterface.yuyueInfo(info);
                }
                catch (Exception exe)
                {
                    SaveInfoCheckFail(info, name, exe.Message);
                    //info.CheckResult = exe.Message;
                    // SimpleOrmOperator.Update(info);
                    return;
                }
                if (resp.Code == 0 || resp.Code == 1)
                {
                    info.Checked     = 1;
                    info.CheckResult = resp.Message;
                    SimpleOrmOperator.Update(info);
                    if (!DataAccessFactory.GetDataAccess().ExecuteSql("update table_yuyue_limit set i_checked_num=i_checked_num+1 where i_checked_num<i_used_num and id=" + info.PaibanId))
                    {
                        DataAccessFactory.GetDataAccess().ExecuteSql("update table_yuyue_limit set i_tpchecked_num=i_tpchecked_num+1 where i_tpchecked_num<i_tpused_num and id=" + info.PaibanId);
                    }
                }
                else
                {
                    SaveInfoCheckFail(info, name, resp.Message);
                    //info.Checked = 2;
                    //info.CheckResult = resp.Message;
                    // SimpleOrmOperator.Update(info);
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }