public ListMaintenance.ListFactoryDataTable GetListFactory(bool withNewRow) { ListFactoryTableAdapter listFactoryTableAdapter = new ListFactoryTableAdapter(); ListMaintenance.ListFactoryDataTable listFactoryDataTable = listFactoryTableAdapter.GetData(); if (withNewRow) { listFactoryDataTable.AddListFactoryRow("", "", DateTime.Now); } return(listFactoryDataTable); }
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; }