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
        /// <summary>
        /// 执行SQL语句
        /// </summary>
        public void ExecSQL()
        {
            List <String>   sqls = new List <string>();
            List <Object[]> objs = new List <Object[]>();

            for (int i = 1; i < 1000; i++)
            {
                String cSQL  = StringEx.getString(request["SQL_" + i]);
                String cPARM = StringEx.getString(request["PARM_" + i]);
                if (!String.IsNullOrWhiteSpace(cSQL))
                {
                    sqls.Add(cSQL);
                    log4net.WriteLogFile("SQL--" + cSQL, LogType.DEBUG);
                    if (!String.IsNullOrWhiteSpace(cPARM))
                    {
                        Object[] parmList = JsonLib.ToObject <Object[]>(cPARM);
                        log4net.WriteLogFile("PARM--" + cPARM, LogType.DEBUG);
                        objs.Add(parmList);
                    }
                    else
                    {
                        objs.Add(null);
                    }
                }
                else
                {
                    break;
                }
            }
            ActiveResult vret  = ActiveResult.Valid(AppConfig.FAILURE);
            int          iCode = DbManager.ExecSQL(sqls, objs);

            vret = ActiveResult.Valid(iCode);
            response.Write(vret.toJSONString());
        }
        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"]);
            String       cALARM_FLAG  = StringEx.getString(request["ALARM_FLAG"]);
            String       cREC_ID      = StringEx.getString(request["REC_ID"]);
            String       Ccamera_name = StringEx.getString(request["CAMERA_NAME"]);
            String       CADDR        = StringEx.getString(request["ADDR"]);
            String       CX           = StringEx.getString(request["X"]);
            String       CY           = StringEx.getString(request["Y"]);
            String       ID           = (System.DateTime.Now).ToFileTime().ToString();

            if (!String.IsNullOrWhiteSpace(Ccamera_name) && !String.IsNullOrWhiteSpace(CADDR) && !String.IsNullOrWhiteSpace(CX) && !String.IsNullOrWhiteSpace(CY))
            {
                DbManager.ExecSQL(" update XT_IMG_REC SET ALARM_FLAG = '" + cALARM_FLAG + "' and ALARM_CHECKED =1 WHERE REC_ID = '" + cREC_ID + "'  ");
                int Code = DbManager.ExecSQL(" INSERT INTO XT_JB (ID,ADRESS,X,Y)VALUES('" + ID + "','" + CADDR + "','" + CX + "','" + CY + "') ");
                vret.total = Code;
            }
            else
            {
                int Code = DbManager.ExecSQL(" update XT_IMG_REC SET ALARM_FLAG = '" + cALARM_FLAG + "' and ALARM_CHECKED =1 WHERE REC_ID = '" + cREC_ID + "' ");
                vret.total = Code;
            }

            response.Write(vret.toJSONString());
        }
Beispiel #4
0
        public void query()
        {
            String       cORG_ID     = Config.GetAppSettings("ORG_ID");
            ActiveResult vret        = ActiveResult.Valid(AppConfig.FAILURE);
            String       cWhereParm  = " (ORG_ID ='" + cORG_ID + "') ";
            String       cSTART_DAY  = StringEx.getString(request["START_DAY"]);
            String       cFINISH_DAY = StringEx.getString(request["FINISH_DAY"]);

            if (!String.IsNullOrEmpty(cSTART_DAY))
            {
                cWhereParm = cWhereParm + " AND TIME>='" + cSTART_DAY + "'";
            }

            if (!String.IsNullOrEmpty(cFINISH_DAY))
            {
                cWhereParm = cWhereParm + " AND TIME<='" + cFINISH_DAY + "'";
            }
            String    cOrderBy   = "ORDER BY ID ASC";
            DBResult  dbret      = dao.QueryResult(cWhereParm, cOrderBy, iPageNo, iPageSize);
            DataTable dtRows     = dbret.dtrows;
            int       iRowsCount = dbret.ROW_COUNT;

            vret       = ActiveResult.Query(dtRows);
            vret.total = iRowsCount;

            response.Write(vret.toJSONString());
        }
Beispiel #5
0
        public void save()
        {
            ActiveResult vret        = ActiveResult.Valid(AppConfig.SUCCESS);
            String       cKeyID      = StringEx.getString(request["ID"]);
            String       cUser_Count = StringEx.getString(request["user_count"]);
            String       cORG_ID     = StringEx.getString(request["org_id"]);
            String       cAREA_ID    = StringEx.getString(request["AREA_ID"]);

            cAREA_ID = cAREA_ID.Replace("00", "");

            XT_MOBILE_USER vo = new XT_MOBILE_USER();

            vo = (XT_MOBILE_USER)RequestUtil.readFromRequest(request, vo);

            vo.user_count = vo.phone_num;
            if (String.IsNullOrEmpty(cORG_ID))
            {
                vret = ActiveResult.Valid("单位编码不能为空!");
            }
            else if (String.IsNullOrEmpty(vo.phone_num))
            {
                vret = ActiveResult.Valid("手机号码不能为空!");
            }

            if (vret.result == AppConfig.SUCCESS)
            {
                int iCode = dao.save(vo, cKeyID);
                vret = ActiveResult.Valid(iCode);
            }
            response.Write(vret.toJSONString());
        }
Beispiel #6
0
        /// <summary>
        /// 根据单位类型和上级模块,查询可管理模块。
        /// </summary>
        public void MENU()
        {
            ActiveResult vret     = new ActiveResult();
            String       cTYPE_ID = StringEx.getString(request["TYPE_ID"]);
            String       cORG_CLS = StringEx.getString(request["ORG_CLS"]);

            if (cTYPE_ID.Length == 0)
            {
                vret = ActiveResult.Valid("单位序号不能为空!");
            }
            else if (cORG_CLS.Length == 0)
            {
                vret = ActiveResult.Valid("单位类型不能为空!");
            }
            else
            {
                StringBuilder sql = new StringBuilder();
                sql.Append(" SELECT ITEM_ID,ITEM_NAME,EVENT,PARENTID,ALLOW_ORGS ");
                sql.Append(" FROM S_NODES ");
                sql.Append(" WHERE PARENTID='" + cTYPE_ID + "' and ALLOW_ORGS LIKE  '" + "%" + cORG_CLS + "%" + "'");

                DataTable dtRows = DbManager.QueryData(sql.ToString());
                vret = ActiveResult.Query(dtRows);
            }
            response.Write(vret.toJSONString());
        }
        public void save()
        {
            ActiveResult vret      = ActiveResult.Valid(AppConfig.FAILURE);
            String       cORG_ID   = StringEx.getString(request["ORG_ID"]);
            String       cKEYNAME  = StringEx.getString(request["KEYNAME"]);
            String       cKEYVALUE = StringEx.getString(request["KEYVALUE"]);

            if (String.IsNullOrEmpty(cORG_ID))
            {
                vret = ActiveResult.Valid("单位编码参数不能为空!");
            }
            else if (String.IsNullOrEmpty(cKEYNAME))
            {
                vret = ActiveResult.Valid("配置项目不能为空!");
            }
            else if (String.IsNullOrEmpty(cKEYVALUE))
            {
                vret = ActiveResult.Valid("配置值不能为空!");
            }
            else
            {
                StringBuilder sql = new StringBuilder();
                sql.Append(" UPDATE S_ORG_INF_CONFIG ");
                sql.Append(" SET KEYVALUE='" + cKEYVALUE + "'");
                sql.Append(" WHERE ORG_ID='" + cORG_ID + "'");
                sql.Append(" AND KEYNAME='" + cKEYNAME + "'");
                int iCode = DbManager.ExecSQL(sql.ToString());
                vret = ActiveResult.returnObject(iCode);
            }
            response.Write(vret.toJSONString());
        }
Beispiel #8
0
        public void report()
        {
            ActiveResult vret    = ActiveResult.Valid(AppConfig.FAILURE);
            String       cORG_ID = StringEx.getString(request["ORG_ID"]);

            if (String.IsNullOrEmpty(cORG_ID))
            {
                vret = ActiveResult.Valid("用户账号不能为空!");
            }
            else
            {
                String        cAreaID = AppManager.getAreaHeader(cORG_ID);
                StringBuilder sql     = new StringBuilder();
                sql.Append("  SELECT ORG_ID ");
                sql.Append("  , (SELECT ORG_NAME FROM S_ORG_INF X WHERE X.ORG_ID = T.ORG_ID) AS ORG_NAME ");
                sql.Append("  , COUNT(1) AS ALL_TASK ");
                sql.Append("  , (SELECT COUNT(1) FROM XT_TASK_LIST X WHERE X.ORG_ID = T.ORG_ID) AS LEFT_TASK ");
                sql.Append("  FROM XT_CAMERA T ");
                sql.Append("  WHERE ORG_ID like  '" + cAreaID + "%'");
                sql.Append("  GROUP BY ORG_ID ");
                DataTable dtRows = DbManager.QueryData(sql.ToString());
                vret = ActiveResult.Query(dtRows);
            }
            response.Write(vret.toJSONString());
        }
Beispiel #9
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            String cUrl = Config.GetAppSettings(AppConfig.WEB_URL) + "api/rest.ashx";
            Dictionary <String, String> vParmList = new Dictionary <string, string>();

            vParmList.Add("action_type", "WFJB");
            vParmList.Add("action_method", "GTWS");
            vParmList.Add("open_id", CameraID);
            //vParmList.Add("org_id", ApplicationEvent.UserInfo.ORG_ID);
            vParmList.Add("address", txtAddress.Text);
            vParmList.Add("content", txtContent.Text);
            String[] FileList = new string[1];
            FileList[0] = PHOTO_FILENAME;

            HttpUtil     vTool  = new HttpUtil();
            string       cValue = vTool.HttpPost(cUrl, vParmList, FileList);
            ActiveResult vret   = ActiveResult.Valid(AppConfig.FAILURE);

            if (!String.IsNullOrEmpty(cValue))
            {
                vret = JsonLib.ToObject <ActiveResult>(cValue);
            }

            if (vret.result == AppConfig.SUCCESS)
            {
                MessageBox.Show("数据保存成功!");
                this.Close();
            }
            else
            {
                MessageBox.Show("数据保存失败,稍后请重试!");
            }
        }
Beispiel #10
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());
        }
Beispiel #11
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       cAREA_ID = StringEx.getString(request["AREA_ID"]);

            cAREA_ID = cAREA_ID.Replace("00", "");

            XT_JB_SEND vo = new XT_JB_SEND();

            vo.createdatetime = DateTime.Now.ToString("yyyy-MM-dd");
            vo = (XT_JB_SEND)RequestUtil.readFromRequest(request, vo);

            if (String.IsNullOrEmpty(cORG_ID))
            {
                vret = ActiveResult.Valid("单位编码不能为空!");
            }
            else if (String.IsNullOrEmpty(vo.user_count))
            {
                vret = ActiveResult.Valid("用户账号不能为空!");
            }

            if (vret.result == AppConfig.SUCCESS)
            {
                int iCode = dao.save(vo, "");
                vret = ActiveResult.Valid(iCode);
            }
            response.Write(vret.toJSONString());
        }
Beispiel #12
0
        public void del_list()
        {
            ActiveResult vret   = new ActiveResult();
            String       cDBKey = StringEx.getString(request[DEL_LIST_KEY]);
            int          iCode  = dao.del_list(cDBKey);

            vret = ActiveResult.Valid(iCode);
            response.Write(vret.toJSONString());
        }
Beispiel #13
0
        public void execsql()
        {
            ActiveResult vret  = new ActiveResult();
            String       sql   = StringEx.getString(request["SQLTEXT"]);
            int          iCode = dao.execsql(sql);

            vret = ActiveResult.Valid(iCode);
            response.Write(vret.toJSONString());
        }
        public void check()
        {
            ActiveResult vret     = new ActiveResult();
            String       cKEY_ID  = StringEx.getString(request["RECEIVE_GUID"]);
            int          iTYPE_ID = StringEx.getInt(request["TYPE_ID"]);
            int          iCode    = dao.Check(cKEY_ID, iTYPE_ID);

            vret = ActiveResult.Valid(iCode);
            response.Write(vret.toJSONString());
        }
        public void del_item()
        {
            ActiveResult vret        = ActiveResult.Valid(AppConfig.FAILURE);
            String       cUSER_COUNT = StringEx.getString(request["dbkey"]);
            String       cREC_ID     = StringEx.getString(request["REC_ID"]);

            int Code = DbManager.ExecSQL(" delete XT_IMG_REC  WHERE REC_ID = '" + cREC_ID + "'");

            vret.total = Code;
            response.Write(vret.toJSONString());
        }
Beispiel #16
0
        public void updatefromvideo()
        {
            ActiveResult vret    = new ActiveResult();
            String       cORG_ID = StringEx.getString(request["ORG_ID"]);
            String       cIDS    = StringEx.getString(request["IDS"]);
            String       cNAMES  = StringEx.getString(request["NAMES"]);
            int          iCode   = dao.UpdateFromVideo(cORG_ID, cIDS, cNAMES);

            vret = ActiveResult.Valid(iCode);
            response.Write(vret.toJSONString());
        }
Beispiel #17
0
        public void saves()
        {
            ActiveResult vret   = new ActiveResult();
            XT_JB        vo     = new XT_JB();
            String       cKeyID = StringEx.getString(request[AppConfig.__DBKEY]);

            vo = (XT_JB)RequestUtil.readFromRequest(request, vo);
            int iCode = dao.save(vo, cKeyID);

            vret = ActiveResult.Valid(iCode);
            response.Write(vret.toJSONString());
        }
Beispiel #18
0
        public void village_list()
        {
            String       cORG_ID    = StringEx.getString(request["ORG_ID"]);
            String       cAreaID    = cORG_ID.Replace("00", "");
            ActiveResult vret       = ActiveResult.Valid(AppConfig.FAILURE);
            String       cWhereParm = " (ORG_ID like '" + cAreaID + "%') ";
            String       cOrderBy   = "ORDER BY ORG_ID ASC";
            DataTable    dtRows     = dao.QueryData("distinct VILLAGE AS ORG_ID,VILLAGE AS ORG_NAME", cWhereParm, cOrderBy);

            vret = ActiveResult.Query(dtRows);
            response.Write(vret.toJSONString());
        }
        public void find()
        {
            ActiveResult vret       = ActiveResult.Valid(AppConfig.FAILURE);
            String       cKeyID     = StringEx.getString(request["ID"]);
            String       cCAMERA_ID = StringEx.getString(request["REC_ID"]);

            DataTable dtInfo = DbManager.QueryData(" select * from xt_CAMERA where ID = '" + cCAMERA_ID + "'");

            vret = ActiveResult.Query(dtInfo);

            response.Write(vret.toJSONString());
        }
        public void save()
        {
            ActiveResult        vret   = new ActiveResult();
            String              cKeyID = StringEx.getString(request["ORG_ID"]);
            S_ORG_INF_WX_CONFIG vo     = new S_ORG_INF_WX_CONFIG();

            vo = (S_ORG_INF_WX_CONFIG)RequestUtil.readFromRequest(request, vo);
            int iCode = dao.save(vo, cKeyID);

            vret = ActiveResult.Valid(iCode);
            response.Write(vret.toJSONString());
        }
        public void find()
        {
            ActiveResult vret       = ActiveResult.Valid(AppConfig.FAILURE);
            String       cKeyID     = StringEx.getString(request["ID"]);
            String       cCAMERA_ID = StringEx.getString(request["REC_ID"]);
            String       cCamera_ID = DbManager.GetStrValue(" select CAMERA_ID from XT_IMG_REC where REC_ID = '" + cCAMERA_ID + "'");
            DataTable    dtInfo     = DbManager.QueryData(" SELECT * FROM XT_CAMERA WHERE DEVICE_ID = '" + cCamera_ID + "' ");

            vret = ActiveResult.Query(dtInfo);

            response.Write(vret.toJSONString());
        }
        public void query()
        {
            String cORG_ID = StringEx.getString(request["ORG_ID"]);

            InitOrgConfig(cORG_ID);

            ActiveResult vret   = ActiveResult.Valid(AppConfig.FAILURE);
            DataTable    dtRows = DbManager.QueryData("SELECT A.*,B.DEFVAL,KEYDESC,TYPE_ID FROM S_ORG_INF_CONFIG A,S_CONSTANT B WHERE A.KEYNAME=B.KEYNAME AND A.ORG_ID='" + cORG_ID + "'");

            vret = ActiveResult.Query(dtRows);
            response.Write(vret.toJSONString());
        }
Beispiel #23
0
        /// <summary>
        /// 保存反馈数据
        /// </summary>
        public void save()
        {
            ActiveResult   vret   = new ActiveResult();
            String         cKeyID = StringEx.getString(request[AppConfig.__DBKEY]);
            XT_JB_FEEDBACK vo     = new XT_JB_FEEDBACK();

            vo    = (XT_JB_FEEDBACK)RequestUtil.readFromRequest(request, vo);
            vo.id = AutoID.getAutoID();
            int iCode = dao.save(vo, "");

            vret = ActiveResult.Valid(iCode);
            response.Write(vret.toJSONString());
        }
Beispiel #24
0
        public void query()
        {
            String       cKeyGuid   = StringEx.getString(request["ID"]);
            ActiveResult vret       = ActiveResult.Valid(AppConfig.FAILURE);
            String       cWhereParm = " (JB_ID ='" + cKeyGuid + "') ";
            String       cOrderBy   = "ORDER BY ID ASC";
            DataTable    dtRows     = dao.Query(cWhereParm, cOrderBy);
            int          iRowsCount = dtRows.Rows.Count;

            vret       = ActiveResult.Query(dtRows);
            vret.total = iRowsCount;

            response.Write(vret.toJSONString());
        }
Beispiel #25
0
        /// <summary>
        ///
        /// </summary>
        public void export_query()
        {
            String       cORG_ID    = Config.GetAppSettings("ORG_ID");
            ActiveResult vret       = ActiveResult.Valid(AppConfig.FAILURE);
            String       cWhereParm = " (ORG_ID ='" + cORG_ID + "') AND (SD_RESULT=1) ";
            String       cOrderBy   = "ORDER BY ID ASC";
            DBResult     dbret      = dao.QueryResult(cWhereParm, cOrderBy, iPageNo, iPageSize);
            DataTable    dtRows     = dbret.dtrows;
            int          iRowsCount = dbret.ROW_COUNT;

            vret       = ActiveResult.Query(dtRows);
            vret.total = iRowsCount;

            response.Write(vret.toJSONString());
        }
Beispiel #26
0
        public void query()
        {
            String       cORG_ID    = StringEx.getString(request["ORG_ID"]);
            ActiveResult vret       = ActiveResult.Valid(AppConfig.FAILURE);
            String       cWhereParm = " (ORG_ID ='" + cORG_ID + "')  AND (JBTYPE='WEIXIN') ";
            String       cOrderBy   = "ORDER BY ID ASC";
            DBResult     dbret      = dao.Query(cWhereParm, cOrderBy, iPageNo, iPageSize);
            DataTable    dtRows     = dbret.dtrows;
            int          iRowsCount = dbret.ROW_COUNT;

            vret       = ActiveResult.Query(dtRows);
            vret.total = iRowsCount;

            response.Write(vret.toJSONString());
        }
Beispiel #27
0
        public void save()
        {
            ActiveResult vret    = new ActiveResult();
            String       cKeyID  = StringEx.getString(request[AppConfig.__DBKEY]);
            String       cORG_ID = StringEx.getString(request[AppConfig.ORG_ID]);
            XT_NOTICE    vo      = new XT_NOTICE();

            vo             = (XT_NOTICE)RequestUtil.readFromRequest(request, vo);
            vo.notice_date = vo.notice_date.Replace("-", "");
            vo.notice_id   = AutoID.getAutoID(cORG_ID);
            int iCode = dao.save(vo, cKeyID);

            vret = ActiveResult.Valid(iCode);
            response.Write(vret.toJSONString());
        }
Beispiel #28
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_JB vInfo = dao.FindOne(cKeyID);
                vret = ActiveResult.returnObject(vInfo);
            }
            response.Write(vret.toJSONString());
        }
Beispiel #29
0
        public void del_item()
        {
            ActiveResult vret    = ActiveResult.Valid(AppConfig.FAILURE);
            String       cORG_ID = StringEx.getString(request["ORG_ID"]);

            if (String.IsNullOrEmpty(cORG_ID))
            {
                vret = ActiveResult.Valid("单位编码参数不能为空!");
            }
            else
            {
                int iCode = dao.del_item(cORG_ID);
                vret = ActiveResult.Valid(iCode > 0);
            }
            response.Write(vret.toJSONString());
        }
        public void find()
        {
            ActiveResult vret    = ActiveResult.Valid(AppConfig.FAILURE);
            String       cKEY_ID = StringEx.getString(request["RECEIVE_GUID"]);

            if (String.IsNullOrEmpty(cKEY_ID))
            {
                vret = ActiveResult.Valid("错误,RECEIVE_GUID参数为空!");
            }
            else
            {
                XT_RECEIVE_SMS vInfo = dao.FindOne(cKEY_ID);
                vret = ActiveResult.returnObject(vInfo);
            }
            response.Write(vret.toJSONString());
        }