コード例 #1
0
        private void sbCapNhat_Click(object sender, EventArgs e)
        {
            LePhiGiaoHang gh = new LePhiGiaoHang();
            gh.MaKhuVuc = this.maLePhi;
            gh.TenKhuVuc = this.teTenKhuVuc.Text;
            gh.Dongia = this.teDonGia.Text == null ? 0 : Convert.ToDecimal(this.teDonGia.Text);

            if (gh.TenKhuVuc == null && gh.TenKhuVuc.Equals(""))
            {
                MessageBox.Show("Tên Khu Vực không được để trống", "Thông báo lỗi", MessageBoxButtons.OK);
                return;
            }
            else
            {
                if (!this.maLePhi.Equals("") && (new LePhiGiaoHangBUS().CapNhatLePhiGiaoHang(gh)))
                {
                    MessageBox.Show("Cập nhật lệ phí giao phí thành công", "Thông báo", MessageBoxButtons.OK);
                    this.gcKetQua.DataSource = (new LePhiGiaoHangBUS().LayDanhSachLePhiGiaoHang());
                }
                else
                {
                    MessageBox.Show("Cập nhật lệ phí giao phí thất bại", "Thông báo", MessageBoxButtons.OK);
                }
            }
        }
コード例 #2
0
 public HoaDonBan()
 {
     this.KhachHang = new KhachHang();
     this.hoaDon = new HoaDon();
     this.CtHoaDon = new CTHoaDonBan();
     this.lePhiGiaoHang = new LePhiGiaoHang();
 }
コード例 #3
0
 public DataTable TimKiemLePhiGiaoHang(LePhiGiaoHang lp)
 {
     try
     {
         return this.lePhiGiaoHangDAL.TimKiemLePhiGiaoHang(lp);
     }
     catch (System.Exception ex)
     {
         Console.WriteLine("Message= {1}", ex.Message);
     }
     return null;
 }
コード例 #4
0
 public bool ThemLePhiGiaoHang(LePhiGiaoHang lp)
 {
     try
     {
         return this.lePhiGiaoHangDAL.ThemLePhiGiaoHang(lp);
     }
     catch (System.Exception ex)
     {
         Console.WriteLine("Message= {1}", ex.Message);
     }
     return false;
 }
コード例 #5
0
        public DataTable TimKiemLePhiGiaoHang(LePhiGiaoHang lp)
        {
            try
            {
                SqlParameter[] para = new SqlParameter[4];
                para[0] = new SqlParameter("@p_MaKhuVuc", lp.MaKhuVuc == null ? "" : lp.MaKhuVuc);
                para[1] = new SqlParameter("@p_TenKhuVuc", lp.TenKhuVuc == null ? "" : lp.TenKhuVuc);
                para[2] = new SqlParameter("@p_DonGia", lp.Dongia == null ? 0 : lp.Dongia);
                para[3] = new SqlParameter("@p_TOP", 100);
                DataTable lstKhuyenMai = LoadDataTable("LEPHIGIAOHANG_Search", para);

                return lstKhuyenMai;
            }
            catch (System.Exception ex)
            {
                Console.WriteLine("Message= {1}", ex.Message);
            }
            return null;
        }
コード例 #6
0
        public bool ThemLePhiGiaoHang(LePhiGiaoHang lp)
        {
            try
            {
                SqlParameter[] para = new SqlParameter[2];
                para[0] = new SqlParameter("@p_TenKhuVuc", lp.TenKhuVuc == null ? "" : lp.TenKhuVuc);
                para[1] = new SqlParameter("@p_DonGia", lp.Dongia == null ? 0 : lp.Dongia);

                int result = this.ExecuteNonQuery("LEPHIGIAOHANG_Ins", para);
                if (result != 0)
                {
                    return true;
                }
            }
            catch (System.Exception ex)
            {
                Console.WriteLine("Message= {1}", ex.Message);
            }

            return false;
        }
コード例 #7
0
        private void sbTimKiem_Click(object sender, EventArgs e)
        {
            LePhiGiaoHang gh = new LePhiGiaoHang();
            gh.TenKhuVuc = this.teTenKhuVuc.Text;
            gh.Dongia = this.teDonGia.Text == "" ? 0 : Convert.ToDecimal(this.teDonGia.Text);

            this.gcKetQua.DataSource = (new LePhiGiaoHangBUS().TimKiemLePhiGiaoHang(gh));
        }