Ejemplo n.º 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);
    }
Ejemplo n.º 2
0
    protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
    {
        //allowcheck
        int id = Convert.ToInt32(e.CommandArgument);
        StudentApplyInfoChecked infoCheck = SimpleOrmOperator.Query<StudentApplyInfoChecked>(id);
        if (e.CommandName == "Delete")
        {

            if (infoCheck != null && infoCheck.Checked == 1)
            {
                WebTools.Alert(this, "已审核过的数据无法删除!");
            }
            else
            {
                SimpleOrmOperator.Delete(infoCheck);
                WebTools.Alert(this, "删除成功!");
                this.ProcedurePager1.Changed = true;
            }
        }
        else if (e.CommandName == "Detail")
        {
            //int id = Convert.ToInt32(e.CommandArgument);
            //this.Pop(id);
            StudentApplyInfo sai = SimpleOrmOperator.Query<StudentApplyInfo>(id);
            if (sai == null) return ;
            if (StudentApplyInfoOperator.CheckInfo(sai, this.Operator.OperatorName))
            {
                WebTools.Alert(string.Format("{0}:{1} 审核成功", sai.Xm, sai.Sfzmhm));
            }
            else {
                WebTools.Alert(string.Format("{0}:{1} 审核失败", sai.Xm, sai.Sfzmhm));
            }

        }
    }
Ejemplo n.º 3
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);
    }