public editVehicle() { InitializeComponent(); m_ve = new BindingSource(); m_vehicles = ml.getVehicles(); m_ve.DataSource = m_vehicles; m_ve.ResetBindings(false); this.dataGridView1.DataSource = m_ve.DataSource; cmbStatus.Items.Add("Available"); cmbStatus.Items.Add("Out of Service"); cmbStatus.Items.Add("In Repair"); }
private void lstVehicles_Click(object sender, EventArgs e) { BusinessMetaLayer ml = BusinessMetaLayer.instance(); m_vehicles = ml.getVehicles(); m_bs.DataSource = m_vehicles; m_bs.ResetBindings(false); this.dgdInventoryWindow.DataSource = m_bs.DataSource; this.dgdInventoryWindow.RowHeadersVisible = false; this.dgdInventoryWindow.Columns[0].Visible = false; }
public setTask() { InitializeComponent(); //dtTaskDate.Format = DateTimePickerFormat.Custom; //dtTaskDate.CustomFormat = "dd-MM-yyyy"; //Load Employee Combo Box m_em = new BindingSource(); m_employees = tl.getEmployees(); m_em.DataSource = m_employees; cmbEmployees.DataSource = m_em; //Load Task Type Combo Box m_tt = new BindingSource(); m_taskTypes = tl.getTaskTypes(); m_tt.DataSource = m_taskTypes; cmbTaskTypes.DataSource = m_tt; //Load Task Status Combo Box m_cr = new BindingSource(); m_crops = tl.getCrops(); m_cr.DataSource = m_crops; cmbCrops.DataSource = m_cr; //Load Field Combo Box m_fd = new BindingSource(); m_fields = tl.getFields(); m_fd.DataSource = m_fields; cmbFields.DataSource = m_fd; //Load Vehicle Combo Box m_ve = new BindingSource(); m_vehicles = tl.getVehicles(); m_ve.DataSource = m_vehicles; cmbVehicles.DataSource = m_ve; //Load Storage Unit Combo Box m_su = new BindingSource(); m_storageUnits = tl.getStorageUnits(); m_su.DataSource = m_storageUnits; cmbStorageUnit.DataSource = m_storageUnits; m_dg = new BindingSource(); m_tasks = tl.getTasks(); m_dg.DataSource = m_tasks; m_dg.ResetBindings(true); this.dgdTasksList.DataSource = m_dg.DataSource; this.dgdTasksList.RowHeadersVisible = false; this.dgdTasksList.Columns[0].Visible = false; }