Esempio n. 1
0
        private byte[] DeleteFeaturesOperHandler(NameValueCollection boundVariables,
                                                 JsonObject operationInput,
                                                 string outputFormat,
                                                 string requestProperties,
                                                 out string responseProperties)
        {
            responseProperties = null;

            JsonObject joConn;
            bool       found = operationInput.TryGetJsonObject("connectionString", out joConn);

            if (!found || joConn == null)
            {
                throw new ArgumentNullException("connectionString can not parse to jsonobject");
            }

            JsonObject joFC;

            found = operationInput.TryGetJsonObject("featureClass", out joFC);
            if (!found || joFC == null)
            {
                throw new ArgumentNullException("featureClass can not parse to jsonobject");
            }

            JsonObject joFilter;

            found = operationInput.TryGetJsonObject("filterWhere", out joFilter);
            if (!found || joFilter == null)
            {
                throw new ArgumentNullException("filterWhere can not parse to jsonobject");
            }

            JsonObject result = new JsonObject();

            ConnectionJSObject   connJsObj = ParamsParser.ParseConn(joConn);
            FeatureClassJSObject fcObj     = ParamsParser.ParseFeatrureClass(joFC);
            FilterWhereJSObject  filterObj = ParamsParser.ParseFilterWhere(joFilter);

            bool           isok   = false;
            int            count  = 0;
            string         outMsg = string.Empty;
            FeaturesHelper helper = new FeaturesHelper();

            isok = helper.DeleteFeatures(connJsObj, fcObj, filterObj, out count, out outMsg);
            result.AddBoolean("isSucess", isok);
            result.AddLong("recordCount", count);
            result.AddString("outMsg", outMsg);

            return(Encoding.UTF8.GetBytes(result.ToJson()));
        }