コード例 #1
0
 private void btnLoad_Click(object sender, EventArgs e)
 {
     using (var cmd = new KhachHangListRepository())
     {
         this.khachHangBindingSource.DataSource = cmd.Execute();
     }
 }
コード例 #2
0
 private void btnAdd_Click_1(object sender, EventArgs e)
 {
     try
     {
         var f = new frmAdd();
         if (f.ShowDialog() != DialogResult.OK)
         {
             using (var cmd = new KhachHangListRepository())
             {
                 this.khachHangBindingSource.DataSource = cmd.Execute();
             }
         }
     }
     catch
     {
         MessageBox.Show("Xảy ra lỗi không xác định!", "THÔNG BÁO!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #3
0
ファイル: KhachHangControl.cs プロジェクト: ptudgd/BaoCao
        private void btnSave_Click(object sender, EventArgs e)
        {
            var listcur = this.khachHangBindingSource.DataSource as List <KhachHang.Domain.KhachHang>;

            if (listcur != null)
            {
                using (var cmd = new KhachHangSaveBusiness())
                {
                    foreach (var item in listcur)
                    {
                        cmd.item = item;
                        cmd.Execute();
                    }
                }
                using (var cmd = new KhachHangListRepository())
                {
                    this.khachHangBindingSource.DataSource = cmd.Execute();
                }
            }
        }
コード例 #4
0
ファイル: KhachHangControl.cs プロジェクト: ptudgd/BaoCao
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         var cur = this.khachHangBindingSource.Current as KhachHang.Domain.KhachHang;
         if (cur != null && !string.IsNullOrWhiteSpace(cur.KhachhangId))
         {
             using (var cmd = new KhachHangDeleteRepository())
             {
                 cmd.KhachhangId = cur.KhachhangId;
                 cmd.Execute();
             }
             using (var cmd = new KhachHangListRepository())
             {
                 this.khachHangBindingSource.DataSource = cmd.Execute();
             }
         }
     }
     catch
     {
         MessageBox.Show("Xảy ra lỗi không xác định!", "THÔNG BÁO!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }