public AddNewClient(int iClientID) { InitializeComponent(); ClientID = iClientID; IsUpdateMode = true; InventoryStoreDataSet.tblClientDataTable dt = taClients.GetClientByID(ClientID); if (dt.Rows.Count > 0) { trClientsRow = dt.Rows[0] as InventoryStoreDataSet.tblClientRow; } }
static public void FillClients(ComboBox cmbClient, bool IsSelectRowRequired, string strSelectRowText) { InventoryStoreDataSet.tblClientDataTable dt = new InventoryStoreDataSet.tblClientDataTable(); InventoryStoreDataSetTableAdapters.tblClientTableAdapter adp = new InventoryStoreDataSetTableAdapters.tblClientTableAdapter(); adp.Fill(dt); if (IsSelectRowRequired) { InventoryStoreDataSet.tblClientRow dr1 = dt.NewtblClientRow(); dr1.ClientID = 0; dr1.ClientName = strSelectRowText; dr1.IsCustomer = false; dr1.IsVendor = false; dt.Rows.InsertAt(dr1, 0); } cmbClient.DataSource = dt; cmbClient.DisplayMember = "ClientName"; cmbClient.ValueMember = "ClientID"; }