private void FillMainBassCombobox()//Select all availble river basin names; { firstCB.DataSource = DataGetter.GetWaterObjWithAnyID(); firstCB.DisplayMember = "NWO"; firstCB.ValueMember = "ID"; firstCB.BindingContext = this.BindingContext; }
private void GetWaterObjList(string flowsId, char exp)//Add selected water objects to listbox; { waterObjects = DataGetter.GetWaterObjList(flowsId, exp); foreach (WaterObject waterObject in waterObjects) { listBox1.Items.Add(new WaterObject { nwo = waterObject.GetName(), id = waterObject.GetID() }); } }
private void FillVOCombobox()//Select avalible water object names { string pnabl = "%"; DataGetter dg = new DataGetter(); comboBox2.DataSource = dg.GetAllWaterObj().Tables["WaterObj"]; comboBox2.DisplayMember = "VO"; comboBox2.ValueMember = "VO"; comboBox2.BindingContext = this.BindingContext; }
private void button1_Click(object sender, EventArgs e) { List <string> idList = new List <string>(); for (int i = 0; i < listBox2.Items.Count; i++) { WaterObject wo = (WaterObject)listBox2.Items[i]; idList.Add(wo.GetID().ToString()); } DataGetter dg = new DataGetter(); dataGridView1.DataSource = dg.GetFromKPX(idList); }
private void FillPnablCombobox()//Select avalible region names { string vo = comboBox2.SelectedValue.ToString(); if (checkBox1.Checked) { vo = "%"; } DataGetter dg = new DataGetter(); comboBox3.DataSource = dg.GetObservationPoint(vo).Tables["Pnabl1"]; comboBox3.DisplayMember = "Pnabl"; comboBox3.ValueMember = "Pnabl"; comboBox3.BindingContext = this.BindingContext; }
private void FillSubBassCombobox(ComboBox cb, delGetWaterObjList a, string id, char exp)//Select all availble river basin, belongs to main river basin; { DataGetter dg = new DataGetter(); List <WaterObject> woList = a(id, exp); DataTable table = new DataTable(); using (var reader = ObjectReader.Create(woList)) { table.Load(reader); } cb.DataSource = table; cb.DisplayMember = "NWO"; cb.ValueMember = "ID"; cb.BindingContext = this.BindingContext; }
private void SelectParameters()//Select water object from databse by it`s name and region name; If any of parameters is not set, get all water object; { string vo = comboBox2.SelectedValue.ToString(); string pnabl = comboBox3.SelectedValue.ToString(); if (checkBox1.Checked) { vo = "%"; } if (checkBox2.Checked) { pnabl = "%"; } string query = "select BAS, TRIM(VO), PNABL, PRIV1 from KPH2012.KPH_NEW where VO like'" + vo + "' and Pnabl like'" + pnabl + "'"; DataGetter dg = new DataGetter(); dataGridView1.DataSource = dg.CreateDataTable(query); }