Example #1
0
        public void SuaKhachThue(KhachThue khachthue)
        {
            int vitritim = ds.IndexOf(khachthue);

            if (vitritim > 0)
            {
                ds[vitritim] = khachthue;
            }
        }
Example #2
0
 public bool ThemKhachThue(KhachThue khachthue)
 {
     if (ds.Contains(khachthue))
     {
         return(false);
     }
     else
     {
         ds.Add(khachthue);
         return(true);
     }
 }
Example #3
0
 public bool XoaKhachThue(KhachThue khachthue)
 {
     if (khachthue != null)//tim thay
     {
         ds.Remove(khachthue);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #4
0
        // 3 nhap vao doi tuong => danh sach => listview
        private void btnTinhThue_Click(object sender, EventArgs e)
        {
            KhachThue khach = new KhachThue();

            khach.MaKhachHang  = Convert.ToInt32(txtMaKhachHang.Text);
            khach.TenKhachHang = txtHoTenKhachHang.Text;
            khach.SoLuong      = Convert.ToInt32(cboSoLuong.SelectedIndex.ToString());
            khach.DonGia       = Convert.ToInt32(txtDonGia.Text);
            if (chkDungHan2.Checked)
            {
                khach.TraDungTre = true;
            }
            else
            {
                khach.TraDungTre = false;
            }
            dskt.ThemKhachThue(khach);
            LoadDanhSachListView(dskt.GetAllDanhSach());
        }