Exemple #1
0
        private void bunifuTileButton3_Click(object sender, EventArgs e)
        {
            var listcur = this.banHangBindingSource.DataSource as List <BanHang.Domain.BanHang>;

            if (listcur != null)
            {
                using (var cmd = new BanHangDeleteRepository())
                {
                    cmd.ID = listcur[0].ID;
                    cmd.Execute();
                }
                this.banHangBindingSource.DataSource = null;
            }
        }
Exemple #2
0
        private void bunifuTileButton3_Click(object sender, EventArgs e)
        {
            var cur = this.banHangBindingSource.Current as BanHang.Domain.BanHang;

            if (cur != null && !string.IsNullOrWhiteSpace(cur.ID.ToString()) && !string.IsNullOrWhiteSpace(cur.NgayBan))
            {
                using (var cmd = new BanHangDeleteRepository())
                {
                    cmd.ID        = cur.ID;
                    cmd.HanghoaId = cur.HanghoaId;
                    cmd.Execute();
                }
                using (var cmd = new BanHangListRepository())
                {
                    this.banHangBindingSource.DataSource = cmd.Execute();
                }
            }
        }