public DataApi() { var dbContext = new InterviewQContext(); Tests = new TestRepository(dbContext); Questions = new QuestionRepository(dbContext); DifficultyLevels = new DifficultyLevelRepository(dbContext); Catagories = new CatagoryRepository(dbContext); }
public CreateKindViewModel() { catagoryRepository = new CatagoryRepository(); KindRepository = new KindRepository(); addCommand = new RelayCommand(Add); catagorys = catagoryRepository.Get().Select(a => new ComboBoxItem { Text = a.Name, Value = a.Id }).ToList(); }
public HomeViewModel() { catagoryRepository = new CatagoryRepository(); ordersRepository = new OrdersRepository(); Catagorys = new ObservableCollection <Catagory>(catagoryRepository.Get(includeProperties: "Kinds.Orders")); Refresh = new RelayCommand(RefreshAction); DateTimeChange += ResetOrdersandTotalprice; DateTimeChange(DateTime.Now); }
public EditKindViewModel(Kind selectKind) { SelectKind = selectKind; catagoryRepository = new CatagoryRepository(); repository = new KindRepository(); SaveCommand = new RelayCommand(UpdateKind); ComboBoxItem = new ComboBoxItem { Text = SelectKind.Name, Value = SelectKind.CatagoryId }; catagorys = catagoryRepository.Get().Select(a => new ComboBoxItem { Text = a.Name, Value = a.Id }).ToList(); }
public OrderViewModel() { catagoryRepository = new CatagoryRepository(); kindRepository = new KindRepository(); OrdersRepository = new OrdersRepository(); Catagorys = catagoryRepository.Get().Select(a => new ComboBoxItem { Text = a.Name, Value = a.Id }).ToList(); RemoveOrder = new RelayCommand(RemoveOrderAciton); AddToCurrentOrderCommand = new RelayCommand(AddToCurrentOrders); SaveOrders = new RelayCommand(SaveorderAciton); EmptyFieldsCommand = new RelayCommand(EmptyFieldsAction); }
public ListCatagoryViewModel() { catagoryRepository = new CatagoryRepository(); DeleteCommand = new RelayCommand <Catagory>(DeleteCatagory); EditCommand = new RelayCommand <Catagory>(EditCatagory); }
public CreateCatagoryViewModel() { catagoryRepository = new CatagoryRepository(); addCommand = new RelayCommand(Add); }
public EditCatagoryViewModel() { repository = new CatagoryRepository(); SaveCommand = new RelayCommand(UpdateCatagory); }
public DeleteCatagoryViewModel() { catagoryRepository = new CatagoryRepository(); DeleteCommand = new RelayCommand <int>(DeleteCatagory); }