示例#1
0
 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();
 }
示例#3
0
        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);
        }
示例#4
0
 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();
 }
示例#5
0
 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);
 }
示例#6
0
 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);
 }
示例#9
0
 public DeleteCatagoryViewModel()
 {
     catagoryRepository = new CatagoryRepository();
     DeleteCommand      = new RelayCommand <int>(DeleteCatagory);
 }