public void find()
        {
            XT_CAMERA_CONFIG_Dao camera_config_dao = new XT_CAMERA_CONFIG_Dao();
            ActiveResult         vret = ActiveResult.Valid(AppConfig.FAILURE);
            //String cORG_ID = StringEx.getString(request["DICT_ID"]);
            String cID = StringEx.getString(request["ID"]);



            XT_CAMERA        xt_camera     = CAMERADAO.FindOne(cID);
            String           deviceid      = xt_camera.device_id;
            XT_CAMERA_CONFIG camera_config = camera_config_dao.FindOne(deviceid);
            String           cDevice_ID    = camera_config.device_id;

            if (String.IsNullOrEmpty(cDevice_ID))
            {
                DbManager.ExecSQL(" INSERT INTO XT_CAMERA_CONFIG SET DICT_ID = '" + deviceid + "'");
            }
            else
            {
                XT_CAMERA_CONFIG vInfo = camera_config_dao.FindOne(cDevice_ID);
                vret = ActiveResult.returnObject(vInfo);
            }

            response.Write(vret.toJSONString());
        }
Beispiel #2
0
        public void find()
        {
            ActiveResult vret = new ActiveResult();
            // String cKeyID = StringEx.getString(request["ID"]);
            String    cKeyID = StringEx.getString(request["ID"]);
            XT_CAMERA vo     = dao.FindOne(cKeyID);

            vret = ActiveResult.returnObject(vo);
            response.Write(vret.toJSONString());
        }
        public void save()
        {
            ActiveResult vret    = ActiveResult.Valid(AppConfig.SUCCESS);
            String       cKeyID  = StringEx.getString(request["ID"]);
            String       cREC_ID = StringEx.getString(request["REC_ID"]);

            if (String.IsNullOrWhiteSpace(cREC_ID))
            {
                vret = ActiveResult.Valid("参数传递错误!");
            }
            else
            {
                String        cDeviceID = DbManager.GetStrValue("SELECT CAMERA_ID FROM XT_IMG_REC WHERE REC_ID='" + cREC_ID + "'");
                XT_CAMERA_Dao dao       = new XT_CAMERA_Dao();
                XT_CAMERA     mv        = dao.FindItem(cDeviceID);

                String cAddress = mv.addr;
                String CX       = StringEx.getString(mv.x);
                String CY       = StringEx.getString(mv.y);
                String ID       = AutoID.getAutoID();

                List <String> sqls = new List <string>();
                sqls.Add("  update XT_IMG_REC SET ALARM_CHECKED =1 WHERE REC_ID = '" + cREC_ID + "' ");
                JActiveTable aTable = new JActiveTable();
                aTable.TableName = "XT_JB";
                aTable.AddField("ID", ID);
                aTable.AddField("ADRESS", cAddress);
                aTable.AddField("X", CX);
                aTable.AddField("Y", CY);
                sqls.Add(aTable.getInsertSQL());

                int iCode = DbManager.ExecSQL(sqls);
                vret = ActiveResult.Valid(iCode);
            }

            response.Write(vret.toJSONString());
        }