Exemple #1
0
 private void txtSTensach_TextChanged(object sender, EventArgs e)
 {
     PropertiesSearch();
     _search.Tensach = txtSTensach.Text;
     BUSSach bussach = new BUSSach(_search);
     GVSach.DataSource = bussach.timkiemSach();
     foreach(var row in bussach.timkiemSach())
     {
         txtMasach.Text = row.Masach.ToString();
     }
 }
 private void BtThem_Click(object sender, EventArgs e)
 {
     BUSSach bussach = new BUSSach();
     if (txtTensach.Text == "" || txtTacGia.Text == "" || txtGia.Text == "")
     {
         MessageBox.Show("Nhập thiếu thông tin");
     }
     else
     {
         sach.Masach = bussach.MaSachTuDong();
         ganProperties();
         bool result = DALSach.AddSach(sach);
         if (result == true)
         {
             MessageBox.Show("Thêm thành công");
             load();
         }
         else
         {
             MessageBox.Show("Thêm thất bại");
         }
     }
 }
Exemple #3
0
 private void FrmNhapCTSach_Load(object sender, EventArgs e)
 {
     GVSach.AutoGenerateColumns = false;
     GVCTPN.AutoGenerateColumns = false;
     txtMaPN.Text = _message;
     PropertiesSearch();
     _search.Tensach = "";
     BUSSach bussach = new BUSSach(_search);
     GVSach.DataSource = bussach.timkiemSach();
     load();
     if (DALPhieuNhap.LayPNtheoma(txtMaPN.Text).TinhTrang == "Đã xong")
     {
         BTLuu.Enabled = false;
         BTSua.Enabled = false;
         BTXoa.Enabled = false;
     }
 }
 private void btTim_Click(object sender, EventArgs e)
 {
     string maNXB = "", maTheloai = "";
     if (checkBox1.Checked == true)
     {
         maNXB = cbSNXB.SelectedValue.ToString();
     }
     if (checkBox2.Checked == true)
     {
         maTheloai = cbSTheLoai.SelectedValue.ToString();
     }
     _Search.Masach = txtSmasach.Text;
     _Search.MaNXB = maNXB;
     _Search.MaTheLoai = maTheloai;
     _Search.giatu = Convert.ToInt64(txtSgianhaptu.Text);
     _Search.giaden = Convert.ToInt64(txtSgianhapden.Text);
     _Search.Tensach = txtSTenSach.Text;
     _Search.gianhaptu = Convert.ToInt64(txtgianhaptu.Text);
     _Search.gianhapden = Convert.ToInt64(txtgianhapden.Text);
     BUSSach busSach = new BUSSach(_Search);
     GVSach.DataSource = busSach.timkiemSach();
     txtSgianhapden.Text = "0";
     txtSgianhaptu.Text = "0";
     txtSTenSach.Text = "";
     txtgianhaptu.Text = "0";
     txtgianhapden.Text = "0";
 }