Esempio n. 1
0
        public bool DongPhieuMuon(PhieuMuonSach pms)
        {
            OpenConnection();
            SqlCommand command = new SqlCommand();

            command.CommandType = CommandType.Text;
            command.CommandText = "Update PhieuMuonSach set NgayTraSach='" + pms.NgayTraSach + "' ,TrangThai=N'Đã Trả Sách' where PhieuId='" + pms.MaPhieuMuon + "'";
            command.Connection  = conn;
            int ketqua = command.ExecuteNonQuery();

            return(ketqua > 0);
        }
Esempio n. 2
0
        public bool XuLySachLoi(PhieuMuonSach pms)
        {
            OpenConnection();
            SqlCommand command = new SqlCommand();

            command.CommandType = CommandType.Text;
            command.CommandText = "update PhieuMuonSach set TrangThai=N'Sách lỗi đã được xử lý' where PhieuId='" + pms.MaPhieuMuon + "'";
            command.Connection  = conn;
            int ketqua = command.ExecuteNonQuery();

            return(ketqua > 0);
        }
Esempio n. 3
0
        public bool TuChoiPhieuChoMuon(PhieuMuonSach pms)
        {
            OpenConnection();
            SqlCommand command = new SqlCommand();

            command.CommandType = CommandType.Text;
            command.CommandText = "update PhieuMuonSach set TrangThai=N'Đọc giả không đến' " +
                                  "where PhieuId='" + pms.MaPhieuMuon + "'";
            command.Connection = conn;
            int ketqua = command.ExecuteNonQuery();

            return(ketqua > 0);
        }
Esempio n. 4
0
        public bool ChapThuanPhieuDuyet(PhieuMuonSach pms)
        {
            OpenConnection();
            SqlCommand command = new SqlCommand();

            command.CommandType = CommandType.Text;
            command.CommandText = "update PhieuMuonSach set TrangThai=N'Chờ đọc giả' " +
                                  "where PhieuId='" + pms.MaPhieuMuon + "'";
            command.Connection = conn;
            int ketqua = command.ExecuteNonQuery();

            return(ketqua > 0);
        }
Esempio n. 5
0
        public bool DocGiaTaoPhieu(PhieuMuonSach pms)
        {
            OpenConnection();
            SqlCommand command = new SqlCommand();

            command.CommandType = CommandType.Text;
            command.CommandText = "insert into PhieuMuonSach(NguoiMuonSachId,SachId,NgayMuon,NgayDuKienTra,TrangThai) " +
                                  "values('" + pms.NguoiMuonSachId + "','" + pms.SachId + "','" + pms.NgayMuon + "','" + pms.NgayDuKienTra + "',N'Chờ duyệt')" +
                                  " update Sach set TrangThai=N'Đang cho mượn' where Id='" + pms.SachId + "'";
            command.Connection = conn;
            int ketqua = command.ExecuteNonQuery();

            return(ketqua > 0);
        }
Esempio n. 6
0
 public bool Them(PhieuMuonSach pPhieuMuonSach)
 {
     try
     {
         string sql = string.Format("INSERT INTO PhieuMuonSach "
                                    + "VALUES (N'{0}',NULL,N'{2}')",
                                    pPhieuMuonSach.NgayMuon, pPhieuMuonSach.NgayTra, pPhieuMuonSach.MaDocGia);
         SqlCommand cmd = new SqlCommand(sql, _sqlConn);
         cmd.Connection.Open();
         cmd.ExecuteNonQuery();
         cmd.Connection.Close();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 7
0
        public bool Sua(PhieuMuonSach pPhieuMuonSach, string idx)
        {
            try
            {
                string sql = string.Format("UPDATE PhieuMuonSach " +
                                           "SET NgayMuon = '{0}', NgayTra = '{1}', MaDocGia = '{2}' " +
                                           "WHERE MaPhieuMuon = " + idx,
                                           pPhieuMuonSach.NgayMuon, pPhieuMuonSach.NgayTra,
                                           pPhieuMuonSach.MaDocGia);
                SqlCommand cmd = new SqlCommand(sql, _sqlConn);
                cmd.Connection.Open();
                cmd.ExecuteNonQuery();
                cmd.Connection.Close();

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Esempio n. 8
0
 private void detach_PhieuMuonSaches(PhieuMuonSach entity)
 {
     this.SendPropertyChanging();
     entity.NhanVien = null;
 }
Esempio n. 9
0
 partial void DeletePhieuMuonSach(PhieuMuonSach instance);
Esempio n. 10
0
 partial void UpdatePhieuMuonSach(PhieuMuonSach instance);
Esempio n. 11
0
 partial void InsertPhieuMuonSach(PhieuMuonSach instance);
Esempio n. 12
0
 private void attach_PhieuMuonSaches(PhieuMuonSach entity)
 {
     this.SendPropertyChanging();
     entity.SinhVien = this;
 }