Beispiel #1
0
        public ActionResult Index()
        {
            using (FieldRepository field_repository = new FieldRepository())
            {
                ViewBag.items = field_repository.All();
            }

            return(View());
        }
Beispiel #2
0
        public static IcbcodeCollection <IcbcodeField> All()
        {
            IcbcodeCollection <IcbcodeField> items = new IcbcodeCollection <IcbcodeField>();

            using (FieldRepository field_repository = new FieldRepository())
            {
                List <dynamic> fields = field_repository.All();

                items.TotalPages  = items.Count;
                items.CurrentPage = 1;
                items.PageSize    = 1;

                for (int index = 0; index < fields.Count; index++)
                {
                    items.Add(IcbcodeField.Convert(fields[index], index + 1, fields.Count));
                }
            }

            return(items);
        }
        public ActionResult Edit(long?template_id)
        {
            using (ViewRepository view_repository = new ViewRepository())
            {
                ViewBag.views = view_repository.All(CurrentUser.user_domain);
            }

            using (FieldRepository field_repository = new FieldRepository())
            {
                ViewBag.fields = field_repository.All();
            }

            using (TemplateRepository template_repository = new TemplateRepository())
            {
                ViewBag.templates = template_repository.All(CurrentUser.user_domain);

                if (template_id.HasValue)
                {
                    ViewBag.item = template_repository.GetByID(template_id.Value);
                }
            }

            return(View());
        }