Пример #1
0
        private void InitializeCommonControlBinding()
        {
            CommonMetaList commonMetaList = new CommonMetaList();


            ListMaintenance.ListFactoryDataTable listFactoryDataTable = commonMetaList.GetListFactory();
            this.comboBoxFactoryID.DataSource    = listFactoryDataTable;
            this.comboBoxFactoryID.DisplayMember = listFactoryDataTable.DescriptionColumn.ColumnName;
            this.comboBoxFactoryID.ValueMember   = listFactoryDataTable.FactoryIDColumn.ColumnName;
            this.factoryIDBinding = this.comboBoxFactoryID.DataBindings.Add("SelectedValue", this.dataMessageBLL.DataMessageMaster, "FactoryID", true);

            ListMaintenance.ListOwnerDataTable listOwnerDataTable = commonMetaList.GetListOwner();
            this.comboBoxOwnerID.DataSource    = listOwnerDataTable;
            this.comboBoxOwnerID.DisplayMember = listOwnerDataTable.DescriptionColumn.ColumnName;
            this.comboBoxOwnerID.ValueMember   = listOwnerDataTable.OwnerIDColumn.ColumnName;
            this.ownerIDBinding = this.comboBoxOwnerID.DataBindings.Add("SelectedValue", this.dataMessageBLL.DataMessageMaster, "OwnerID", true);

            ListMaintenance.ListCategoryDataTable listCategoryDataTable = commonMetaList.GetListCategory();
            this.comboBoxCategoryID.DataSource    = listCategoryDataTable;
            this.comboBoxCategoryID.DisplayMember = listCategoryDataTable.DescriptionColumn.ColumnName;
            this.comboBoxCategoryID.ValueMember   = listCategoryDataTable.CategoryIDColumn.ColumnName;
            this.categoryIDBinding = this.comboBoxCategoryID.DataBindings.Add("SelectedValue", this.dataMessageBLL.DataMessageMaster, "CategoryID", true);

            ListMaintenance.ListProductDataTable listProductDataTable = commonMetaList.GetListProduct();
            this.comboBoxProductID.DataSource    = listProductDataTable;
            this.comboBoxProductID.DisplayMember = listProductDataTable.DescriptionColumn.ColumnName;
            this.comboBoxProductID.ValueMember   = listProductDataTable.ProductIDColumn.ColumnName;
            this.productIDBinding = this.comboBoxProductID.DataBindings.Add("SelectedValue", this.dataMessageBLL.DataMessageMaster, "ProductID", true);

            ListMaintenance.ListCoilDataTable listCoilDataTable = commonMetaList.GetListCoil();
            this.comboBoxCoilID.DataSource    = listCoilDataTable;
            this.comboBoxCoilID.DisplayMember = listCoilDataTable.DescriptionColumn.ColumnName;
            this.comboBoxCoilID.ValueMember   = listCoilDataTable.CoilIDColumn.ColumnName;
            this.coilIDBinding = this.comboBoxCoilID.DataBindings.Add("SelectedValue", this.dataMessageBLL.DataMessageMaster, "CoilID", true);

            ListMaintenance.ListStaffNameDataTable listStaffNameDataTable = commonMetaList.GetStaffName();
            this.comboBoxRequestedEmployeeID.DataSource    = listStaffNameDataTable;
            this.comboBoxRequestedEmployeeID.DisplayMember = listStaffNameDataTable.DescriptionOfficialColumn.ColumnName;
            this.comboBoxRequestedEmployeeID.ValueMember   = listStaffNameDataTable.StaffIDColumn.ColumnName;
            this.requestedEmployeeIDBinding = this.comboBoxRequestedEmployeeID.DataBindings.Add("SelectedValue", this.dataMessageBLL.DataMessageMaster, "RequestedEmployeeID", true);


            this.coilExtensionBinding = this.textBoxCoilExtension.DataBindings.Add("Text", this.dataMessageBLL.DataMessageMaster, "CoilExtension", true);
            this.remarksBinding       = this.textBoxRemarks.DataBindings.Add("Text", this.dataMessageBLL.DataMessageMaster, "Remarks", true);

            this.productionDateBinding = this.dateTimePickerRequestedDate.DataBindings.Add("Value", this.dataMessageBLL.DataMessageMaster, "ProductionDate", true);

            this.isDirtyBinding    = this.checkBoxIsDirty.DataBindings.Add("Checked", this.dataMessageBLL.DataMessageMaster, "IsDirty", true);
            this.isDirtyBLLBinding = this.checkBoxIsDirtyBLL.DataBindings.Add("Checked", this.dataMessageBLL, "IsDirty", true);


            this.factoryIDBinding.BindingComplete           += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.ownerIDBinding.BindingComplete             += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.categoryIDBinding.BindingComplete          += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.productIDBinding.BindingComplete           += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.coilIDBinding.BindingComplete              += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.requestedEmployeeIDBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);


            this.coilExtensionBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.remarksBinding.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);

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

            this.isDirtyBinding.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.isDirtyBLLBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.naviGroupDetails.DataBindings.Add("ExpandedHeight", this.numericUpDownSizingDetail, "Value", true, DataSourceUpdateMode.OnPropertyChanged);
            this.numericUpDownSizingDetail.Minimum = this.naviGroupDetails.HeaderHeight * 2;
            this.numericUpDownSizingDetail.Maximum = this.naviGroupDetails.Height + this.dataGridViewDataMessageMaster.Height;
        }
Пример #2
0
        private void InitializeCommonControlBinding()
        {
            CommonMetaList commonMetaList = new CommonMetaList();


            ERmgrUIP.MarketingProgramListDataTable marketingProgramListDataTable = commonMetaList.GetMarketingProgramList();
            this.comboBoxMarketingProgramID.DataSource    = marketingProgramListDataTable;
            this.comboBoxMarketingProgramID.DisplayMember = marketingProgramListDataTable.ReferenceColumn.ColumnName;
            this.comboBoxMarketingProgramID.ValueMember   = marketingProgramListDataTable.MarketingProgramIDColumn.ColumnName;
            this.marketingProgramIDBinding = this.comboBoxMarketingProgramID.DataBindings.Add("SelectedValue", this.marketingIncentiveBLL.MarketingIncentiveMaster, "MarketingProgramID", true);


            ERmgrUIP.ListMarketingPaymentTypeDataTable marketingPaymentTypeListDataTable = commonMetaList.GetMarketingPaymentType();
            this.comboBoxMarketingPaymentTypeID.DataSource    = marketingPaymentTypeListDataTable;
            this.comboBoxMarketingPaymentTypeID.DisplayMember = marketingPaymentTypeListDataTable.DescriptionColumn.ColumnName;
            this.comboBoxMarketingPaymentTypeID.ValueMember   = marketingPaymentTypeListDataTable.MarketingPaymentTypeIDColumn.ColumnName;
            this.marketingPaymentTypeIDBinding = this.comboBoxMarketingPaymentTypeID.DataBindings.Add("SelectedValue", this.marketingIncentiveBLL.MarketingIncentiveMaster, "MarketingPaymentTypeID", true);



            ERmgrUIP.ListStaffNameDataTable listStaffNameDataTable = commonMetaList.GetStaffName();
            this.comboBoxRequestedEmployeeID.DataSource    = listStaffNameDataTable;
            this.comboBoxRequestedEmployeeID.DisplayMember = listStaffNameDataTable.DescriptionOfficialColumn.ColumnName;
            this.comboBoxRequestedEmployeeID.ValueMember   = listStaffNameDataTable.StaffIDColumn.ColumnName;
            this.requestedEmployeeIDBinding = this.comboBoxRequestedEmployeeID.DataBindings.Add("SelectedValue", this.marketingIncentiveBLL.MarketingIncentiveMaster, "RequestedEmployeeID", true);

            listStaffNameDataTable = (ERmgrUIP.ListStaffNameDataTable)listStaffNameDataTable.Copy();
            this.comboBoxNotedEmployeeID.DataSource    = listStaffNameDataTable;
            this.comboBoxNotedEmployeeID.DisplayMember = listStaffNameDataTable.DescriptionOfficialColumn.ColumnName;
            this.comboBoxNotedEmployeeID.ValueMember   = listStaffNameDataTable.StaffIDColumn.ColumnName;
            this.notedEmployeeIDBinding = this.comboBoxNotedEmployeeID.DataBindings.Add("SelectedValue", this.marketingIncentiveBLL.MarketingIncentiveMaster, "NotedEmployeeID", true);

            listStaffNameDataTable = (ERmgrUIP.ListStaffNameDataTable)listStaffNameDataTable.Copy();
            this.comboBoxApprovedEmployeeID.DataSource    = listStaffNameDataTable;
            this.comboBoxApprovedEmployeeID.DisplayMember = listStaffNameDataTable.DescriptionOfficialColumn.ColumnName;
            this.comboBoxApprovedEmployeeID.ValueMember   = listStaffNameDataTable.StaffIDColumn.ColumnName;
            this.approvedEmployeeIDBinding = this.comboBoxApprovedEmployeeID.DataBindings.Add("SelectedValue", this.marketingIncentiveBLL.MarketingIncentiveMaster, "ApprovedEmployeeID", true);


            this.paymentPeriodBinding    = this.textBoxPaymentPeriod.DataBindings.Add("Text", this.marketingIncentiveBLL.MarketingIncentiveMaster, "PaymentPeriod", true);
            this.paymentMachanicsBinding = this.textBoxPaymentMachanics.DataBindings.Add("Text", this.marketingIncentiveBLL.MarketingIncentiveMaster, "PaymentMachanics", true);
            this.remarksBinding          = this.textBoxRemarks.DataBindings.Add("Text", this.marketingIncentiveBLL.MarketingIncentiveMaster, "Remarks", true);


            this.requestedDateBinding = this.dateTimePickerRequestedDate.DataBindings.Add("Value", this.marketingIncentiveBLL.MarketingIncentiveMaster, "RequestedDate", true);

            this.isDirtyBinding    = this.checkBoxIsDirty.DataBindings.Add("Checked", this.marketingIncentiveBLL.MarketingIncentiveMaster, "IsDirty", true);
            this.isDirtyBLLBinding = this.checkBoxIsDirtyBLL.DataBindings.Add("Checked", this.marketingIncentiveBLL, "IsDirty", true);



            this.marketingProgramIDBinding.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.marketingPaymentTypeIDBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.requestedEmployeeIDBinding.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.notedEmployeeIDBinding.BindingComplete        += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.approvedEmployeeIDBinding.BindingComplete     += new BindingCompleteEventHandler(CommonControl_BindingComplete);


            this.paymentPeriodBinding.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.paymentMachanicsBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.remarksBinding.BindingComplete          += new BindingCompleteEventHandler(CommonControl_BindingComplete);

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

            this.isDirtyBinding.BindingComplete    += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.isDirtyBLLBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.naviGroupDetails.DataBindings.Add("ExpandedHeight", this.numericUpDownSizingDetail, "Value", true, DataSourceUpdateMode.OnPropertyChanged);
            this.numericUpDownSizingDetail.Minimum = this.naviGroupDetails.HeaderHeight * 2;
            this.numericUpDownSizingDetail.Maximum = this.naviGroupDetails.Height + this.dataListViewMaster.Height;

            this.tableLayoutPanelMaster.ColumnStyles[this.tableLayoutPanelMaster.ColumnCount - 1].SizeType = SizeType.Absolute; this.tableLayoutPanelMaster.ColumnStyles[this.tableLayoutPanelMaster.ColumnCount - 1].Width = 10;
            this.tableLayoutPanelExtend.ColumnStyles[this.tableLayoutPanelExtend.ColumnCount - 1].SizeType = SizeType.Absolute; this.tableLayoutPanelExtend.ColumnStyles[this.tableLayoutPanelExtend.ColumnCount - 1].Width = 10;

            this.errorProviderMaster.DataSource = this.marketingIncentiveBLL.MarketingIncentiveMaster;
        }