//private OpenFileDialog file = new OpenFileDialog(); public AnalysisForm() { InitializeComponent(); var provinces = new Maticsoft.BLL.Provinces(); var provincesList = provinces.GetModelList(string.Empty); cbBoxProvinces.DataSource = provincesList; cbBoxProvinces.ValueMember = "ProvincesName"; var cityBll = new Maticsoft.BLL.City(); var cityList = cityBll.GetModelList(string.Empty); cbBoxCity.DataSource = cityList; cbBoxCity.DisplayMember = "CityName"; var districtBll = new Maticsoft.BLL.District(); var districtList = districtBll.GetModelList(String.Empty); cbbDistrict.DataSource = districtList; cbbDistrict.DisplayMember = "DistrictName"; var specialTagBll = new Maticsoft.BLL.SpecialTag(); chlBoxSpecialTag.DataSource = specialTagBll.GetModelList(string.Empty); chlBoxSpecialTag.DisplayMember = "TagName"; var cookingStylesBll = new Maticsoft.BLL.CookingStyles(); chbCookingStyles.DataSource = cookingStylesBll.GetModelList(String.Empty).OrderBy(x => x.CookingStyleName).ToList(); chbCookingStyles.DisplayMember = "CookingStyleName"; var cityLocalTagBll = new Maticsoft.BLL.CityLocalTagBll(); clbStoreTag.DataSource = cityLocalTagBll.GetModelList(string.Empty).OrderBy(x => x.TagName).ToList(); clbStoreTag.DisplayMember = "TagName"; btnNextPage.Enabled = false; btnBeforePage.Enabled = false; }
public GreatWallForm() { InitializeComponent(); var provinces = new Maticsoft.BLL.Provinces(); var provincesList = provinces.GetModelList(string.Empty); cbBoxProvinces.DataSource = provincesList; cbBoxProvinces.ValueMember = "ProvincesName"; var provincesInfo = provincesList.FirstOrDefault(); var cityBll = new Maticsoft.BLL.City(); var cityList = cityBll.GetModelList(string.Empty); cityList = cityList.FindAll(x => provincesInfo != null && x.ProvincesID == provincesInfo.ProvincesID); cbBoxCity.DataSource = cityList; cbBoxCity.DisplayMember = "CityName"; var cityInfo = cityList.FirstOrDefault(); var districtBll = new Maticsoft.BLL.District(); var districtList = districtBll.GetModelList(String.Empty); cbbDistrict.DataSource = districtList.FindAll(x => cityInfo != null && x.CityID == cityInfo.CityID); cbbDistrict.DisplayMember = "DistrictName"; var specialTagBll = new Maticsoft.BLL.SpecialTag(); chlBoxSpecialTag.DataSource = specialTagBll.GetModelList(string.Empty); chlBoxSpecialTag.DisplayMember = "TagName"; var cookingStylesBll = new Maticsoft.BLL.CookingStyles(); chbCookingStyles.DataSource = cookingStylesBll.GetModelList(String.Empty).OrderBy(x => x.CookingStyleName).ToList(); chbCookingStyles.DisplayMember = "CookingStyleName"; var cityLocalTagBll = new Maticsoft.BLL.CityLocalTagBll(); clbStoreTag.DataSource = cityLocalTagBll.GetModelList(string.Empty).OrderBy(x => x.TagName).ToList(); clbStoreTag.DisplayMember = "TagName"; }
public DownPic() { InitializeComponent(); var provinces = new Maticsoft.BLL.Provinces(); var provincesList = provinces.GetModelList(string.Empty); cbBoxProvinces.DataSource = provincesList; cbBoxProvinces.ValueMember = "ProvincesName"; var provincesInfo = provincesList.FirstOrDefault(); var cityBll = new Maticsoft.BLL.City(); var cityList = cityBll.GetModelList(string.Empty); cityList = cityList.FindAll(x => provincesInfo != null && x.ProvincesID == provincesInfo.ProvincesID); cbBoxCity.DataSource = cityList; cbBoxCity.DisplayMember = "CityName"; }
public DistrictForm() { InitializeComponent(); var provinces = new Maticsoft.BLL.Provinces(); var provincesList = provinces.GetModelList(string.Empty); cbBoxProvinces.DataSource = provincesList; cbBoxProvinces.ValueMember = "ProvincesName"; var cityBll = new Maticsoft.BLL.City(); var cityList = cityBll.GetModelList(string.Empty); cbBoxCity.DataSource = cityList; cbBoxCity.DisplayMember = "CityName"; }
private void cbBoxProvinces_SelectedIndexChanged(object sender, EventArgs e) { try { var provincesList = cbBoxProvinces.DataSource as List<Maticsoft.Model.Provinces>; if (provincesList == null) { return; } var provincesInfo = provincesList[cbBoxProvinces.SelectedIndex]; var cityBll = new Maticsoft.BLL.City(); var cityList = cityBll.GetModelList(string.Empty); cbBoxCity.DataSource = cityList.FindAll(x => x.ProvincesID == provincesInfo.ProvincesID); cbBoxCity.ValueMember = "CityName"; } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }