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;
    }
Exemple #2
0
        public static TmriResponse WriteDrvBaseTmriRequest(string xtlb, string jkxlh, string jkid, string xml)
        {
            log.Debug("预约写入接口的xtlb:" + xtlb);
            log.Debug("预约写入接口的jkxlh:" + jkxlh);
            log.Debug("预约写入接口的jkid:" + jkid);
            log.Debug("预约写入接口的文本为:" + xml);


            string responseText = "";

            try
            {
                responseText = GetNewService().writeObjectOut(xtlb, jkxlh, jkid, xml);
            }
            catch (Exception exe)
            {
                log.Info(exe);
                return(new TmriResponse());
            }
            log.Debug("调用写入接口返回的文本为:" + responseText);
            TmriResponse response = new TmriResponse();

            response.ParseFromXml(responseText);
            log.Debug("返回的结果code为:" + response.Code);
            return(response);
        }
Exemple #3
0
        public static TmriResponse WriteCarOwnerInfoChange(DrvCarOwnerInfoChangeRequest request)
        {
            log.Debug("预约写入接口的xtlb:" + request.GetXtlb());
            log.Debug("预约写入接口的jkxlh:" + request.GetJkxlh());
            log.Debug("预约写入接口的jkid:" + request.GetJkid());
            log.Debug("预约写入接口的文本为:" + request.ToXml());

            string responseText = "";

            try
            {
                responseText = GetNewService().writeObjectOut(request.GetXtlb(), request.GetJkxlh(), request.GetJkid(), request.ToXml());
            }
            catch (Exception exe)
            {
                log.Info(exe);
                TmriResponse err = new TmriResponse();
                err.Message = exe.Message;
                return(err);
            }
            log.Debug("调用写入接口返回的文本为:" + responseText);
            TmriResponse response = new TmriResponse();

            response.ParseFromXml(responseText);
            return(response);
        }
Exemple #4
0
        public static TmriResponse WriteDrvBaseTmriRequest(DrvBaseTmriRequest request)
        {
            log.Debug("预约写入接口的xtlb:" + request.GetXtlb());
            log.Debug("预约写入接口的jkxlh:" + request.GetJkxlh());
            log.Debug("预约写入接口的jkid:" + request.GetJkid());
            log.Debug("预约写入接口的文本为:" + request.ToXml());
            // TestLog.LogStep();
            TestLog.Log("预约写入接口的文本为:" + request.ToXml());

            string responseText = "";

            try
            {
                responseText = GetNewService().writeObjectOut(request.GetXtlb(), request.GetJkxlh(), request.GetJkid(), request.ToXml());
            }
            catch (Exception exe)
            {
                TestLog.Log("预约写入接口的返回为:" + exe.ToString());
                log.Info(exe);

                return(new TmriResponse());
            }
            log.Debug("调用写入接口" + request.GetXtlb() + ";" + request.GetJkxlh() + ";" + request.GetJkid() + ";" + request.ToXml() + "返回的文本为:" + responseText);
            TestLog.Log("调用写入接口" + request.GetXtlb() + ";" + request.GetJkxlh() + ";" + request.GetJkid() + ";" + request.ToXml() + "返回的文本为:" + responseText);
            TmriResponse response = new TmriResponse();

            response.ParseFromXml(responseText);
            log.Debug("返回的结果code为:" + response.Code);
            //TestLog.Log("返回的结果code为:" + response.Code);
            return(response);
        }
Exemple #5
0
        public static TmriResponse ReadStudentInfo(DrvStudentInfoRequest request)
        {
            string responseText = "";

            try
            {
                responseText = GetNewService().queryObjectOut(request.GetXtlb(), request.GetJkxlh(), request.GetJkid(), request.ToXml());
            }
            catch (Exception exe)
            {
                log.Info(exe);
                TmriResponse err = new TmriResponse();
                err.Message = exe.Message;
                return(err);
            }
            TmriResponse response = new TmriResponse();

            response.ParseFromXml(responseText);
            return(response);
        }
        public static TmriResponse WritePersonInfoChange(DrvPresonInfoChangeRequest request)
        {
            log.Debug("预约写入接口的xtlb:" + request.GetXtlb());
            log.Debug("预约写入接口的jkxlh:" + request.GetJkxlh());
            log.Debug("预约写入接口的jkid:" + request.GetJkid());
            log.Debug("预约写入接口的文本为:" + request.ToXml());

            string responseText = "";
            try
            {
                responseText = GetNewService().writeObjectOut(request.GetXtlb(), request.GetJkxlh(), request.GetJkid(), request.ToXml());
            }
            catch (Exception exe)
            {
                log.Info(exe);
                TmriResponse err = new TmriResponse();
                err.Message = exe.Message;
                return err;
            }
            log.Debug("调用写入接口返回的文本为:" + responseText);
            TmriResponse response = new TmriResponse();
            response.ParseFromXml(responseText);
            return response;
        }
        public static TmriResponse WriteDrvBaseTmriRequest(DrvBaseTmriRequest request)
        {
            log.Debug("预约写入接口的xtlb:" + request.GetXtlb());
            log.Debug("预约写入接口的jkxlh:" + request.GetJkxlh());
            log.Debug("预约写入接口的jkid:" + request.GetJkid());
            log.Debug("预约写入接口的文本为:" + request.ToXml());
               // TestLog.LogStep();
            TestLog.Log("预约写入接口的文本为:" + request.ToXml());

            string responseText = "";
            try
            {
                responseText = GetNewService().writeObjectOut(request.GetXtlb(), request.GetJkxlh(), request.GetJkid(), request.ToXml());
            }
            catch (Exception exe)
            {
                TestLog.Log("预约写入接口的返回为:" + exe.ToString());
                log.Info(exe);

                return new TmriResponse();
            }
            log.Debug("调用写入接口" + request.GetXtlb() + ";" + request.GetJkxlh() + ";" + request.GetJkid() + ";" + request.ToXml() + "返回的文本为:" + responseText);
            TestLog.Log("调用写入接口" + request.GetXtlb() + ";" + request.GetJkxlh() + ";" + request.GetJkid() + ";" + request.ToXml() + "返回的文本为:" + responseText);
            TmriResponse response = new TmriResponse();
            response.ParseFromXml(responseText);
            log.Debug("返回的结果code为:"+response.Code);
            //TestLog.Log("返回的结果code为:" + response.Code);
            return response;
        }
        public static TmriResponse WriteDrvBaseTmriRequest(string xtlb,string jkxlh,string jkid,string xml)
        {
            log.Debug("预约写入接口的xtlb:" + xtlb);
            log.Debug("预约写入接口的jkxlh:" + jkxlh);
            log.Debug("预约写入接口的jkid:" + jkid);
            log.Debug("预约写入接口的文本为:" + xml);

            string responseText = "";
            try
            {
                responseText = GetNewService().writeObjectOut(xtlb,jkxlh,jkid,xml);
            }
            catch (Exception exe)
            {
                log.Info(exe);
                return new TmriResponse();
            }
            log.Debug("调用写入接口返回的文本为:" + responseText);
            TmriResponse response = new TmriResponse();
            response.ParseFromXml(responseText);
            log.Debug("返回的结果code为:" + response.Code);
            return response;
        }
 public static TmriResponse ReadStudentInfo(DrvStudentInfoRequest request)
 {
     string responseText = "";
     try
     {
         responseText = GetNewService().queryObjectOut(request.GetXtlb(), request.GetJkxlh(), request.GetJkid(), request.ToXml());
     }
     catch (Exception exe)
     {
         log.Info(exe);
         TmriResponse err = new TmriResponse();
         err.Message = exe.Message;
         return err;
     }
     TmriResponse response = new TmriResponse();
     response.ParseFromXml(responseText);
     return response;
 }
    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;
        }
    }