Esempio n. 1
0
        private void labelOpenCommonMDI_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                GlobalEnum.TaskID taskID = sender.Equals(this.pictureBoxLogo) ? GlobalEnum.TaskID.ListLogo : sender.Equals(this.pictureBoxFactory) ? GlobalEnum.TaskID.ListFactory : sender.Equals(this.pictureBoxOwner) ? GlobalEnum.TaskID.ListOwner : sender.Equals(this.pictureBoxCategory) ? GlobalEnum.TaskID.ListCategory : sender.Equals(this.pictureBoxProduct) ? GlobalEnum.TaskID.ListProduct : sender.Equals(this.pictureBoxCoil) ? GlobalEnum.TaskID.ListCoil : GlobalEnum.TaskID.ListCoil;

                CommonMDI commonMDI = new CommonMDI(taskID);
                if (commonMDI.ShowDialog() == System.Windows.Forms.DialogResult.OK || true)
                {
                    CommonMetaList commonMetaList = new CommonMetaList();
                    switch (taskID)
                    {
                    case GlobalEnum.TaskID.ListLogo:
                        this.comboBoxLogoID.DataSource = commonMetaList.GetListLogo();
                        break;

                    case GlobalEnum.TaskID.ListFactory:
                        this.comboBoxFactoryID.DataSource = commonMetaList.GetListFactory();
                        break;

                    case GlobalEnum.TaskID.ListOwner:
                        this.comboBoxOwnerID.DataSource = commonMetaList.GetListOwner();
                        break;

                    case GlobalEnum.TaskID.ListCategory:
                        this.comboBoxCategoryID.DataSource = commonMetaList.GetListCategory();
                        break;

                    case GlobalEnum.TaskID.ListProduct:
                        this.comboBoxProductID.DataSource = commonMetaList.GetListProduct();
                        break;

                    case GlobalEnum.TaskID.ListCoil:
                        this.comboBoxCoilID.DataSource = commonMetaList.GetListCoil();
                        break;

                    default:
                        break;
                    }
                }
                commonMDI.Dispose();
            }
            catch (Exception exception)
            {
                GlobalExceptionHandler.ShowExceptionMessageBox(this, exception);
            }
        }
Esempio n. 2
0
        private void InitializeCommonControlBinding()
        {
            CommonMetaList commonMetaList = new CommonMetaList();


            ListMaintenance.ListLogoDataTable listLogoDataTable = commonMetaList.GetListLogo();
            this.comboBoxLogoID.DataSource    = listLogoDataTable;
            this.comboBoxLogoID.DisplayMember = listLogoDataTable.DescriptionColumn.ColumnName;
            this.comboBoxLogoID.ValueMember   = listLogoDataTable.LogoIDColumn.ColumnName;
            this.logoIDBinding = this.comboBoxLogoID.DataBindings.Add("SelectedValue", this.dataMessageBLL.DataMessageMaster, "LogoID", true);


            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.dateTimePickerProductionDate.DataBindings.Add("Value", this.dataMessageBLL.DataMessageMaster, "ProductionDate", true);

            this.productionDatePrintableBinding = this.checkBoxProductionDatePrintable.DataBindings.Add("Checked", this.dataMessageBLL.DataMessageMaster, "ProductionDatePrintable", true);
            this.logoPrintableBinding           = this.checkBoxLogoPrintable.DataBindings.Add("Checked", this.dataMessageBLL.DataMessageMaster, "LogoPrintable", true);
            this.factoryPrintableBinding        = this.checkBoxFactoryPrintable.DataBindings.Add("Checked", this.dataMessageBLL.DataMessageMaster, "FactoryPrintable", true);
            this.ownerPrintableBinding          = this.checkBoxOwnerPrintable.DataBindings.Add("Checked", this.dataMessageBLL.DataMessageMaster, "OwnerPrintable", true);
            this.categoryPrintableBinding       = this.checkBoxCategoryPrintable.DataBindings.Add("Checked", this.dataMessageBLL.DataMessageMaster, "CategoryPrintable", true);
            this.productPrintableBinding        = this.checkBoxProductPrintable.DataBindings.Add("Checked", this.dataMessageBLL.DataMessageMaster, "ProductPrintable", true);
            this.coilPrintableBinding           = this.checkBoxCoilPrintable.DataBindings.Add("Checked", this.dataMessageBLL.DataMessageMaster, "CoilPrintable", true);
            this.counterPrintableBinding        = this.checkBoxCounterPrintable.DataBindings.Add("Checked", this.dataMessageBLL.DataMessageMaster, "CounterPrintable", 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.logoIDBinding.BindingComplete              += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            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.productionDatePrintableBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.logoPrintableBinding.BindingComplete           += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.factoryPrintableBinding.BindingComplete        += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.ownerPrintableBinding.BindingComplete          += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.categoryPrintableBinding.BindingComplete       += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.productPrintableBinding.BindingComplete        += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.coilPrintableBinding.BindingComplete           += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.counterPrintableBinding.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;

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

            this.errorProviderMaster.DataSource = this.dataMessageBLL.DataMessageMaster;
        }