Beispiel #1
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingName      = this.textexName.DataBindings.Add("Text", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.Name), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks   = this.textexRemarks.DataBindings.Add("Text", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingBookable  = this.checkBookable.DataBindings.Add("Checked", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.Bookable), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingIssuable  = this.checkIssuable.DataBindings.Add("Checked", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.Issuable), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingIsDefault = this.checkIsDefault.DataBindings.Add("Checked", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.IsDefault), true, DataSourceUpdateMode.OnPropertyChanged);

            LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());

            this.combexLocationID.DataSource    = locationAPIs.GetLocationBases(true);
            this.combexLocationID.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Name);
            this.combexLocationID.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);
            this.bindingLocationID = this.combexLocationID.DataBindings.Add("SelectedValue", this.teamViewModel, CommonExpressions.PropertyName <WarehouseDTO>(p => p.LocationID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingName.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingBookable.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingIssuable.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingIsDefault.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingLocationID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.fastWarehouseIndex.AboutToCreateGroups += fastWarehouseIndex_AboutToCreateGroups;
            this.fastWarehouseIndex.ShowGroups           = true;
        }
Beispiel #2
0
        private void WizardMaster_Load(object sender, EventArgs e)
        {
            try
            {
                this.forecastViewModel.PropertyChanged += forecastDetailDTO_PropertyChanged;

                LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());
                this.combexForecastLocationID.DataSource    = locationAPIs.GetLocationBases();
                this.combexForecastLocationID.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Name);
                this.combexForecastLocationID.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);
                this.bindingForecastLocationID = this.combexForecastLocationID.DataBindings.Add("SelectedValue", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.ForecastLocationID), true, DataSourceUpdateMode.OnPropertyChanged);


                this.bindingEntryDate   = this.dateTimexEntryDate.DataBindings.Add("Value", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingVoucherCode = this.textexVoucherCode.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingDescription = this.textexDescription.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingRemarks     = this.textexRemarks.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingForecastLocationID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.bindingEntryDate.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingVoucherCode.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingDescription.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingRemarks.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.buttonOK.Enabled = this.forecastViewModel.IsValid;
                this.errorProviderMaster.DataSource = this.forecastViewModel;
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Beispiel #3
0
        public UserOUs(OrganizationalUnitAPIs organizationalUnitAPIs, bool addOU)
        {
            InitializeComponent();

            try
            {
                this.organizationalUnitRepository = CommonNinject.Kernel.Get <IOrganizationalUnitRepository>();

                LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());
                this.combexNewLocationID.DataSource    = locationAPIs.GetLocationBases();
                this.combexNewLocationID.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Name);
                this.combexNewLocationID.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);
                this.bindingNewLocationID = this.combexNewLocationID.DataBindings.Add("SelectedValue", this, "NewLocationID", true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingNewLocationID.BindingComplete += binding_BindingComplete;

                this.organizationalUnitAPIs = organizationalUnitAPIs;
                this.combexOrganizationalUnitID.DataSource    = this.organizationalUnitAPIs.GetOrganizationalUnitIndexes();
                this.combexOrganizationalUnitID.DisplayMember = CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.LocationOrganizationalUnitName);
                this.combexOrganizationalUnitID.ValueMember   = CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.OrganizationalUnitID);
                this.bindingOrganizationalUnitID = this.combexOrganizationalUnitID.DataBindings.Add("SelectedValue", this, CommonExpressions.PropertyName <OrganizationalUnitIndex>(p => p.OrganizationalUnitID), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingOrganizationalUnitID.BindingComplete += binding_BindingComplete;
                this.textexNewOrganizationalUnitID.TextChanged   += textexNewOrganizationalUnitID_TextChanged;

                this.addOU = addOU;
                this.labelOrganizationalUnitID.Visible    = !this.addOU; this.combexOrganizationalUnitID.Visible = !this.addOU;
                this.labelNewOrganizationalUnitID.Visible = this.addOU; this.textexNewOrganizationalUnitID.Visible = this.addOU;
                this.labelNewLocationID.Visible           = this.addOU; this.combexNewLocationID.Visible = this.addOU;
                this.Text          = this.addOU ? "Add new organizational unit" : "Remove OU";
                this.buttonOK.Text = this.addOU ? "Add" : "Remove";
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Beispiel #4
0
        protected override void InitializeDataGridBinding()
        {
            base.InitializeDataGridBinding();
            this.InitializeDataGridReadonlyColumns(this.gridexViewDetails);

            this.gridexViewDetails.AutoGenerateColumns = false;
            this.gridexViewDetails.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

            this.bindingSourceViewDetails.DataSource = this.commoditySettingViewModel.ViewDetails;
            this.gridexViewDetails.DataSource        = this.bindingSourceViewDetails;

            this.bindingSourceViewDetails.AddingNew      += bindingSourceViewDetails_AddingNew;
            this.gridexViewDetails.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(this.dataGridViewDetails_EditingControlShowing);
            this.gridexViewDetails.ReadOnlyChanged       += new System.EventHandler(this.dataGrid_ReadOnlyChanged);

            DataGridViewComboBoxColumn comboBoxColumn;
            LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());

            comboBoxColumn               = (DataGridViewComboBoxColumn)this.gridexViewDetails.Columns[CommonExpressions.PropertyName <CommoditySettingDetailDTO>(p => p.SettingLocationID)];
            comboBoxColumn.DataSource    = locationAPIs.GetLocationBases(true);
            comboBoxColumn.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Code);
            comboBoxColumn.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);

            StackedHeaderDecorator stackedHeaderDecorator = new StackedHeaderDecorator(this.gridexViewDetails);
        }
Beispiel #5
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingEntryDate   = this.dateTimexEntryDate.DataBindings.Add("Value", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingReference   = this.textexReference.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.Reference), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVoucherCode = this.textexVoucherCode.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDescription = this.textexDescription.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks     = this.textexRemarks.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCaption     = this.labelCaption.DataBindings.Add("Text", this.forecastViewModel, CommonExpressions.PropertyName <ForecastDTO>(p => p.Caption));

            LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());

            this.combexForecastLocationID.DataSource    = locationAPIs.GetLocationBases();
            this.combexForecastLocationID.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Name);
            this.combexForecastLocationID.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);
            this.bindingForecastLocationID = this.combexForecastLocationID.DataBindings.Add("SelectedValue", this.forecastViewModel, CommonExpressions.PropertyName <ForecastViewModel>(p => p.ForecastLocationID), true, DataSourceUpdateMode.OnPropertyChanged);


            this.bindingEntryDate.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingReference.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVoucherCode.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDescription.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCaption.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingForecastLocationID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.fastForecastIndex.AboutToCreateGroups += fastForecastIndex_AboutToCreateGroups;

            this.fastForecastIndex.ShowGroups    = true;
            this.naviGroupDetails.ExpandedHeight = this.naviGroupDetails.Size.Height;
        }
Beispiel #6
0
        public LockedDates()
        {
            InitializeComponent();

            this.locationAPIRepository = CommonNinject.Kernel.Get <ILocationAPIRepository>();
            this.locationAPIs          = new LocationAPIs(this.locationAPIRepository);
            this.loadLocationIndexes();
        }
Beispiel #7
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            //JUST INIT THE local parameter only. DON'T INIT VIA: this.LocationID: BECAUSE IT WILL RAISE THE LocationID CHANGE EVENT
            this.locationID   = ContextAttributes.User.LocationID;
            this.onlyApproved = true; this.onlyIssuable = true;

            this.comboSummaryVersusDetail.ComboBox.Items.AddRange(new string[] { "Summary only", "Show detail" });
            this.comboSummaryVersusDetail.ComboBox.SelectedIndex = 0;

            LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());

            this.comboLocationID.ComboBox.DataSource    = locationAPIs.GetLocationBases();
            this.comboLocationID.ComboBox.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Name);
            this.comboLocationID.ComboBox.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);
            this.bindingLocationID = this.comboLocationID.ComboBox.DataBindings.Add("SelectedValue", this, "LocationID", true, DataSourceUpdateMode.OnPropertyChanged);

            this.comboOnlyIssuable.ComboBox.DataSource = new List <OptionBool>()
            {
                new OptionBool()
                {
                    OptionValue = true, OptionDescription = "Issuable Only"
                }, new OptionBool()
                {
                    OptionValue = false, OptionDescription = "Include Hold Items"
                }
            };
            this.comboOnlyIssuable.ComboBox.DisplayMember = CommonExpressions.PropertyName <OptionBool>(p => p.OptionDescription);
            this.comboOnlyIssuable.ComboBox.ValueMember   = CommonExpressions.PropertyName <OptionBool>(p => p.OptionValue);
            this.bindingOnlyIssuable = this.comboOnlyIssuable.ComboBox.DataBindings.Add("SelectedValue", this, "OnlyIssuable", true, DataSourceUpdateMode.OnPropertyChanged);

            this.comboOnlyApproved.ComboBox.DataSource = new List <OptionBool>()
            {
                new OptionBool()
                {
                    OptionValue = true, OptionDescription = "Verified Only"
                }, new OptionBool()
                {
                    OptionValue = false, OptionDescription = "Incclude not Verified Items"
                }
            };
            this.comboOnlyApproved.ComboBox.DisplayMember = CommonExpressions.PropertyName <OptionBool>(p => p.OptionDescription);
            this.comboOnlyApproved.ComboBox.ValueMember   = CommonExpressions.PropertyName <OptionBool>(p => p.OptionValue);
            this.bindingOnlyApproved = this.comboOnlyApproved.ComboBox.DataBindings.Add("SelectedValue", this, "OnlyApproved", true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingLocationID.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingOnlyIssuable.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingOnlyApproved.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.fastAvailablePallets.AboutToCreateGroups += fastAvailableItems_AboutToCreateGroups;
            this.fastAvailableCartons.AboutToCreateGroups += fastAvailableItems_AboutToCreateGroups;
            this.fastAvailablePallets.ShowGroups           = true;
            this.fastAvailableCartons.ShowGroups           = true;
        }
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.LocationID = ContextAttributes.User.LocationID;
            LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());

            this.comboLocationID.ComboBox.DataSource    = locationAPIs.GetLocationBases();
            this.comboLocationID.ComboBox.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Name);
            this.comboLocationID.ComboBox.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);
            this.bindingLocationID = this.comboLocationID.ComboBox.DataBindings.Add("SelectedValue", this, "LocationID", true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingLocationID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.fastAvailablePallets.AboutToCreateGroups += fastAvailableItems_AboutToCreateGroups;
            this.fastAvailableCartons.AboutToCreateGroups += fastAvailableItems_AboutToCreateGroups;
            this.fastAvailablePallets.ShowGroups           = true;
            this.fastAvailableCartons.ShowGroups           = true;
            this.fastAvailablePallets.Sort(this.olvPalletCommodityCode);
            this.fastAvailableCartons.Sort(this.olvCartonCommodityCode);
        }
Beispiel #9
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.locationID = ContextAttributes.User.LocationID; //JUST INIT THE local parameter only. DON'T INIT VIA: this.LocationID: BECAUSE IT WILL RAISE THE LocationID CHANGE EVENT
            LocationAPIs locationAPIs = new LocationAPIs(CommonNinject.Kernel.Get <ILocationAPIRepository>());

            this.comboLocationID.ComboBox.DataSource    = locationAPIs.GetLocationBases();
            this.comboLocationID.ComboBox.DisplayMember = CommonExpressions.PropertyName <LocationBase>(p => p.Name);
            this.comboLocationID.ComboBox.ValueMember   = CommonExpressions.PropertyName <LocationBase>(p => p.LocationID);
            this.bindingLocationID = this.comboLocationID.ComboBox.DataBindings.Add("SelectedValue", this, "LocationID", true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingLocationID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.fastWholePendingSalesOrderDetails.AboutToCreateGroups     += fastAvailableItems_AboutToCreateGroups;
            this.fastWholePendingDeliveryAdviceDetails.AboutToCreateGroups += fastAvailableItems_AboutToCreateGroups;
            this.fastWholePendingTransferOrderDetails.AboutToCreateGroups  += fastAvailableItems_AboutToCreateGroups;
            this.fastWholePendingSalesOrderDetails.ShowGroups     = true;
            this.fastWholePendingDeliveryAdviceDetails.ShowGroups = true;
            this.fastWholePendingTransferOrderDetails.ShowGroups  = true;
        }