Ejemplo n.º 1
0
        public ActionResult Add([ModelBinder(typeof(DevExpressEditorsBinder))]  QueryGroupModel queryGroupModel)
        {
            queryGroupModel._UserId = (int)Session["userId"];


            queryGroupService = new QueryGroupService();


            if (ModelState.IsValid)
            {
                queryGroupService.Add(queryGroupModel);
                queryGroupModel = queryGroupService.GetNewModel();
            }
            else
            {
                string message = GetErrorModel();

                throw new Exception(string.Format("[VALIDATION] {0}", message));
            }


            queryGroupModel._FormMode = Models.FormModeEnum.New;

            return(PartialView(VIEW_FORM_PARTIAL, queryGroupModel));
        }
Ejemplo n.º 2
0
        public ActionResult Delete(int Id = 0)
        {
            queryGroupService = new QueryGroupService();

            if (Id != 0)
            {
                queryGroupService = new QueryGroupService();
                queryGroupService.DeleteById((int)Session["userId"], Id);
            }

            QueryGroupModel queryGroupModel = new QueryGroupModel();

            return(PartialView(VIEW_FORM_PARTIAL, queryGroupModel));
        }
Ejemplo n.º 3
0
        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            RhinoApp.WriteLine("The {0} command is under construction.", EnglishName);

            if (null == form)
            {
                form         = new QueryBuilderForm();
                form.Closed += Form_Closed;
                form.Show();
            }


            // DEBUG
            var testQuery = new QueryGroupModel
            {
                Gate = LogicGate.And
            };

            var lhs = new NumberExpressionModel
            {
                Operator     = NumberOperator.Equal,
                PropertyName = "Area",
                Rhs          = 25.0
            };

            testQuery.Lhs = lhs;

            var nestedLhs = new TextExpressionModel
            {
                Operator     = TextOperator.Equals,
                PropertyName = "Name",
                Rhs          = "Test"
            };

            testQuery.Rhs = new QueryGroupModel {
                Lhs = nestedLhs
            };

            var result = ObjectTable.ExecuteQuery(doc, testQuery, ObjectModelType.Object);

            // TODO: Next step is to flesh out the QueryObjectTable and run queries against i


            return(Result.Success);
        }