Пример #1
0
        public void save()
        {
            ActiveResult vret    = ActiveResult.Valid(AppConfig.SUCCESS);
            String       cKeyID  = StringEx.getString(request["ID"]);
            String       cORG_ID = StringEx.getString(request["org_id"]);
            String       cCLS_ID = StringEx.getString(request["cls_id"]);

            XT_NEWS vo = new XT_NEWS();

            vo             = (XT_NEWS)RequestUtil.readFromRequest(request, vo);
            vo.cls_id      = cCLS_ID;
            vo.update_time = StringEx.getString(DateUtils.getDayTimeNum());
            if (String.IsNullOrEmpty(cORG_ID))
            {
                vret = ActiveResult.Valid("单位编码不能为空!");
            }
            else if (String.IsNullOrEmpty(cCLS_ID))
            {
                vret = ActiveResult.Valid("类型不能为空!");
            }

            if (vret.result == AppConfig.SUCCESS)
            {
                int iCode = dao.save(vo, cKeyID);
                vret = ActiveResult.Valid(iCode);
            }
            response.Write(vret.toJSONString());
        }
Пример #2
0
        public void find()
        {
            ActiveResult vret   = ActiveResult.Valid(AppConfig.FAILURE);
            String       cKeyID = StringEx.getString(request["ID"]);

            if (String.IsNullOrEmpty(cKeyID))
            {
                vret = ActiveResult.Valid("用户账号不能为空!");
            }
            else
            {
                XT_NEWS vInfo = dao.FindOne(cKeyID);
                vret = ActiveResult.returnObject(vInfo);
            }
            response.Write(vret.toJSONString());
        }