Beispiel #1
0
        public ActionResult Add([ModelBinder(typeof(DevExpressEditorsBinder))]  QueryModel queryModel)
        {
            queryModel._UserId = (int)Session["userId"];

            queryService = new QueryService();


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

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


            queryModel._FormMode = Models.FormModeEnum.New;

            return(PartialView(VIEW_FORM_PARTIAL, queryModel));
        }