예제 #1
0
        private void but_luu_Click(object sender, EventArgs e)
        {
            if (txt_maphieu.Text == "")
            {
                MessageBox.Show("thông tin chưa được nhập");
                return;
            }
            phieumuontra pmt = new phieumuontra();

            pmt.maphieu    = txt_maphieu.Text;
            pmt.ngaymuon   = datengaymuon.Value;
            pmt.ngaytra    = datengaytra.Value;
            pmt.ngayhentra = datengaytra.Value;
            pmt.madg       = txt_madg.Text;
            pmt.matt       = txt_matt.Text;
            if (MessageBox.Show(string.Format("thêm thông tin phiếu mượn trả"), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.InsertProfile(pmt) > 0)
                {
                    MessageBox.Show("thông tin đã thêm");
                    Phieumuontra_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("Lỗi");
                }
            }
        }
예제 #2
0
        private void but_xoa_Click(object sender, EventArgs e)
        {
            if (txt_maphieu.Text == "")
            {
                MessageBox.Show("Thông tin chưa được chọn");
                return;
            }
            phieumuontra pmt = new phieumuontra();

            pmt.maphieu    = txt_maphieu.Text;
            pmt.ngaymuon   = datengaymuon.Value;
            pmt.madg       = cmbmadg.Text;
            pmt.matt       = cmbmatt.Text;
            pmt.ngaytra    = datengaytra.Value;
            pmt.ngayhentra = datengayhentra.Value;
            if (MessageBox.Show(string.Format("Xóa thông tin phiếu mượn trả"), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.DeleteProfile(pmt) > 0)
                {
                    MessageBox.Show("Đã Xóa");
                    Phieumuontra_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("Lỗi");
                }
            }
        }
예제 #3
0
        private void btnxoa_Click(object sender, EventArgs e)
        {
            if (txtmaphieu.Text == "")
            {
                MessageBox.Show("Thông tin chưa được chọn");
                return;
            }
            phieumuontra pmt = new phieumuontra();

            pmt.maphieu      = txtmaphieu.Text;
            pmt.matt         = cmbmatt.Text;
            pmt.madg         = cmbmadg.Text;
            pmt.socuonmuonve = Convert.ToInt32(txtsocuonmuonve.Text);

            if (MessageBox.Show(string.Format("Xóa thông tin phiếu mượn trả"), "", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                if (Bus.DeleteProfile(pmt) > 0)
                {
                    MessageBox.Show("Đã Xóa");
                    Phieumuontra_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("Lỗi");
                }
            }
        }
예제 #4
0
 public static int DeleteProfile(phieumuontra pmt)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@ma", pmt.maphieu)
     };
     return(DataProvider.ExecuteNonQuery("xoaphieumuontra", para));
 }
예제 #5
0
 public static int UpdateProfile(phieumuontra pmt)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@ma", pmt.maphieu),
         new SqlParameter("@ngaymuon", pmt.ngaymuon),
         new SqlParameter("@ngaytra", pmt.ngaytra),
         new SqlParameter("@ngayhentra", pmt.ngayhentra)
     };
     return(DataProvider.ExecuteNonQuery("suaphieumuontra", para));
 }
예제 #6
0
 public static int InsertProfile(phieumuontra pmt)
 {
     SqlParameter[] para = new SqlParameter[]
     {
         new SqlParameter("@ma", pmt.maphieu),
         new SqlParameter("@ngaymuon", pmt.ngaymuon),
         new SqlParameter("@ngaytra", pmt.ngaytra),
         new SqlParameter("@ngayhentra", pmt.ngayhentra),
         new SqlParameter("@matt", pmt.matt),
         new SqlParameter("@madg", pmt.madg)
     };
     return(DataProvider.ExecuteNonQuery("themphieumuontra", para));
 }
예제 #7
0
 public static int DeleteProfile(phieumuontra pmt)
 {
     return(Dao.DeleteProfile(pmt));
 }
예제 #8
0
 public static int UpdateProfile(phieumuontra pmt)
 {
     return(Dao.UpdateProfile(pmt));
 }
예제 #9
0
 public static int InsertProfile(phieumuontra pmt)
 {
     return(Dao.InsertProfile(pmt));
 }