예제 #1
0
    public static bool CheckPhoto(StudentApplyInfo info)
    {
        bool result = false;
        StudentApplyInfoChecked checkInfo = SimpleOrmOperator.Query <StudentApplyInfoChecked>(info.Id);

        try
        {
            MemoryStream ms = new MemoryStream(GetPhoto(info.Sfzmhm));

            Image image = Image.FromStream(ms, true);

            // result = DriverInterface.WritePersonPhoto(info.Sfzmmc, info.Sfzmhm, image);
            string   zp  = ImageHelper.ImageToBase64Str(image);
            string[] res = DrvNewInterface.WritePhoto(info.Sfzmhm, zp);

            if (res.Length == 2)
            {
                checkInfo.PhotoSyn = 1;
                result             = true;
            }
            else if (res.Length == 3)
            {
                checkInfo.PhotoSyn    = 2;
                checkInfo.CheckResult = res[2];
            }
        }
        catch (System.Exception e)
        {
            result        = false;
            info.PhotoSyn = 2;
        }
        SimpleOrmOperator.Update(checkInfo);

        return(result);
    }
예제 #2
0
    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);
    }