public Form_CityManage() { InitializeComponent(); City_Client = (CityClient)ClientFactory.GetClient(ClientType.Type.City); Province_Client = (ProvinceClient)ClientFactory.GetClient(ClientType.Type.Province); List_City = City_Client.SelectAllCitys().ToList(); CB_ProviceBind(); }
/// <summary> /// 添加按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BT_AddCity_Click(object sender, EventArgs e) { if (TB_CityName.Text != "" && CB_Province.SelectedIndex > 0) { int ProvinceID = Province_Client.SelectProvince_Name(CB_Province.SelectedItem.ToString()).Province_ID; WFpart.CityService.Car_City City = new WFpart.CityService.Car_City() { City_Name = TB_CityName.Text, City_Province = ProvinceID }; if (City_Client.AddCity(City)) { MessageBox.Show("添加城市成功!"); } List_City = City_Client.SelectAllCitys().ToList(); LB_CityBind(); } else { MessageBox.Show("请先选定好所属省份并填写城市名称!"); } }
public Form_VersionManage() { InitializeComponent(); Mark = false; CarSummery_Client = (CarSummeryClient)ClientFactory.GetClient(ClientType.Type.CarSummery); Province_Client = (ProvinceClient)ClientFactory.GetClient(ClientType.Type.Province); City_Client = (CityClient)ClientFactory.GetClient(ClientType.Type.City); Shop_Client = (ShopClient)ClientFactory.GetClient(ClientType.Type.Shop); Brand_Client = (BrandClient)ClientFactory.GetClient(ClientType.Type.Brand); Type_Client = (TypeClient)ClientFactory.GetClient(ClientType.Type.Type); Version_Client = (VersionClient)ClientFactory.GetClient(ClientType.Type.Version); List_VersionInfo = CarSummery_Client.SelectAllCar().ToList(); List_Car_Province = Province_Client.SelectAllProvinces().ToList(); List_City = City_Client.SelectAllCitys().ToList(); List_Shop = Shop_Client.SelectAllShops().ToList(); List_Brand = Brand_Client.SelectAllBrands().ToList(); List_Type = Type_Client.SelectAllTypes().ToList(); CB_ProviceBind(); CB_BrandBind(); CB_TypeBind(); BT_UpdateVersion.Visible = false; }