예제 #1
0
파일: BrandAdd.cs 프로젝트: teenyda/assets2
        public void update(Brand brand)
        {
            brandCode.Text = brand.BrandCode;
            brandName.Text = brand.BrandName;
            BrandState bs = (BrandState)Enum.Parse(typeof(BrandState), brand.BrandState);

            if (bs == BrandState.已启用)
            {
                radioButton1.Select();
            }
            else
            {
                radioButton2.Select();
            }
        }
예제 #2
0
        private void brandDisable(object sender, EventArgs e)
        {
            Brand brand = (Brand)dataGridView1.CurrentRow.Tag;

            if (brand == null)
            {
                Tool.show("请选择一行");
                return;
            }
            BrandState bs = (BrandState)Enum.Parse(typeof(BrandState), brand.BrandState);

            if (bs == BrandState.已启用)
            {
                brand.BrandState = BrandState.已禁用.ToString();
            }
            else
            {
                brand.BrandState = BrandState.已启用.ToString();
            }

            dao.updateBrand(brand);

            initData();
        }
예제 #3
0
        private void cellClick(object sender, EventArgs e)
        {
            if (dataGridView1.CurrentRow == null)
            {
                return;
            }

            Brand brand = (Brand)dataGridView1.CurrentRow.Tag;

            if (brand == null)
            {
                return;
            }
            BrandState bs = (BrandState)Enum.Parse(typeof(BrandState), brand.BrandState);

            if (bs == BrandState.已启用)
            {
                button3.Text = "禁用";
            }
            else
            {
                button3.Text = "启用";
            }
        }