예제 #1
0
        public void GetListOperationNoErrorWithNegativeInputTest(string db, string provider)
        {
            CreateOnixDbContext(db, provider);
            ArrayList arr = CreateMultipleItems <CompanyProfile>(db, provider, param, 100, "TESTING");

            QueryRequestParam qrp = new QueryRequestParam();

            qrp.ByChunk  = true;
            qrp.PageSize = 9000;

            qrp.AddFilter("Code", "RUNKNOWN_OPERATOR", "N0");
            qrp.AddFilter("UnknownField", "CONTAIN", "ABC");

            qrp.AddOrderBy("UnknownField", "DESC");
            qrp.AddOrderBy("Code", "DESC");
            qrp.AddOrderBy("Name", "DESC");

            try
            {
                QueryResponseParam response = GetListOperationWithParameter <CompanyProfile>(db, provider, param, qrp);
            }
            catch
            {
                Assert.Fail("Exception should not thrown here!!!");
            }
        }
예제 #2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            QueryRequestParam qrp = new QueryRequestParam();
            var opr  = GetOperationObject("GetCompanyProfileList");
            var resp = opr.Apply <MCompanyProfile>(qrp);

            txtOutput.Text = resp.ToJSON();
        }
예제 #3
0
        public void GetListOperationAllItemsTest(string db, string provider, int count)
        {
            CreateOnixDbContext(db, provider);
            ArrayList arr = CreateMultipleItems <CompanyProfile>(db, provider, param, count, "TESTING");

            QueryRequestParam  qrp      = new QueryRequestParam();
            QueryResponseParam response = GetListOperationWithParameter <CompanyProfile>(db, provider, param, qrp);

            Assert.AreEqual(count, response.Results.Count, "Item count should return as expected!!!");
        }
        public virtual JsonResult Get()
        {
            var opr = (GetListOperation)FactoryBusinessOperation.CreateBusinessOperationObject(ApiName);

            var qrp      = new QueryRequestParam();
            var response = opr.Apply(qrp);

            var result = new JsonResult(response);

            return(result);
        }
예제 #5
0
        public void GetListOperationWithParameter(string db, string provider)
        {
            CreateOnixDbContext(db, provider);

            QueryRequestParam qrp = new QueryRequestParam();

            qrp.AddFilter("Code", "EQUAL", "N0");
            qrp.AddFilter("Name", "CONTAIN", "ABC");
            qrp.AddFilter("CompanyProfileId", "=", "1000");
            qrp.AddFilter("CompanyProfileId", "IS_NULL", "N");
            qrp.AddFilter("Key", "IS_NULL", "Y");

            qrp.AddOrderBy("Type", "DESC");
            qrp.AddOrderBy("Code", "ASC");
            QueryResponseParam response = GetListOperationWithParameter <CompanyProfile>(db, provider, param, qrp);

            //Assert.AreEqual(true, checkOk, "Unexpected return value from GetCompanyProfileList()!!!");
        }
        //Use POST method with the Get* operations with parameters to prevent the issue when deploy to Google Cloud Run
        //This is an example of issue - HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
        public virtual JsonResult GetWithParam([FromForm] FormSubmitParam prm = null)
        {
            object response = null;

            string content = "";

            if ((prm != null) && (!String.IsNullOrEmpty(prm.JsonContent)))
            {
                content = prm.JsonContent;
            }

            var opr = FactoryBusinessOperation.CreateBusinessOperationObject(ApiName);

            var qrp = new QueryRequestParam();

            qrp      = JsonConvert.DeserializeObject <QueryRequestParam>(content);
            response = (opr as GetListOperation).Apply(qrp);

            var result = new JsonResult(response);

            return(result);
        }
예제 #7
0
        public JsonResult QuerySpecialSpellNames(QueryRequestParam param)
        {
            JsonData json = new JsonData();

            return(Json(json));
        }