示例#1
0
        private void bt_sua_Click(object sender, EventArgs e)
        {
            if (check_null())
            {
                VatTuPhuTungDTO vtpt = new VatTuPhuTungDTO();
                vtpt.Maloaivattu  = int.Parse(tb_mavtpt.Text);
                vtpt.Tenloaivattu = tb_tenvtpt.Text;
                vtpt.Soluongton   = int.Parse(tb_soluongton.Text);
                vtpt.Dongia       = int.Parse(tb_dongia.Text);


                bool kq = vtptBus.sua(vtpt);
                if (kq == false)
                {
                    MessageBox.Show("Sửa vật tư phụ tùng thất bại. Vui lòng kiểm tra lại dữ liệu");
                }
                else
                {
                    MessageBox.Show("Sửa vật tư phụ tùng thành công");
                    this.loadData_Vao_GridView();
                }
                CurrencyManager myCurrencyManager = (CurrencyManager)this.BindingContext[data_vtpt.DataSource];
                myCurrencyManager.Refresh();
            }
        }