Ejemplo n.º 1
0
        public ActionResult DetailPartial(int Id = 0)
        {
            QueryGroupModel queryGroupModel;

            queryGroupService = new QueryGroupService();

            if (Id == 0)
            {
                queryGroupModel           = queryGroupService.GetNewModel();
                queryGroupModel._FormMode = FormModeEnum.New;
            }
            else
            {
                queryGroupModel = queryGroupService.GetById(Id);
                if (queryGroupModel != null)
                {
                    queryGroupModel._FormMode = FormModeEnum.Edit;
                }
                else
                {
                    throw new Exception("[VALIDATION]-Data not exists");
                }
            }

            return(PartialView(VIEW_FORM_PARTIAL, queryGroupModel));
        }
Ejemplo n.º 2
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.º 3
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));
        }
        public ActionResult NavLast()
        {
            QueryGroupModel queryGroupModel;

            queryGroupService = new QueryGroupService();

            queryGroupModel = queryGroupService.NavLast();
            if (queryGroupModel != null)
            {
                queryGroupModel._FormMode = FormModeEnum.Edit;
            }

            if (queryGroupModel == null)
            {
                //queryGroupModel = queryGroupService.GetNewModel();
                throw new Exception("[VALIDATION]-Data not exists");
            }

            return(PartialView(VIEW_FORM_PARTIAL, queryGroupModel));
        }