コード例 #1
0
        public ShipmentSettingsViewModel()
        {
            localSql = new ShippingMethodDataAccess();

            bool result = localSql.IsShippingMethodTableExists();

            if (!result)
            {
                NotificationHelper.ShowMessage("ShippingMethod table not found", Utilities.GetResourceValue("CaptionError"));
                return;
            }

            Responses       = new ObservableRangeCollection <ShipmentSettingsModel>();
            Carriers        = new ObservableRangeCollection <IntegerComboBoxModel>();
            SearchCarriers  = new ObservableRangeCollection <IntegerComboBoxModel>();
            SearchModel     = new ShippingMethodSearchModel();
            ShippingMethods = new List <StringComboBoxModel>();

            BindData();

            AddNewShipmentCommand = new BaseCommand(AddNewShipmentRecord);
            SaveShipmentCommand   = new BaseCommand(SaveShipments);
            ClosePopupCommand     = new BaseCommand(ClosePopup);
            ViewRecordCommand     = new BaseCommand(ViewRecord);
            FindCommand           = new BaseCommand(FindRecords);
            ResetCommand          = new BaseCommand(Reset);
        }
コード例 #2
0
        public ShippingCarrierViewModel()
        {
            localSql = new ShippingMethodDataAccess();

            bool result = localSql.IsShippingCarrierTableExists();

            if (!result)
            {
                NotificationHelper.ShowMessage("ShippingCarrier table not found", Utilities.GetResourceValue("CaptionError"));
                return;
            }

            ClosePopupCommand    = new BaseCommand(ClosePopup);
            AddNewCarrierCommand = new BaseCommand(AddNewCarrierRecord);
            SaveCarrierCommand   = new BaseCommand(SaveCarrier);
            ViewRecordCommand    = new BaseCommand(ViewRecord);
            Records = new ObservableRangeCollection <ShippingCarrierModel>();

            BindData();
        }