Example #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (txtmasach.Text == "" || txtsoluong.Text == "")
     {
         MessageBox.Show("Nhập thiếu thông tin");
     }
     else
     {
         _ctphieuchi.Masach     = txtmasach.Text;
         _ctphieuchi.Maphieuchi = txtmaPhieuchi.Text;
         _ctphieuchi.Soluong    = Convert.ToInt16(txtsoluong.Text);
         _ctphieuchi.Tienchi    = _ctphieuchi.Soluong * DALSach.LaySachTheoMa(_ctphieuchi.Masach).GiaNhap;
         bool result = DALCTPhieuChi.ThemCTphieuchi(_ctphieuchi);
         if (result == true)
         {
             MessageBox.Show("Thêm thành công");
             DALCTPhieuChi.CapNhatKhiThemCT(_ctphieuchi);
             load();
             txtmasach.Text  = "";
             txtsoluong.Text = "";
         }
         else
         {
             MessageBox.Show("Thêm thất bại");
             txtmasach.Text  = "";
             txtsoluong.Text = "";
         }
     }
 }
Example #2
0
 private void FrmCTPhieuchiNXB_Load(object sender, EventArgs e)
 {
     GVCTPhieuchi.AutoGenerateColumns  = false;
     GVsachbanduoc.AutoGenerateColumns = false;
     txtmaPhieuchi.Text       = _maphieuchi;
     GVsachbanduoc.DataSource = DALCTPhieuChi.DSsachbanduoctheoNXB(_maNXB);
     load();
     if (DALPhieuChiNXB.layphieuchitheoma(txtmaPhieuchi.Text).TrangThai == "Đã nhận")
     {
         button1.Enabled = false;
     }
 }
Example #3
0
 public bool KiemTraSuaPhieuChi()
 {
     if (phieuchi.MaNXB != DALPhieuChiNXB.layphieuchitheoma(phieuchi.Maphieuchi).MaNXB)
     {
         if (DALCTPhieuChi.layCTPhieuchiTheoma(phieuchi.Maphieuchi) != null)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     else
     {
         return(true);
     }
 }
Example #4
0
 public void load()
 {
     GVCTPhieuchi.DataSource = DALCTPhieuChi.layDSCT(txtmaPhieuchi.Text);
 }