コード例 #1
0
        /// <summary>
        /// Initializes the view model.
        /// </summary>
        public void Init(InventoriesRepository inventoriesRepository,
                         UnitsRepository unitsRepository)
        {
            InventoriesSelectListItems = new SelectList(
                inventoriesRepository.GetAll(),
                "ProductCode", "ProductCode");

            UnitsSelectListItems = new SelectList(
                unitsRepository.GetList(), "Id", "Name");
        }
コード例 #2
0
        public ActionResult Index()
        {
            IList <Unit> units = _unitsRepository.GetList();

            var viewModel = new UnitsBaseViewModel()
            {
                Units = units
            };

            return(View(viewModel));
        }
コード例 #3
0
 /// <summary>
 /// Initializes the view model.
 /// </summary>
 public void Init(ProductTypesRepository productTypesRepository,
                  SuppliersRepository suppliersRepository,
                  UnitsRepository unitsRepository,
                  string userId)
 {
     ProductTypesSelectListItems = new SelectList(
         productTypesRepository.GetList(),
         "Id", "Name");
     SuppliersSelectListItems = new SelectList(
         suppliersRepository.GetList(),
         "Id", "Name");
     UnitsSelectListItems = new SelectList(
         unitsRepository.GetList(),
         "Id", "Name", "Quantity");
 }
コード例 #4
0
 /// <summary>
 /// Initializes the view model.
 /// </summary>
 public void Init(UnitsRepository unitsRepository)
 {
     UnitsSelectListItems = new SelectList(
         unitsRepository.GetList(),
         "Id", "Name", "Quantity");
 }