コード例 #1
0
ファイル: Form_BrandManage.cs プロジェクト: tsss-t/CarRental
        /// <summary>
        /// 添加商标按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BT_AddBrand_Click(object sender, EventArgs e)
        {
            if (TB_BrandName.Text == "" || PB_Pic.Image == null || imgString == null)
            {
                MessageBox.Show("您必须填写好您要添加的商标名和指定商标图片");
                return;
            }

            if (List_Brand.Where(P => P.Brand_Name == TB_BrandName.Text.Trim()).Count() > 0)
            {
                MessageBox.Show("此商标已经存在!请勿重复添加商标!");
            }
            else
            {
                if (Brand_Client.AddBrand(new Car_Brand()
                {
                    Brand_Name = TB_BrandName.Text.Trim(),
                    Brand_Info = TB_BrandInfo.Text.Trim(),
                    Brand_IMG = imgString
                }))
                {
                    MessageBox.Show("创建新的商标成功!!");
                    List_Brand = Brand_Client.SelectAllBrands().ToList();
                    Bind_Brand();
                }
                else
                {
                    MessageBox.Show("创建商标失败,请检查您的输入,如果问题依旧未解决,请联系管理员!");
                }
            }
        }
コード例 #2
0
ファイル: Form_ShopVerison.cs プロジェクト: tsss-t/CarRental
        public Form_ShopVerison()
        {
            InitializeComponent();


            ShopID = GlobalParams.ShopID;
            if (ShopID < 0)
            {
                MessageBox.Show("您不属于任何店铺,请联系系统管理员分配您的店铺所属!", "错误!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                this.Close();
            }
            CarSummery_Client = (CarSummeryClient)ClientFactory.GetClient(ClientType.Type.CarSummery);
            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_Brand       = Brand_Client.SelectAllBrands().ToList();
            List_Type        = Type_Client.SelectAllTypes().ToList();
            List_VersionInfo = CarSummery_Client.SelectAllCar().ToList();
            Mark             = false;
            LB_VersionBind();
            CB_BrandBind();
            CB_TypeBind();
            BT_UpdateVersion.Visible = false;
        }
コード例 #3
0
 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;
 }