コード例 #1
0
        private void bunifuTileButton2_Click(object sender, EventArgs e)
        {
            var cur = this.thuChiBindingSource.Current as ThuChi.Domain.ThuChi;

            if (cur != null && !string.IsNullOrWhiteSpace(cur.Ngay.ToString()))
            {
                using (var cmd = new ThuChiUpdateBusiness())
                {
                    cmd.Ngay = cur.Ngay.ToShortDateString();
                }
                using (var cmd = new ThuChiListBusiness())
                {
                    cmd.Ngay = cur.Ngay.ToShortDateString();
                    this.thuChiBindingSource.DataSource = cmd.Execute();
                }
            }
        }
コード例 #2
0
        private void bunifuTileButton4_Click(object sender, EventArgs e)
        {
            using (var cmd = new ThuChiListBusiness())
            {
                cmd.Ngay = this.Datepicker1.Value.ToShortDateString();
                var data = cmd.Execute();
                var tmp  = new ThuChi.Domain.ThuChi();

                foreach (var item in data)
                {
                    tmp.Thu += item.Thu;
                    tmp.Chi += item.Chi;
                    tmp.Ngay = item.Ngay;
                }
                this.thuChiBindingSource.DataSource = tmp;
            }
        }