You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.3 KiB
63 lines
2.3 KiB
2 years ago
|
using BBWY.Client.Models;
|
||
|
using BBWY.Common.Models;
|
||
|
using GalaSoft.MvvmLight.Command;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Collections.ObjectModel;
|
||
|
using System.Windows;
|
||
|
using System.Windows.Input;
|
||
|
|
||
|
namespace BBWY.Client.ViewModels
|
||
|
{
|
||
|
public class ServiceOrderViewModel : BaseVM, IDenpendency
|
||
|
{
|
||
|
private bool isLoading;
|
||
|
private ServiceOrderState? serviceOrderState;
|
||
|
private ReturnDirection? returnDirection;
|
||
|
private int serviceOrderCount;
|
||
|
private int pageIndex;
|
||
|
private int pageSize;
|
||
|
|
||
|
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } }
|
||
|
|
||
|
public ServiceOrderState? ServiceOrderState { get => serviceOrderState; set { Set(ref serviceOrderState, value); } }
|
||
|
|
||
|
public ReturnDirection? ReturnDirection { get => returnDirection; set { Set(ref returnDirection, value); } }
|
||
|
|
||
|
|
||
|
public ICommand SetServiceOrderStateCommand { get; set; }
|
||
|
public ICommand SetReturnDirectionCommand { get; set; }
|
||
|
public ICommand OnPageIndexChangedCommand { get; set; }
|
||
|
|
||
|
public ICommand CopyTextCommand { get; set; }
|
||
|
|
||
|
public IList<ServiceOrder> ServiceOrderList { get; set; }
|
||
|
|
||
|
public int ServiceOrderCount { get => serviceOrderCount; set { Set(ref serviceOrderCount, value); } }
|
||
|
|
||
|
public int PageIndex { get => pageIndex; set { Set(ref pageIndex, value); } }
|
||
|
|
||
|
public int PageSize { get => pageSize; set { Set(ref pageSize, value); } }
|
||
|
|
||
|
public ServiceOrderViewModel()
|
||
|
{
|
||
|
SetServiceOrderStateCommand = new RelayCommand<ServiceOrderState?>(SetServiceOrderState);
|
||
|
SetReturnDirectionCommand = new RelayCommand<ReturnDirection?>(SetReturnDirection);
|
||
|
CopyTextCommand = new RelayCommand<string>(s => { try { Clipboard.SetText(s); } catch (Exception ex) { } });
|
||
|
ServiceOrderList = new ObservableCollection<ServiceOrder>() { new ServiceOrder(), new ServiceOrder(), new ServiceOrder() };
|
||
|
}
|
||
|
|
||
|
private void SetServiceOrderState(ServiceOrderState? state)
|
||
|
{
|
||
|
this.ServiceOrderState = state;
|
||
|
//query
|
||
|
}
|
||
|
|
||
|
private void SetReturnDirection(ReturnDirection? returnDirection)
|
||
|
{
|
||
|
this.ReturnDirection = returnDirection;
|
||
|
//query
|
||
|
}
|
||
|
}
|
||
|
}
|