Example #1
0
 private void bunifuTileButton4_Click(object sender, EventArgs e)
 {
     using (var cmd = new BanHangListRepository())
     {
         cmd.data1 = this.Datepicker1.Value.ToShortDateString();
         cmd.data2 = this.Datepicker2.Value.ToShortDateString();
         this.banHangBindingSource.DataSource = cmd.Execute();
     }
 }
Example #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();
                }
            }
        }
Example #3
0
        private void bunifuTileButton2_Click(object sender, EventArgs e)
        {
            var listcur = this.banHangBindingSource.DataSource as List <BanHang.Domain.BanHang>;

            if (listcur != null)
            {
                using (var cmd = new BanHangUpdateBusiness())
                {
                    foreach (var item in listcur)
                    {
                        cmd.item = item;
                        cmd.Execute();
                    }
                }
                using (var cmd = new BanHangListRepository())
                {
                    this.banHangBindingSource.DataSource = cmd.Execute();
                }
            }
        }