private void LoadData() { InventoryStoreDataSet.tblTransactionTypeDataTable dt = adp.GetDataByTransactionTypeID(transactionTypeID); if (dt.Rows.Count > 0) { dr = (InventoryStoreDataSet.tblTransactionTypeRow)dt.Rows[0]; txtTransactionType.Text = dr.TransactionType; cmbActionType.SelectedItem = (WhistlingPalms.ActionType)Enum.Parse(typeof(WhistlingPalms.ActionType), dr.ActionType); chkHasCustomerInformation.Checked = dr.HasClientOrderInformation; } btnAdd.Text = "Update"; }
static public void FillTransactionType(ComboBox cmbWareHouse, bool IsSelectRowRequired, string strSelectRowText) { InventoryStoreDataSet.tblTransactionTypeDataTable dt = new InventoryStoreDataSet.tblTransactionTypeDataTable(); InventoryStoreDataSetTableAdapters.tblTransactionTypeTableAdapter adp = new InventoryStoreDataSetTableAdapters.tblTransactionTypeTableAdapter(); adp.Fill(dt); if (IsSelectRowRequired) { InventoryStoreDataSet.tblTransactionTypeRow dr1 = dt.NewtblTransactionTypeRow(); dr1.TransactionTypeID = 0; dr1.TransactionType = strSelectRowText; dr1.ActionType = strSelectRowText; dr1.HasClientOrderInformation = false; dt.Rows.InsertAt(dr1, 0); } cmbWareHouse.DataSource = dt; cmbWareHouse.DisplayMember = "TransactionType"; cmbWareHouse.ValueMember = "TransactionTypeID"; }