Esempio n. 1
0
 public ShippingBillDetailLogViewModel(int mainId)
 {
     _shippingService    = new ShippingBillService();
     _mainId             = mainId;
     ShippingBillDetails = new ObservableCollection <ShippingBillDetailLogModel>();
     Init();
 }
        public ConsignmentShippingViewModel()
        {
            _shippingService    = new ShippingBillService();
            _consignmentService = new ConsignmentBillService();
            _commonService      = new CommonService();

            userDataId = _commonService.GetUserDataId(user, 7);

            ConsignmentBills             = new ObservableCollection <ConsignmentBillModel>();
            SelectedConsignmentBillLists = new ObservableCollection <ConsignmentBillModel>();
            ConsignmentBillEntries       = new ObservableCollection <ConsignmentBillEntryModel>();
            ShippingBills             = new ObservableCollection <ShippingBillModel>();
            ShippingBillEntries       = new ObservableCollection <ShippingBillEntryModel>();
            SelectedShippingBillEntry = new ShippingBillEntryModel();
            Filter = new ConsignmentBillParameterModel()
            {
                ParamRestQuatity = 0,
                ParamBeginDate   = Convert.ToDateTime(System.DateTime.Now.AddDays(-7).ToShortDateString()),
                ParamEndDate     = Convert.ToDateTime(System.DateTime.Now.ToShortDateString()),
                ParamBillType    = 1
            };

            HostConfig = _commonService.GetHostConfig(4, _hostName, user.ID) ?? new HostConfigModel()
            {
                TypeId = 4, Host = _hostName, UserId = user.ID, TypeDesciption = "物流托运单"
            };
            BillTypes = _commonService.GetEnumLists(5).ToList();

            DataInit();
            //GetShippingBills();
            //InitQueryConSignmentBill();

            InitCommand();
            #region 命令属性
            QueryCommand = new DelegateCommand(QuerySignmentBill);

            #region 销售出库、调拨单主表
            ConsignmentBillSelectedAllCommand        = new DelegateCommand(SelectedAllConsignmentBill);
            ConsignmentBillUnSelectedAllCommand      = new DelegateCommand(UnSelectedAllConsignmentBill);
            ConsignmentBillSelectionChangedCommand   = new DelegateCommand(ChangeSelectedConsignmentBill);
            ConsignmentBillRemoveCommand             = new DelegateCommand(RemoveConsignmentBill);
            ConsignmentBillSyncCommand               = new DelegateCommand(SyncConsignmentBill);
            ConsignmentBillSelectedListsClearCommand = new DelegateCommand(ClearSelectedConsignmentBillLists);
            ConsignmentBillSelectedListsAddCommand   = new DelegateCommand(AddConsignmentBill);
            ConsignmentBillMergeCommand              = new DelegateCommand(MergeConsignmentBill);
            #endregion

            #region 销售出库、调拨单子表
            ConsignmentBillEntryCopyCommand             = new DelegateCommand(CopyConsignmentBillEntry);
            ConsignmentBillEntryDeleteCommand           = new DelegateCommand(DeleteConsignmentBillEntry);
            ConsignmentBillEntrySelectionChangedCommand = new DelegateCommand(ChangeSelectedConsignmentBillEntry);
            ConsignmentBillEntryCheckBoxCommand         = new DelegateCommand(ClickCheckBoxConsignmentBillEntry);
            ConsignmentBillEntryModifyCommand           = new DelegateCommand(ModifyConsignmentBillEntry);
            #endregion

            #region 托运单主表
            ShippingBillSelectionChangedCommand = new DelegateCommand(ShippingBillSelectionChanged);
            ShippingBillModifyCommand           = new DelegateCommand(ModifyShippingBill);
            ShippingBillDeleteCommand           = new DelegateCommand(DeleteShippingBill);
            //ShippingBillExportCommand = new DelegateCommand(ExportShippingData);
            ShippingBillDetailLogShowCommand = new DelegateCommand(ShowShippingBillDetailLog);
            ShippingBillCreateCommand        = new DelegateCommand(CreateShippingBill);
            #endregion

            #region 托运单子表
            ShippingBillEntryAddCommand              = new DelegateCommand(AddShippingBillEntry);
            ShippingBillEntryDeleteCommand           = new DelegateCommand(DeleteShippingBillEntry);
            ShippingBillEntryUpdateCommand           = new DelegateCommand(UpdateShippingBillEntry);
            ShippingBillEntrySelectionChangedCommand = new DelegateCommand(ShippingBillEntrySelectionChanged);
            #endregion

            #endregion
        }