private void SuppliersUserControl_Load(object sender, EventArgs e) { gridEdits.DataSource = DatabaseTools.GetAllValues("Edit.[Employee Code], Employee.[Employee Name], [Edit Types].[Type], Item.[Item Description], Edit.[Quantity], Edit.[Time]", "Edit, Employee, Item, [Edit Types] WHERE Edit.[Employee Code] = Employee.[Employee Code] AND Edit.[ItemID] = Item.[ItemID] AND [Edit Types].Id = Edit.Type"); foreach (DataGridViewColumn column in gridEdits.Columns) { column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; } gridEdits.Columns[0].Visible = false; }
private void AddJobForm_Load(object sender, EventArgs e) { gridJobs.DataSource = DatabaseTools.GetAllValues("Job.[JobID], Job.[Name], Job.[Street Address], Job.[Post Code]", "Job WHERE Job.[End Date] >= GETDATE()"); foreach (DataGridViewColumn column in gridJobs.Columns) { column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; } gridJobs.Columns[0].Visible = false; }
private void SuppliersUserControl_Load(object sender, EventArgs e) { gridSuppliers.DataSource = DatabaseTools.GetAllValues("*", "Supplier"); foreach (DataGridViewColumn column in gridSuppliers.Columns) { column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; } gridSuppliers.Columns[0].Visible = false; }
public EditItemUserControl(Item Original) { this.original = Original; InitializeComponent(); BoxName.Text = original.ItemDescription; BoxQuantity.Text = original.QuantityStored.ToString(); BoxTool.Checked = !original.Material; comboSuppliers.SelectedValue = original.SupplierID; BoxLocation.Text = original.Location; DataTable suppliers = DatabaseTools.GetAllValues("SupplierID, [Supplier Name]", "Supplier"); DataRow other = suppliers.NewRow(); other["SupplierID"] = -1; other["Supplier Name"] = "Other"; suppliers.Rows.Add(other); comboSuppliers.DisplayMember = "Supplier Name"; comboSuppliers.ValueMember = "SupplierID"; comboSuppliers.DataSource = suppliers; int otherLocation = comboSuppliers.Items.Count; }