コード例 #1
0
        public IHttpActionResult Post([FromBody] List <Models.PointModel.ObservedPoint> input)
        {
            IDbConnection db = HdbController.Connect(this.Request.Headers);

            var hdbProcessor = new HdbApi.App_Code.HdbCommands();

            foreach (Models.PointModel.ObservedPoint point in input)
            {
                if (point.loading_application_id < 1)
                {
                    point.loading_application_id = -99;
                }
                if (point.computation_id < 1)
                {
                    point.computation_id = -99;
                }
                if (point.data_flags == null)
                {
                    point.data_flags = "";
                }
                var result = hdbProcessor.modify_r_base_raw(db, point.site_datatype_id, point.interval, point.start_date_time, point.value, point.overwrite_flag, point.validation, point.do_update_y_or_n, point.loading_application_id, point.computation_id, point.data_flags);
            }

            try
            {
                db.Close();
                db.Dispose();
            }
            catch
            {
            }

            return(Ok(input));
        }
コード例 #2
0
ファイル: ApiCrudTests.cs プロジェクト: usbr/HdbApi
        public void SeriesRtableInsertEndPoint()
        {
            var hdbProcessor = new HdbApi.App_Code.HdbCommands();
            var result       = hdbProcessor.modify_r_base_raw(conx, Convert.ToInt16(testSDI), testInterval, testT, testVal, testBool, testFlag, testBool);//, testLoadingApplicationId);

            var seriesProcessor = new DataAccessLayer.SeriesRepository();
            var verification    = seriesProcessor.GetSeries(conx, testSDI, testInterval, testT, testT);

            Assert.AreEqual(testVal.ToString(), verification.data[0].value);
            hdbProcessor.delete_from_hdb(conx, Convert.ToInt16(testSDI), testT, testInterval);
        }