Exemplo n.º 1
0
        private void btnKinhDoanh_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            int    mahh  = int.Parse(gridViewHHNgungKD.GetFocusedRowCellValue("MaHangHoa").ToString());
            string tenhh = gridViewHHNgungKD.GetFocusedRowCellValue("TenHangHoa").ToString();

            var tb = MessageBox.Show(string.Format("Bạn có chắc chắn muốn tiếp tục kinh doanh hàng hóa <{0}> ?", tenhh), "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (tb == DialogResult.Yes)
            {
                BUS_HangHoa hanghoa = new BUS_HangHoa();
                var         flag    = hanghoa.TiepTucKinhDoanh(mahh);
                if (flag == true)
                {
                    MessageBox.Show(string.Format("Bạn đã tiếp tục kinh doanh hàng hóa <{0}> thành công.", tenhh), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    KhiKinhDoanhLaiHangHoa(EventArgs.Empty);   //  https://msdn.microsoft.com/en-us/library/9aackb16(v=vs.110).aspx
                    this.FormLoad();
                }
            }
            else
            {
                return;
            }
        }