protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingEntryDate      = this.dateTimexEntryDate.DataBindings.Add("Value", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingReference      = this.textexReference.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.Reference), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingWarehouseName  = this.textexWarehouseName.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.WarehouseName), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingAdjustmentJobs = this.textexAdjustmentJobs.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.AdjustmentJobs), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDescription    = this.textexDescription.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks        = this.textexRemarks.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCaption        = this.labelCaption.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentDTO>(p => p.Caption));

            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexStorekeeperID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.warehouseAdjustmentViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexStorekeeperID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingEntryDate.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingReference.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingWarehouseName.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingAdjustmentJobs.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.bindingStorekeeperID.BindingComplete             += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastWarehouseAdjustmentIndex.AboutToCreateGroups += fastWarehouseAdjustmentIndex_AboutToCreateGroups;

            this.fastWarehouseAdjustmentIndex.ShowGroups = true;
            this.olvApproved.Renderer            = new MappedImageRenderer(new Object[] { false, Resources.Placeholder16 });
            this.naviGroupDetails.ExpandedHeight = this.naviGroupDetails.Size.Height;
        }
Exemple #2
0
        private void WizardMaster_Load(object sender, EventArgs e)
        {
            try
            {
                this.salesOrderViewModel.PropertyChanged += salesOrderDetailDTO_PropertyChanged;

                CustomerAPIs customerAPIs = new CustomerAPIs(CommonNinject.Kernel.Get <ICustomerAPIRepository>());

                this.combexCustomerID.DataSource    = customerAPIs.GetCustomerBases();
                this.combexCustomerID.DisplayMember = CommonExpressions.PropertyName <CustomerBase>(p => p.Code);
                this.combexCustomerID.ValueMember   = CommonExpressions.PropertyName <CustomerBase>(p => p.CustomerID);
                this.bindingCustomerID = this.combexCustomerID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.CustomerID), true, DataSourceUpdateMode.OnPropertyChanged);

                CustomerAPIs receiverAPIs = new CustomerAPIs(CommonNinject.Kernel.Get <ICustomerAPIRepository>());
                this.combexReceiverID.DataSource    = receiverAPIs.GetCustomerBases();
                this.combexReceiverID.DisplayMember = CommonExpressions.PropertyName <CustomerBase>(p => p.Code);
                this.combexReceiverID.ValueMember   = CommonExpressions.PropertyName <CustomerBase>(p => p.CustomerID);
                this.bindingReceiverID = this.combexReceiverID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.ReceiverID), true, DataSourceUpdateMode.OnPropertyChanged);

                EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

                this.combexSalespersonID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.salesOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Saleperson);
                this.combexSalespersonID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
                this.combexSalespersonID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
                this.bindingStorekeeperID = this.combexSalespersonID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.SalespersonID), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingVoucherCode     = this.textexVoucherCode.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingEntryDate       = this.dateTimexEntryDate.DataBindings.Add("Value", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingDeliveryDate    = this.dateTimexDeliveryDate.DataBindings.Add("Value", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.DeliveryDate), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingCustomerName    = this.textexCustomerName.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.CustomerName), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingContactInfo     = this.textexContactInfo.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.ContactInfo), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingReceiverName    = this.textexReceiverName.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.ReceiverName), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingShippingAddress = this.textexShippingAddress.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.ShippingAddress), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingRemarks         = this.textexRemarks.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingCustomerID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingReceiverID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingStorekeeperID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.bindingVoucherCode.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingEntryDate.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingDeliveryDate.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingCustomerName.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingContactInfo.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingReceiverName.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingShippingAddress.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingRemarks.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.errorProviderMaster.DataSource = this.salesOrderViewModel;
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Exemple #3
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingEntryDate       = this.dateTimexEntryDate.DataBindings.Add("Value", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingReference       = this.textexReference.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.Reference), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVoucherCode     = this.textexVoucherCode.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDeliveryDate    = this.dateTimexDeliveryDate.DataBindings.Add("Value", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.DeliveryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingContactInfo     = this.textexContactInfo.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.ContactInfo), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDeliveryAddress = this.textexDeliveryAddress.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.ShippingAddress), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDescription     = this.textexDescription.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks         = this.textexRemarks.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCaption         = this.labelCaption.DataBindings.Add("Text", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderDTO>(p => p.Caption));

            CustomerAPIs customerAPIs = new CustomerAPIs(CommonNinject.Kernel.Get <ICustomerAPIRepository>());

            this.combexCustomerID.DataSource    = customerAPIs.GetCustomerBases();
            this.combexCustomerID.DisplayMember = CommonExpressions.PropertyName <CustomerBase>(p => p.Name);
            this.combexCustomerID.ValueMember   = CommonExpressions.PropertyName <CustomerBase>(p => p.CustomerID);
            this.bindingCustomerID = this.combexCustomerID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.CustomerID), true, DataSourceUpdateMode.OnPropertyChanged);

            CustomerAPIs receiverAPIs = new CustomerAPIs(CommonNinject.Kernel.Get <ICustomerAPIRepository>());

            this.combexReceiverID.DataSource    = receiverAPIs.GetCustomerBases();
            this.combexReceiverID.DisplayMember = CommonExpressions.PropertyName <CustomerBase>(p => p.Name);
            this.combexReceiverID.ValueMember   = CommonExpressions.PropertyName <CustomerBase>(p => p.CustomerID);
            this.bindingReceiverID = this.combexReceiverID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.ReceiverID), true, DataSourceUpdateMode.OnPropertyChanged);

            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexSalespersonID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.salesOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Saleperson);
            this.combexSalespersonID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexSalespersonID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingSalespersonID = this.combexSalespersonID.DataBindings.Add("SelectedValue", this.salesOrderViewModel, CommonExpressions.PropertyName <SalesOrderViewModel>(p => p.SalespersonID), 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.bindingDeliveryDate.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingContactInfo.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDeliveryAddress.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.bindingCustomerID.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingReceiverID.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingSalespersonID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastSalesOrderIndex.AboutToCreateGroups += fastSalesOrderIndex_AboutToCreateGroups;

            this.fastSalesOrderIndex.ShowGroups  = true;
            this.olvApproved.Renderer            = new MappedImageRenderer(new Object[] { 1, Resources.Placeholder16, 2, Resources.Void_16 });
            this.naviGroupDetails.ExpandedHeight = this.naviGroupDetails.Size.Height;
        }
Exemple #4
0
        private void WizardMaster_Load(object sender, EventArgs e)
        {
            try
            {
                this.warehouseAdjustmentViewModel.PropertyChanged += warehouseAdjustmentDetailDTO_PropertyChanged;

                WarehouseAPIs warehouseAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get <IWarehouseAPIRepository>());
                this.combexWarehouseID.DataSource    = warehouseAPIs.GetWarehouseBases();
                this.combexWarehouseID.DisplayMember = CommonExpressions.PropertyName <WarehouseBase>(p => p.Name);
                this.combexWarehouseID.ValueMember   = CommonExpressions.PropertyName <WarehouseBase>(p => p.WarehouseID);
                this.bindingWarehouseID = this.combexWarehouseID.DataBindings.Add("SelectedValue", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentViewModel>(p => p.WarehouseID), true, DataSourceUpdateMode.OnPropertyChanged);

                WarehouseAPIs warehouseReceiptAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get <IWarehouseAPIRepository>());
                this.combexWarehouseReceiptID.DataSource    = warehouseReceiptAPIs.GetWarehouseBases();
                this.combexWarehouseReceiptID.DisplayMember = CommonExpressions.PropertyName <WarehouseBase>(p => p.Name);
                this.combexWarehouseReceiptID.ValueMember   = CommonExpressions.PropertyName <WarehouseBase>(p => p.WarehouseID);
                this.bindingWarehouseReceiptID = this.combexWarehouseReceiptID.DataBindings.Add("SelectedValue", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentViewModel>(p => p.WarehouseReceiptID), true, DataSourceUpdateMode.OnPropertyChanged);
                this.combexWarehouseReceiptID.DataBindings.Add("Enabled", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentViewModel>(p => p.WarehouseReceiptEnabled), true, DataSourceUpdateMode.OnPropertyChanged);

                WarehouseAdjustmentTypeAPIs warehouseAdjustmentTypeAPIs = new WarehouseAdjustmentTypeAPIs(CommonNinject.Kernel.Get <IWarehouseAdjustmentTypeAPIRepository>());

                this.combexWarehouseAdjustmentTypeID.DataSource    = warehouseAdjustmentTypeAPIs.GetWarehouseAdjustmentTypeBases();
                this.combexWarehouseAdjustmentTypeID.DisplayMember = CommonExpressions.PropertyName <WarehouseAdjustmentTypeBase>(p => p.Name);
                this.combexWarehouseAdjustmentTypeID.ValueMember   = CommonExpressions.PropertyName <WarehouseAdjustmentTypeBase>(p => p.WarehouseAdjustmentTypeID);
                this.bindingWarehouseAdjustmentTypeID = this.combexWarehouseAdjustmentTypeID.DataBindings.Add("SelectedValue", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentViewModel>(p => p.WarehouseAdjustmentTypeID), true, DataSourceUpdateMode.OnPropertyChanged);

                EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

                this.combexStorekeeperID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.warehouseAdjustmentViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
                this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
                this.combexStorekeeperID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
                this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingAdjustmentJobs = this.textexAdjustmentJobs.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentViewModel>(p => p.AdjustmentJobs), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingDescription    = this.textexDescription.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentViewModel>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingRemarks        = this.textexRemarks.DataBindings.Add("Text", this.warehouseAdjustmentViewModel, CommonExpressions.PropertyName <WarehouseAdjustmentViewModel>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingWarehouseID.BindingComplete               += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingWarehouseReceiptID.BindingComplete        += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingWarehouseAdjustmentTypeID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingStorekeeperID.BindingComplete             += new BindingCompleteEventHandler(CommonControl_BindingComplete);

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

                this.errorProviderMaster.DataSource = this.warehouseAdjustmentViewModel;
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Exemple #5
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingFillingLineName = this.labelFillingLineName.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.Caption));

            this.bindingEntryDate     = this.dateTimexEntryDate.DataBindings.Add("Value", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingReference     = this.textexReference.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.Reference), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingWarehouseCode = this.textexWarehouseCode.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.WarehouseName), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingDescription = this.textexDescription.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks     = this.textexRemarks.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingTotalPalletCounts = this.textexTotalPalletCounts.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.TotalPalletCounts), true, DataSourceUpdateMode.OnValidation, 0, GlobalEnums.formatQuantity);
            this.bindingTotalQuantity     = this.textexTotalQuantity.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.TotalQuantity), true, DataSourceUpdateMode.OnValidation, 0, GlobalEnums.formatQuantity);
            this.bindingTotalLineVolume   = this.textexTotalLineVolume.DataBindings.Add("Text", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.TotalLineVolume), true, DataSourceUpdateMode.OnValidation, 0, GlobalEnums.formatVolume);


            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexForkliftDriverID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.pickupViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Production);
            this.combexForkliftDriverID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexForkliftDriverID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingForkliftDriverID = this.combexForkliftDriverID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.ForkliftDriverID), true, DataSourceUpdateMode.OnPropertyChanged);


            this.combexStorekeeperID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.pickupViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexStorekeeperID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);


            this.bindingEntryDate.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingReference.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingFillingLineName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingWarehouseCode.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDescription.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingTotalPalletCounts.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTotalQuantity.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTotalLineVolume.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingForkliftDriverID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingStorekeeperID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastPickupIndex.AboutToCreateGroups     += fastPickupIndex_AboutToCreateGroups;

            this.fastPickupIndex.ShowGroups = true;
            this.olvApproved.Renderer       = new MappedImageRenderer(new Object[] { false, Resources.Placeholder16 });

            this.tableLayoutMaster.ColumnStyles[this.tableLayoutMaster.ColumnCount - 1].SizeType = SizeType.Absolute; this.tableLayoutMaster.ColumnStyles[this.tableLayoutMaster.ColumnCount - 1].Width = 10;
        }
Exemple #6
0
        public Employees()
            : base()
        {
            InitializeComponent();

            this.toolstripChild = this.toolStripChildForm;
            this.fastListIndex  = this.fastEmployeeIndex;

            this.employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.employeeViewModel = CommonNinject.Kernel.Get <EmployeeViewModel>();
            this.employeeViewModel.PropertyChanged += new PropertyChangedEventHandler(ModelDTO_PropertyChanged);
            this.baseDTO = this.employeeViewModel;
        }
Exemple #7
0
        private void WizardMaster_Load(object sender, EventArgs e)
        {
            try
            {
                this.pickupViewModel.PropertyChanged += pickupDetailDTO_PropertyChanged;

                WarehouseAPIs warehouseAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get <IWarehouseAPIRepository>());

                this.combexWarehouseID.DataSource    = warehouseAPIs.GetWarehouseBases();
                this.combexWarehouseID.DisplayMember = CommonExpressions.PropertyName <WarehouseBase>(p => p.Name);
                this.combexWarehouseID.ValueMember   = CommonExpressions.PropertyName <WarehouseBase>(p => p.WarehouseID);
                this.bindingWarehouseID = this.combexWarehouseID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.WarehouseID), true, DataSourceUpdateMode.OnPropertyChanged);

                FillingLineAPIs fillingLineAPIs = new FillingLineAPIs(CommonNinject.Kernel.Get <IFillingLineAPIRepository>());

                this.combexFillingLineID.DataSource    = fillingLineAPIs.GetFillingLineBases();
                this.combexFillingLineID.DisplayMember = CommonExpressions.PropertyName <FillingLineBase>(p => p.NickName);
                this.combexFillingLineID.ValueMember   = CommonExpressions.PropertyName <FillingLineBase>(p => p.FillingLineID);
                this.bindingFillingLineID = this.combexFillingLineID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.FillingLineID), true, DataSourceUpdateMode.OnPropertyChanged);

                EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

                this.combexForkliftDriverID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.pickupViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Production);
                this.combexForkliftDriverID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
                this.combexForkliftDriverID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
                this.bindingForkliftDriverID = this.combexForkliftDriverID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.ForkliftDriverID), true, DataSourceUpdateMode.OnPropertyChanged);


                this.combexStorekeeperID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.pickupViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
                this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
                this.combexStorekeeperID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
                this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.pickupViewModel, CommonExpressions.PropertyName <PickupViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingRemarks = this.textexRemarks.DataBindings.Add("Text", this.pickupViewModel, "Remarks", true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingWarehouseID.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingFillingLineID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingForkliftDriverID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingStorekeeperID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);

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

                this.errorProviderMaster.DataSource = this.pickupViewModel;
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Exemple #8
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingCaption = this.labelCaption.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.Caption));

            this.bindingEntryDate     = this.dateTimexEntryDate.DataBindings.Add("Value", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVoucherCodes  = this.textexVoucherCodes.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.VoucherCodes), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVehicle       = this.textexVehicle.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.Vehicle), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVehicleDriver = this.textexVehicleDriver.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.VehicleDriver), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingDescription = this.textexDescription.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks     = this.textexRemarks.DataBindings.Add("Text", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);


            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexForkliftDriverID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.goodsIssueViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexForkliftDriverID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexForkliftDriverID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingForkliftDriverID = this.combexForkliftDriverID.DataBindings.Add("SelectedValue", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.ForkliftDriverID), true, DataSourceUpdateMode.OnPropertyChanged);


            this.combexStorekeeperID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.goodsIssueViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexStorekeeperID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.goodsIssueViewModel, CommonExpressions.PropertyName <GoodsIssueViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);


            this.bindingEntryDate.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVoucherCodes.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVehicle.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVehicleDriver.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCaption.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingDescription.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingForkliftDriverID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingStorekeeperID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastGoodsIssueIndex.AboutToCreateGroups += fastGoodsIssueIndex_AboutToCreateGroups;

            this.fastGoodsIssueIndex.ShowGroups = true;
            this.olvApproved.Renderer           = new MappedImageRenderer(new Object[] { false, Resources.Placeholder16 });

            this.tableLayoutMaster.ColumnStyles[this.tableLayoutMaster.ColumnCount - 1].SizeType = SizeType.Absolute; this.tableLayoutMaster.ColumnStyles[this.tableLayoutMaster.ColumnCount - 1].Width = 10;
        }
Exemple #9
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.treeWarehouseID.RootKeyValue               = 0;
            this.treeCommodityID.RootKeyValue               = 0;
            this.treeCommodityTypeID.RootKeyValue           = 0;
            this.treeCustomerID.RootKeyValue                = 0;
            this.treeEmployeeID.RootKeyValue                = 0;
            this.treeWarehouseIssueID.RootKeyValue          = 0;
            this.treeWarehouseReceiptID.RootKeyValue        = 0;
            this.treeWarehouseAdjustmentTypeID.RootKeyValue = 0;

            WarehouseAPIs warehouseAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get <IWarehouseAPIRepository>());

            this.warehouseTrees             = warehouseAPIs.GetWarehouseTrees(ContextAttributes.User.LocationID);
            this.treeWarehouseID.DataSource = new BindingSource(this.warehouseTrees, "");

            this.warehouseIssueTrees             = warehouseAPIs.GetWarehouseTrees(null);
            this.treeWarehouseIssueID.DataSource = new BindingSource(this.warehouseIssueTrees, "");

            this.warehouseReceiptTrees             = warehouseAPIs.GetWarehouseTrees(null);
            this.treeWarehouseReceiptID.DataSource = new BindingSource(this.warehouseReceiptTrees, "");

            WarehouseAdjustmentTypeAPIs warehouseAdjustmentTypeAPIs = new WarehouseAdjustmentTypeAPIs(CommonNinject.Kernel.Get <IWarehouseAdjustmentTypeAPIRepository>());

            this.warehouseAdjustmentTypeTrees             = warehouseAdjustmentTypeAPIs.GetWarehouseAdjustmentTypeTrees();
            this.treeWarehouseAdjustmentTypeID.DataSource = new BindingSource(this.warehouseAdjustmentTypeTrees, "");

            CommodityAPIs commodityAPIs = new CommodityAPIs(CommonNinject.Kernel.Get <ICommodityAPIRepository>());

            this.commodityTrees             = commodityAPIs.GetCommodityTrees();
            this.treeCommodityID.DataSource = new BindingSource(this.commodityTrees, "");

            CommodityTypeAPIs commodityTypeAPIs = new CommodityTypeAPIs(CommonNinject.Kernel.Get <ICommodityTypeAPIRepository>());

            this.commodityTypeTrees             = commodityTypeAPIs.GetCommodityTypeTrees();
            this.treeCommodityTypeID.DataSource = new BindingSource(this.commodityTypeTrees, "");

            CustomerAPIs customerAPIs = new CustomerAPIs(CommonNinject.Kernel.Get <ICustomerAPIRepository>());

            this.customerTrees             = customerAPIs.GetCustomerTrees();
            this.treeCustomerID.DataSource = new BindingSource(this.customerTrees, "");

            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.employeeTrees             = employeeAPIs.GetEmployeeTrees();
            this.treeEmployeeID.DataSource = new BindingSource(this.employeeTrees, "");

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

            this.comboQuantityVersusVolume.ComboBox.Items.AddRange(new string[] { "By quantity", "By volume" });
            this.comboQuantityVersusVolume.ComboBox.SelectedIndex = 1;

            this.comboDateVersusMonth.ComboBox.Items.AddRange(new string[] { "Daily summary", "Monthly summary" });
            this.comboDateVersusMonth.ComboBox.SelectedIndex = 1;

            this.comboSalesVersusPromotion.ComboBox.Items.AddRange(new string[] { "Sales & promotions", "Sales only", "Promotions only" });
            this.comboSalesVersusPromotion.ComboBox.SelectedIndex = 0;

            this.comboForecastFilters.ComboBox.Items.AddRange(new string[] { "[All Items in Stock]", "[Current Stock + In Transit] > 0", "[Current Stock + In Transit] = 0", "[Current Stock + In Transit] < 0", "[Current Stock + In Transit] Between Low-High Level", "[Current Stock + In Transit] Out of Range Low-High Level", "[Current Stock + In Transit] Under Low-Level", "[Current Stock + In Transit] Over High-Level" });
            this.comboForecastFilters.ComboBox.SelectedIndex = 0;

            this.comboSlowMoving.Items.AddRange(new string[] { "Regardless forecast", "And without forecast" });
            this.comboSlowMoving.SelectedIndex = 0;

            UserControlAPIs userControlAPIs = new UserControlAPIs(CommonNinject.Kernel.Get <IUserControlAPIRepository>());

            this.comboUserName.ComboBox.Items.Add("[All users]");
            this.comboUserName.ComboBox.Items.AddRange(Array.ConvertAll(userControlAPIs.GetUserControlIndexes(GlobalEnums.ActiveOption.Both).ToArray(), u => u.UserName));
            this.comboUserName.ComboBox.SelectedIndex = 0;

            this.dateTimexFromDate.DataBindings.Add("Value", GlobalEnums.GlobalOptionSetting, CommonExpressions.PropertyName <OptionSetting>(p => p.FromDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.dateTimexToDate.DataBindings.Add("Value", GlobalEnums.GlobalOptionSetting, CommonExpressions.PropertyName <OptionSetting>(p => p.ToDate), true, DataSourceUpdateMode.OnPropertyChanged);

            this.fastReportIndex.AboutToCreateGroups += fastReportIndex_AboutToCreateGroups;
            this.fastReportIndex.ShowGroups           = true;
            //this.olvApproved.Renderer = new MappedImageRenderer(new Object[] { 1, Resources.Placeholder16, 2, Resources.Void_16 });
        }
Exemple #10
0
        private void WizardMaster_Load(object sender, EventArgs e)
        {
            try
            {
                this.transferOrderViewModel.PropertyChanged += transferOrderDetailDTO_PropertyChanged;

                WarehouseAPIs warehouseAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get<IWarehouseAPIRepository>());

                this.combexWarehouseID.DataSource = warehouseAPIs.GetWarehouseBases();
                this.combexWarehouseID.DisplayMember = CommonExpressions.PropertyName<WarehouseBase>(p => p.Name);
                this.combexWarehouseID.ValueMember = CommonExpressions.PropertyName<WarehouseBase>(p => p.WarehouseID);
                this.bindingWarehouseID = this.combexWarehouseID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.WarehouseID), true, DataSourceUpdateMode.OnPropertyChanged);

                WarehouseAPIs warehouseReceiptAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get<IWarehouseAPIRepository>());
                this.combexWarehouseReceiptID.DataSource = warehouseReceiptAPIs.GetWarehouseBases();
                this.combexWarehouseReceiptID.DisplayMember = CommonExpressions.PropertyName<WarehouseBase>(p => p.Name);
                this.combexWarehouseReceiptID.ValueMember = CommonExpressions.PropertyName<WarehouseBase>(p => p.WarehouseID);
                this.bindingWarehouseReceiptID = this.combexWarehouseReceiptID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.WarehouseReceiptID), true, DataSourceUpdateMode.OnPropertyChanged);

                TransferOrderTypeAPIs transferOrderTypeAPIs = new TransferOrderTypeAPIs(CommonNinject.Kernel.Get<ITransferOrderTypeAPIRepository>());

                this.combexTransferOrderTypeID.DataSource = transferOrderTypeAPIs.GetTransferOrderTypeBases();
                this.combexTransferOrderTypeID.DisplayMember = CommonExpressions.PropertyName<TransferOrderTypeBase>(p => p.Name);
                this.combexTransferOrderTypeID.ValueMember = CommonExpressions.PropertyName<TransferOrderTypeBase>(p => p.TransferOrderTypeID);
                this.bindingTransferOrderTypeID = this.combexTransferOrderTypeID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.TransferOrderTypeID), true, DataSourceUpdateMode.OnPropertyChanged);

                this.combexTransferPackageTypeID.DataSource = transferOrderTypeAPIs.GetTransferPackageTypeBases();
                this.combexTransferPackageTypeID.DisplayMember = CommonExpressions.PropertyName<TransferPackageTypeBase>(p => p.Name);
                this.combexTransferPackageTypeID.ValueMember = CommonExpressions.PropertyName<TransferPackageTypeBase>(p => p.TransferPackageTypeID);
                this.bindingTransferPackageTypeID = this.combexTransferPackageTypeID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.TransferPackageTypeID), true, DataSourceUpdateMode.OnPropertyChanged);

                EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get<IEmployeeAPIRepository>());

                this.combexForkliftDriverID.DataSource = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.transferOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
                this.combexForkliftDriverID.DisplayMember = CommonExpressions.PropertyName<EmployeeBase>(p => p.Name);
                this.combexForkliftDriverID.ValueMember = CommonExpressions.PropertyName<EmployeeBase>(p => p.EmployeeID);
                this.bindingForkliftDriverID = this.combexForkliftDriverID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.ForkliftDriverID), true, DataSourceUpdateMode.OnPropertyChanged);

                this.combexStorekeeperID.DataSource = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.transferOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
                this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName<EmployeeBase>(p => p.Name);
                this.combexStorekeeperID.ValueMember = CommonExpressions.PropertyName<EmployeeBase>(p => p.EmployeeID);
                this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);
                
                this.bindingEntryDate = this.dateTimexEntryDate.DataBindings.Add("Value", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingVoucherCode = this.textexVoucherCode.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingVehicle = this.textexVehicle.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.Vehicle), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingVehicleDriver = this.textexVehicleDriver.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.VehicleDriver), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingTransferJobs = this.textexTransferJobs.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.TransferJobs), true, DataSourceUpdateMode.OnPropertyChanged);
                this.bindingRemarks = this.textexRemarks.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName<TransferOrderViewModel>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);

                this.bindingWarehouseID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingWarehouseReceiptID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.bindingTransferOrderTypeID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingTransferPackageTypeID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            
                this.bindingForkliftDriverID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingStorekeeperID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.bindingVoucherCode.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingVehicle.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingVehicleDriver.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingEntryDate.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingTransferJobs.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
                this.bindingRemarks.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

                this.errorProviderMaster.DataSource = this.transferOrderViewModel;
            }
            catch (Exception exception)
            {
                ExceptionHandlers.ShowExceptionMessageBox(this, exception);
            }
        }
Exemple #11
0
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingCode         = this.textexCode.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Code), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingName         = this.textexName.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Name), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingOfficialName = this.textexOfficialName.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.OfficialName), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingContactInfo   = this.textexContactInfo.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.ContactInfo), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVATCode       = this.textexVATCode.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.VATCode), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingTelephone     = this.textexTelephone.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Telephone), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingFacsimile     = this.textexFacsimile.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Facsimile), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingEmail         = this.textexEmail.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Email), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingAttentionName = this.textexAttentionName.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.AttentionName), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingBillingAddress  = this.textexBillingAddress.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.BillingAddress), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingShippingAddress = this.textexShippingAddress.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.ShippingAddress), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks         = this.textexRemarks.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCaption         = this.labelCaption.DataBindings.Add("Text", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.Caption));

            this.bindingIsCustomer = this.checkIsCustomer.DataBindings.Add("Checked", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.IsCustomer), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingIsReceiver = this.checkIsReceiver.DataBindings.Add("Checked", this.customerViewModel, CommonExpressions.PropertyName <CustomerDTO>(p => p.IsReceiver), true, DataSourceUpdateMode.OnPropertyChanged);

            this.IsCustomers = true;
            this.comboIsCustomers.ComboBox.DataSource = new List <OptionBool>()
            {
                new OptionBool()
                {
                    OptionValue = true, OptionDescription = "Show Customers"
                }, new OptionBool()
                {
                    OptionValue = false, OptionDescription = "Show Receivers"
                }
            };
            this.comboIsCustomers.ComboBox.DisplayMember = CommonExpressions.PropertyName <OptionBool>(p => p.OptionDescription);
            this.comboIsCustomers.ComboBox.ValueMember   = CommonExpressions.PropertyName <OptionBool>(p => p.OptionValue);
            this.bindingIsCustomers = this.comboIsCustomers.ComboBox.DataBindings.Add("SelectedValue", this, "IsCustomers", true, DataSourceUpdateMode.OnPropertyChanged);

            CustomerTypeAPIs customerTypeAPIs = new CustomerTypeAPIs(CommonNinject.Kernel.Get <ICustomerTypeAPIRepository>());

            this.combexCustomerTypeID.DataSource    = customerTypeAPIs.GetCustomerTypeBases();
            this.combexCustomerTypeID.DisplayMember = CommonExpressions.PropertyName <CustomerTypeBase>(p => p.Name);
            this.combexCustomerTypeID.ValueMember   = CommonExpressions.PropertyName <CustomerTypeBase>(p => p.CustomerTypeID);
            this.bindingCustomerTypeID = this.combexCustomerTypeID.DataBindings.Add("SelectedValue", this.customerViewModel, CommonExpressions.PropertyName <CustomerViewModel>(p => p.CustomerTypeID), true, DataSourceUpdateMode.OnPropertyChanged);

            CustomerCategoryAPIs customerCategoryAPIs = new CustomerCategoryAPIs(CommonNinject.Kernel.Get <ICustomerCategoryAPIRepository>());

            this.combexCustomerCategoryID.DataSource    = customerCategoryAPIs.GetCustomerCategoryBases();
            this.combexCustomerCategoryID.DisplayMember = CommonExpressions.PropertyName <CustomerCategoryBase>(p => p.Name);
            this.combexCustomerCategoryID.ValueMember   = CommonExpressions.PropertyName <CustomerCategoryBase>(p => p.CustomerCategoryID);
            this.bindingCustomerCategoryID = this.combexCustomerCategoryID.DataBindings.Add("SelectedValue", this.customerViewModel, CommonExpressions.PropertyName <CustomerViewModel>(p => p.CustomerCategoryID), true, DataSourceUpdateMode.OnPropertyChanged);

            TerritoryAPIs territoryAPIs = new TerritoryAPIs(CommonNinject.Kernel.Get <ITerritoryAPIRepository>());

            this.combexTerritoryID.DataSource    = territoryAPIs.GetTerritoryBases();
            this.combexTerritoryID.DisplayMember = CommonExpressions.PropertyName <TerritoryBase>(p => p.Name);
            this.combexTerritoryID.ValueMember   = CommonExpressions.PropertyName <TerritoryBase>(p => p.TerritoryID);
            this.bindingTerritoryID = this.combexTerritoryID.DataBindings.Add("SelectedValue", this.customerViewModel, CommonExpressions.PropertyName <CustomerViewModel>(p => p.TerritoryID), true, DataSourceUpdateMode.OnPropertyChanged);

            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexSalespersonID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.customerViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Saleperson);
            this.combexSalespersonID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexSalespersonID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingSalespersonID = this.combexSalespersonID.DataBindings.Add("SelectedValue", this.customerViewModel, CommonExpressions.PropertyName <CustomerViewModel>(p => p.SalespersonID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingCode.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingName.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingOfficialName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingContactInfo.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVATCode.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTelephone.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingFacsimile.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingEmail.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingAttentionName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingBillingAddress.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingShippingAddress.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingRemarks.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCaption.BindingComplete         += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingIsCustomer.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingIsReceiver.BindingComplete  += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingIsCustomers.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingCustomerTypeID.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingCustomerCategoryID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTerritoryID.BindingComplete        += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingSalespersonID.BindingComplete      += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastCustomerIndex.AboutToCreateGroups     += fastCustomerIndex_AboutToCreateGroups;

            this.fastCustomerIndex.ShowGroups    = true;
            this.olvInActive.Renderer            = new MappedImageRenderer(new Object[] { false, Resources.Placeholder16 });
            this.naviGroupDetails.ExpandedHeight = this.naviGroupDetails.Size.Height;
        }
        protected override void InitializeCommonControlBinding()
        {
            base.InitializeCommonControlBinding();

            this.bindingEntryDate     = this.dateTimexEntryDate.DataBindings.Add("Value", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.EntryDate), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingWarehouseName = this.textexWarehouseName.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.WarehouseName), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVoucherCode   = this.textexVoucherCode.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.VoucherCode), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVehicle       = this.textexVehicle.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.Vehicle), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingVehicleDriver = this.textexVehicleDriver.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.VehicleDriver), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingTransferJobs  = this.textexTransferJobs.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.TransferJobs), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingDescription   = this.textexDescription.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.Description), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingRemarks       = this.textexRemarks.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.Remarks), true, DataSourceUpdateMode.OnPropertyChanged);
            this.bindingCaption       = this.labelCaption.DataBindings.Add("Text", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderDTO>(p => p.Caption));

            WarehouseAPIs warehouseReceiptAPIs = new WarehouseAPIs(CommonNinject.Kernel.Get <IWarehouseAPIRepository>());

            this.combexWarehouseReceiptID.DataSource    = warehouseReceiptAPIs.GetWarehouseBases();
            this.combexWarehouseReceiptID.DisplayMember = CommonExpressions.PropertyName <WarehouseBase>(p => p.Name);
            this.combexWarehouseReceiptID.ValueMember   = CommonExpressions.PropertyName <WarehouseBase>(p => p.WarehouseID);
            this.bindingWarehouseReceiptID = this.combexWarehouseReceiptID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderViewModel>(p => p.WarehouseReceiptID), true, DataSourceUpdateMode.OnPropertyChanged);

            TransferOrderTypeAPIs transferOrderTypeAPIs = new TransferOrderTypeAPIs(CommonNinject.Kernel.Get <ITransferOrderTypeAPIRepository>());

            this.combexTransferOrderTypeID.DataSource    = transferOrderTypeAPIs.GetTransferOrderTypeBases();
            this.combexTransferOrderTypeID.DisplayMember = CommonExpressions.PropertyName <TransferOrderTypeBase>(p => p.Name);
            this.combexTransferOrderTypeID.ValueMember   = CommonExpressions.PropertyName <TransferOrderTypeBase>(p => p.TransferOrderTypeID);
            this.bindingTransferOrderTypeID = this.combexTransferOrderTypeID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderViewModel>(p => p.TransferOrderTypeID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.combexTransferPackageTypeID.DataSource    = transferOrderTypeAPIs.GetTransferPackageTypeBases();
            this.combexTransferPackageTypeID.DisplayMember = CommonExpressions.PropertyName <TransferPackageTypeBase>(p => p.Name);
            this.combexTransferPackageTypeID.ValueMember   = CommonExpressions.PropertyName <TransferPackageTypeBase>(p => p.TransferPackageTypeID);
            this.bindingTransferPackageTypeID = this.combexTransferPackageTypeID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderViewModel>(p => p.TransferPackageTypeID), true, DataSourceUpdateMode.OnPropertyChanged);

            EmployeeAPIs employeeAPIs = new EmployeeAPIs(CommonNinject.Kernel.Get <IEmployeeAPIRepository>());

            this.combexForkliftDriverID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.transferOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexForkliftDriverID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexForkliftDriverID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingForkliftDriverID = this.combexForkliftDriverID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderViewModel>(p => p.ForkliftDriverID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.combexStorekeeperID.DataSource    = employeeAPIs.GetEmployeeBases(ContextAttributes.User.UserID, (int)this.transferOrderViewModel.NMVNTaskID, (int)GlobalEnums.RoleID.Logistic);
            this.combexStorekeeperID.DisplayMember = CommonExpressions.PropertyName <EmployeeBase>(p => p.Name);
            this.combexStorekeeperID.ValueMember   = CommonExpressions.PropertyName <EmployeeBase>(p => p.EmployeeID);
            this.bindingStorekeeperID = this.combexStorekeeperID.DataBindings.Add("SelectedValue", this.transferOrderViewModel, CommonExpressions.PropertyName <TransferOrderViewModel>(p => p.StorekeeperID), true, DataSourceUpdateMode.OnPropertyChanged);

            this.bindingEntryDate.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingWarehouseName.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVoucherCode.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVehicle.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingVehicleDriver.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTransferJobs.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.bindingWarehouseReceiptID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingTransferOrderTypeID.BindingComplete   += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingTransferPackageTypeID.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.bindingForkliftDriverID.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.bindingStorekeeperID.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.fastTransferOrderIndex.AboutToCreateGroups += fastTransferOrderIndex_AboutToCreateGroups;

            this.fastTransferOrderIndex.ShowGroups = true;
            this.olvApproved.Renderer            = new MappedImageRenderer(new Object[] { 1, Resources.Placeholder16, 2, Resources.Void_16 });
            this.naviGroupDetails.ExpandedHeight = this.naviGroupDetails.Size.Height;
        }