//OrderViewModel _orderViewModel;
        // GET: Order
        public ActionResult Index()
        {
            var _orderViewModel = new OrderViewModel();

            _orderViewModel.PaymentTypes = _paymentTypeRepository.GetAll();
            return(View(_orderViewModel));
        }
Esempio n. 2
0
 public ActionResult Index()
 {
     try
     {
         var list = repository.GetAll();
         return(View(list));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 3
0
        // GET: Invoicing/Invoices/Create
        public ActionResult Create()
        {
            // Crea dropdwon de clientes
            var customers = personRepository.GetCustomers();
            List <SelectListItem> customersList = new List <SelectListItem>();

            foreach (var c in customers)
            {
                customersList.Add(new SelectListItem {
                    Value = c.IdentificationNumber, Text = $"{c.FirstName} {c.SurName}"
                });
            }
            ViewBag.Customer = new SelectList(customersList, "Value", "Text");

            // Crea dropdwon de clientes
            var sellers = personRepository.GetCustomers();
            List <SelectListItem> sellersList = new List <SelectListItem>();

            foreach (var c in customers)
            {
                sellersList.Add(new SelectListItem {
                    Value = c.IdentificationNumber, Text = $"{c.FirstName} {c.SurName}"
                });
            }
            ViewBag.Seller = new SelectList(sellersList, "Value", "Text");

            // Crea dropdown de formas de pago
            var paymentTypes = paymentTypeRepository.GetAll();
            List <SelectListItem> paymentTypesList = new List <SelectListItem>();

            foreach (var pt in paymentTypes)
            {
                paymentTypesList.Add(new SelectListItem {
                    Value = pt.Code, Text = pt.Name
                });
            }
            ViewBag.PaymentType = new SelectList(paymentTypesList, "Value", "Text");

            // Crea dropdown de productos
            var products = productRepository.GetAll();
            List <SelectListItem> productsList = new List <SelectListItem>();

            foreach (var p in products)
            {
                productsList.Add(new SelectListItem {
                    Value = p.Code, Text = p.Name
                });
            }
            ViewBag.Product = new SelectList(productsList, "Value", "Text");

            return(View());
        }
        public ActionResult GetAllPayments()
        {
            var allPayments = _paymentRepository.GetAll();

            return(Ok(allPayments));
        }
        // GET: Home
        public ActionResult Index()
        {
            var allMultipleObject = new Tuple <IEnumerable <SelectListItem>, IEnumerable <ItemViewModel>, IEnumerable <SelectListItem> >
                                    //var allMultipleObject = new Tuple<IEnumerable<CustomerViewModel>, IEnumerable<ItemViewModel>, IEnumerable<PaymentTypeViewModel>>
                                        (_customerReposistory.GetAll(), _itemRepository.GetAll(), _paymentTypeRepository.GetAll());

            return(View(allMultipleObject));
        }
Esempio n. 6
0
 public IEnumerable <PaymentType> GetAll()
 {
     return(_repository.GetAll());
 }
        public IActionResult GetAllPaymentTypes()
        {
            var allPaymentTypes = _repo.GetAll();

            return(Ok(allPaymentTypes));
        }