public FrmView() { theController = new Controller(this, "sqlite"); InitializeComponent(); dgvRecord.EditMode = DataGridViewEditMode.EditOnEnter; theController.TakeQuery("SELECT COUNT(A_ID) FROM acquisition");//, "get amount"); c = Convert.ToInt32(theController.getOutcome(0)); dgvRecord.Rows.Add((++c).ToString()); refreshDropDowns(); }
private void refreshDropDowns() { var catList = new List <string>() { }; var shopList = new List <string>() { }; var locList = new List <string>() { }; theController.TakeQuery("SELECT catName FROM categories;");//, "get categories"); cats = theController.getAll(); if (cats != null) { foreach (var cat in cats) { catList.Add(cat.ToString()); } } category.DataSource = catList; cmbCat.DataSource = catList; theController.TakeQuery("SELECT C_name FROM company;");//, "get shops"); shops = theController.getAll(); if (shops != null) { foreach (var shop in shops) { shopList.Add(shop.ToString()); } } company.DataSource = shopList; cmbShop.DataSource = shopList; theController.TakeQuery("SELECT L_name FROM locations;");//, "get locations"); locs = theController.getAll(); if (locs != null) { foreach (var loc in locs) { locList.Add(loc.ToString()); } } location.DataSource = locList; cmbLoc.DataSource = locList; }