Пример #1
0
        public OrderViewModel()
        {
            this.DisplayName = "Add/Edit Order";

            context = new LittleTravellerDataContext();
            var CanSave = this.Changed.Select(_ => ValidateFields()).StartWith(false);
            SaveCommand = new ReactiveCommand(CanSave);
            SaveCommand.Subscribe(_ => SaveOrder());
            NewOrderNumCommand = new ReactiveCommand();
            NewOrderNumCommand.Subscribe(_ => NewOrderNum());
            CloseTabCommand = new ReactiveCommand();
            CloseTabCommand.Subscribe(_ => TabClosing());
            SaveCommand.Subscribe(_ => SaveOrder());
            var CanAddItem = this.Changed.Select(_ => CanAddItemValidate()).StartWith(false);
            AddItemCommand = new ReactiveCommand(CanAddItem);
            AddItemCommand.Subscribe(_ => AddItem());
            DeleteItemCommand = new ReactiveCommand();
            DeleteItemCommand.OfType<ItemOptionsClass>().Subscribe(item => DeleteItem(item));

            CustomerOptions = (from cs in context.Customers select cs.CompanyName).ToList();
            SeasonOptions = context.Seasons.ToList();
            SizeTypeOptions = context.SizeTypes.ToList();
            ItemOptions = new ReactiveCollection<ItemOptionsClass>();
            _orderItems = new ObservableCollection<ItemOptionsClass>();
            AllSeasonsChecked = true;
            AllSizeTypesChecked = true;

            FillItemOptions();
        }
Пример #2
0
        public ItemViewModel(Item item)
        {
            if (item == null)
                throw new ArgumentNullException("item");

            context = new LittleTravellerDataContext();
            _season = "none";
        }
Пример #3
0
        public AddItem()
        {
            context = new LittleTravellerDataContext();
            Seasons = new List<string>();

            InitializeComponent();

            var sc = from n in context.Seasons select n.SeasonCode;
            Seasons = sc.ToList();
            Seasons.Add("moo");
               // seasonIDComBox.ItemsSource = Seasons;
            // set up first dropdown data
        }
        public CustomerViewModel()
        {
            context = new LittleTravellerDataContext();

            this.DisplayName = "Add/Edit Customer";
            Customers = context.Customers.ToList<Customer>();

            var CanSave = this.Changed.Select(_ => ValidateFields()).StartWith(false);
            SaveCommand = new ReactiveCommand(CanSave);
            SaveCommand.Subscribe(_ => SaveItem());
            ClearFieldsCommand = new ReactiveCommand();
            ClearFieldsCommand.Subscribe(_ => ClearFields());
            BillToStateOptions = context.states.ToList();
        }
Пример #5
0
        public ItemViewModel()
        {
            CanChangeSizeType = true;
            this.DisplayName = "Add/Edit Item";

            context = new LittleTravellerDataContext();
            var CanSave = this.Changed.Select(_ => ValidateFields()).StartWith(false);
            SaveCommand = new ReactiveCommand(CanSave);
            SaveCommand.Subscribe(_ => SaveItem());

            SeasonOptions = context.Seasons.ToList();
            ColorOptions1 = context.Colors.ToList();
            ColorOptions2 = context.Colors.ToList();
            ColorOptions3 = context.Colors.ToList();
            SizeTypeOptions = context.SizeTypes.ToList();
            SizeOptions = context.Sizes.ToList();
            DesignOptions = context.Designs.ToList();
            StyleTypeOptions = context.StyleTypes.ToList();
            SelectedSizeTypeID = SizeTypeOptions.First();
        }
 public AllCustomersViewModel()
 {
     context = new LittleTravellerDataContext();
      this.DisplayName = "View All Customers";
      FillItemsGrid();
 }
Пример #7
0
 public AllItemsViewModel()
 {
     context = new LittleTravellerDataContext();
 }
 public AllOrdersViewModel()
 {
     context = new LittleTravellerDataContext();
     this.DisplayName = "View All Orders";
     Orders = context.OrderViews.ToList<OrderView>();
 }
        //public AddItemViewModel(Item item)
        //{
        //    if (item == null)
        //        throw new ArgumentNullException("item");
        //    context = new LittleTravellerDataContext();
        //}
        public AddItemViewModel()
        {
            this.DisplayName = "Add New Item";

            context = new LittleTravellerDataContext();
        }
Пример #10
0
 public ItemViewModel()
 {
     context = new LittleTravellerDataContext();
     _season = "none";
 }