コード例 #1
0
        public ActionResult AjaxForm()
        {
            var model = new Gallery_Video();

            if (DoAction == ActionType.Edit)
            {
                model = _da.GetById(ArrId.FirstOrDefault());
            }
            ViewBag.Action     = DoAction;
            ViewBag.CategoryID = _categoryApi.GetAll();
            ViewBag.lstsource  = _sourceApi.GetList();
            return(View(model));
        }
コード例 #2
0
        public ActionResult Lista()
        {
            try
            {
                CategoryAPI api   = new CategoryAPI();
                var         lista = api.GetAll(Util.Configuracao.PerfilSelecionadoLogado.Cliente.Id);

                return(View(lista));
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #3
0
        private void loadCategory(ProductViewModel model)
        {
            // Carrega categorias
            CategoryAPI categoryAPI = new CategoryAPI();
            var         lista       = categoryAPI.GetAll(Util.Configuracao.PerfilSelecionadoLogado.Cliente.Id);

            model.CategoryList =
                new SelectList(
                    lista
                    .Select
                    (
                        s => new ListItemModel()
            {
                Id   = s.Id,
                Text = s.Name.ToUpper()
            }
                    ), "Id", "Text", model.Id
                    );
        }
コード例 #4
0
 public ActionResult Index()
 {
     ViewBag.listCity = _cityApi.GetAll();
     ViewBag.lstcate  = _categoryApi.GetAll();
     return(View());
 }