public async void load_data_once_comboboxes(ComboBox comboBox, string query, string key, string value, int selected_value) { CurtainDesigner.Models.Classes.PCManage <L> model = new CurtainDesigner.Models.Classes.PCManage <L>(); CurtainDesigner.Views.Classes.PCViewManage <O, L, F, T> view = new CurtainDesigner.Views.Classes.PCViewManage <O, L, F, T>(); SqlDataReader reader = null; reader = await model.getDataFromDB(query); view.loadDataFromDB_comboboxes(comboBox, reader, new System.ComponentModel.BindingList <KeyValuePair <string, int> >(), key, value, selected_value); }
public async void load_installations(F form) { CurtainDesigner.Models.Classes.PCManage <L> model = new CurtainDesigner.Models.Classes.PCManage <L>(); CurtainDesigner.Views.Classes.PCViewManage <O, L, F, T> view = new CurtainDesigner.Views.Classes.PCViewManage <O, L, F, T>(); SqlDataReader reader = null; reader = await model.getDataFromDB($"Select * From [Installation];"); view.loadDataFromDB_comboboxes((form as CurtainDesigner.OrderForms.FormPCOrder).comboBoxInstallation, reader, new System.ComponentModel.BindingList <KeyValuePair <string, int> >(), "Price", "Installation_id"); model.closeConnection(); }
public async void load_data(F form) { CurtainDesigner.Models.Classes.PCManage <L> model = new CurtainDesigner.Models.Classes.PCManage <L>(); CurtainDesigner.Views.Classes.PCViewManage <O, L, F, T> view = new CurtainDesigner.Views.Classes.PCViewManage <O, L, F, T>(); SqlDataReader reader = null; reader = await model.getDataFromDB("Select * From [PC_category];"); view.loadDataFromDB_comboboxes((form as CurtainDesigner.OrderForms.FormPCOrder).comboBoxCategory, reader, new System.ComponentModel.BindingList <KeyValuePair <string, int> >(), "Price", "Category_id"); reader = await model.getDataFromDB("Select * From [PC_Additional_equipment];"); view.loadDataFromDB_comboboxes((form as CurtainDesigner.OrderForms.FormPCOrder).comboBoxEquipment, reader, new System.ComponentModel.BindingList <KeyValuePair <string, int> >(), "Equipment", "Equipment_id"); reader = await model.getDataFromDB("Select * From [System_color];"); view.loadDataFromDB_comboboxes((form as CurtainDesigner.OrderForms.FormPCOrder).comboBoxSystemColor, reader, new System.ComponentModel.BindingList <KeyValuePair <string, int> >(), "Name", "Color_id"); reader = await model.getDataFromDB($"Select * From [Installation];"); view.loadDataFromDB_comboboxes((form as CurtainDesigner.OrderForms.FormPCOrder).comboBoxInstallation, reader, new System.ComponentModel.BindingList <KeyValuePair <string, int> >(), "Price", "Installation_id"); model.closeConnection(); }