Ejemplo n.º 1
0
        public static Boolean Delete(string maID)
        {
            SqlCommand cmd = new SqlCommand("delete Manager where maID=@maID");

            cmd.Parameters.AddWithValue("@maID", maID);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 2
0
        public static Boolean Delete(int requestID)
        {
            SqlCommand cmd = new SqlCommand("delete Request where requestID=@requestID");

            cmd.Parameters.AddWithValue("@requestID", requestID);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 3
0
        public static Boolean Delete(int id)
        {
            SqlCommand cmd = new SqlCommand("delete HistoryPayment where id=@id");

            cmd.Parameters.AddWithValue("@id", id);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 4
0
        public static Boolean DeleteRoom(string roomName)
        {
            SqlCommand cmd = new SqlCommand("delete Room where roomName=@roomName");

            cmd.Parameters.AddWithValue("@roomName", roomName);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 5
0
        public static Boolean Delete(string stuID)
        {
            SqlCommand cmd = new SqlCommand("delete Student where stuID=@stuID");

            cmd.Parameters.AddWithValue("@stuID", stuID);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 6
0
        public static bool Delete(ElectricityWaterBills ewb)
        {
            string     sql = "delete ElectricityWaterBills where id = @id";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@id", ewb.Id);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 7
0
        public static Boolean DeleteBedNo(string roomName, int bedNo)
        {
            SqlCommand cmd = new SqlCommand("delete Bed where bedNo=@bedNo AND roomName=@roomName");

            cmd.Parameters.AddWithValue("@bedNo", bedNo);
            cmd.Parameters.AddWithValue("@roomName", roomName);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 8
0
        public static bool Delete(HistoryBook hb)
        {
            string     sql = "delete HistoryBook where bookID = @bookID";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@bookID", hb.BookID);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 9
0
        public static bool Delete(Account a)
        {
            string     sql = "delete Account where username = @username and type = @type";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@username", a.Username);
            cmd.Parameters.AddWithValue("@type", a.Type);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 10
0
        public static bool Update(Account a) // Co update quyen cua user ko?
        {
            string     sql = "update Account set [password] = @password where username = @username and type = @type";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@password", a.Password);
            cmd.Parameters.AddWithValue("@username", a.Username);
            cmd.Parameters.AddWithValue("@type", a.Type);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 11
0
        // Unused
        public static bool Insert(Account a)
        {
            string     sql = "insert into Account (username, [password], [type]) values(@username, @password, @type)";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@username", a.Username);
            cmd.Parameters.AddWithValue("@password", a.Password);
            cmd.Parameters.AddWithValue("@type", a.Type);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 12
0
        public static bool Update(Request b)
        {
            SqlCommand cmd = new SqlCommand("update Request set maID=@maID,dateReply=@dateReply,reply=@reply where requestID=@requestID");

            cmd.Parameters.AddWithValue("@maID", b.MaID);
            cmd.Parameters.AddWithValue("@dateReply", b.DateReply);
            cmd.Parameters.AddWithValue("@reply", b.Reply);
            cmd.Parameters.AddWithValue("@requestID", b.RequestID);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 13
0
        public static bool Update(ElectricityWaterBills ewb)
        {
            string     sql = "update ElectricityWaterBills set soDien = @soDien, soNuoc = @soNuoc, paid = @paid where id = @id";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@id", ewb.Id);
            cmd.Parameters.AddWithValue("@soDien", ewb.SoDien);
            cmd.Parameters.AddWithValue("@soNuoc", ewb.SoNuoc);
            cmd.Parameters.AddWithValue("@paid", ewb.Paid);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 14
0
        public static bool Update(AvailibleBookingTime abt)
        {
            string     sql = "update AvailibleBookingTime set [from] = @from, [to] = @to where adID = @adID";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@from", abt.From);
            cmd.Parameters.AddWithValue("@to", abt.To);
            cmd.Parameters.AddWithValue("@adID", abt.AdID);

            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 15
0
        public static bool Update(HistoryPayment b)
        {
            SqlCommand cmd = new SqlCommand("update HistoryPayment set datePay=@datePay, type = @type, moneyPay = @moneyPay,roomName = @roomName where id=@id");

            cmd.Parameters.AddWithValue("@datePay", b.DatePay);
            cmd.Parameters.AddWithValue("@type", b.Type);
            cmd.Parameters.AddWithValue("@moneyPay", b.MoneyPay);
            cmd.Parameters.AddWithValue("@roomName", b.RoomName);
            cmd.Parameters.AddWithValue("@id", b.Id);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 16
0
        public static bool Update(Room b)
        {
            SqlCommand cmd = new SqlCommand("update Room set gender=@gender,price=@price where roomName=@roomName;update Bed set status=@status where roomName=@roomName1 AND bedNo=@bedNo;");

            cmd.Parameters.AddWithValue("@roomName", b.RoomName);
            cmd.Parameters.AddWithValue("@gender", b.Gender);
            cmd.Parameters.AddWithValue("@price", b.Price);
            cmd.Parameters.AddWithValue("@roomName1", b.RoomName);
            cmd.Parameters.AddWithValue("@bedNo", b.BedNo);
            cmd.Parameters.AddWithValue("@status", b.BedStatus);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 17
0
        // Get by month year??

        public static bool Insert(ElectricityWaterBills ewb)
        {
            string     sql = "insert into ElectricityWaterBills (roomName, monthYear, soDien, soNuoc, paid) values (@roomName, @monthYear, @soDien, @soNuoc, @paid)";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@roomName", ewb.RoomName);
            cmd.Parameters.AddWithValue("@monthYear", ewb.MonthYear);
            cmd.Parameters.AddWithValue("@soDien", ewb.SoDien);
            cmd.Parameters.AddWithValue("@soNuoc", ewb.SoNuoc);
            cmd.Parameters.AddWithValue("@paid", ewb.Paid);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 18
0
        public static bool Update(Manager b)
        {
            SqlCommand cmd = new SqlCommand("update Manager set dob=@dob,gender=@gender,mail=@mail,phoneNumber=@phoneNumber,name=@name where maID=@maID");

            cmd.Parameters.AddWithValue("@dob", b.Dob);
            cmd.Parameters.AddWithValue("@gender", b.Gender);
            cmd.Parameters.AddWithValue("@mail", b.Mail);
            cmd.Parameters.AddWithValue("@phoneNumber", b.PhoneNumber);
            cmd.Parameters.AddWithValue("@name", b.Name);
            cmd.Parameters.AddWithValue("@maID", b.MaID);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 19
0
        public static bool Insert(HistoryBook hb)
        {
            string     sql = "insert into HistoryBook (stuID, dateBook, roomName, bedNo, [status], dateExpiry) values (@stuID, @dateBook, @roomName, @bedNo, @status, @dateExpiry)";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@stuID", hb.StuID);
            cmd.Parameters.AddWithValue("@dateBook", hb.DateBook);
            cmd.Parameters.AddWithValue("@roomName", hb.RoomName);
            cmd.Parameters.AddWithValue("@bedNo", hb.BedNo);
            cmd.Parameters.AddWithValue("@status", hb.Status);
            cmd.Parameters.AddWithValue("@dateExpiry", hb.DateExpiry);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 20
0
        public static bool Update(HistoryBook hb)
        {
            string     sql = "update HistoryBook set stuID = @stuID, dateBook = @dateBook, roomName = @roomName, bedNo = @bedNo, [status] = @status, dateExpiry = @dateExpiry where bookID = @bookID";
            SqlCommand cmd = new SqlCommand(sql);

            cmd.Parameters.AddWithValue("@stuID", hb.StuID);
            cmd.Parameters.AddWithValue("@dateBook", hb.DateBook);
            cmd.Parameters.AddWithValue("@roomName", hb.RoomName);
            cmd.Parameters.AddWithValue("@bedNo", hb.BedNo);
            cmd.Parameters.AddWithValue("@status", hb.Status);
            cmd.Parameters.AddWithValue("@dateExpiry", hb.DateExpiry);
            cmd.Parameters.AddWithValue("@bookID", hb.BookID);
            return(DAO.UpdateTable(cmd));
        }
Ejemplo n.º 21
0
        public static bool Update(Student b)
        {
            SqlCommand cmd = new SqlCommand("update Student set name=@name, dob=@dob,gender=@gender,roomName=@roomName,bedNo=@bedNo,bookingDate=@bookingDate,moneyAccount=@moneyAccount,debt=@debt where stuID=@stuID");

            cmd.Parameters.AddWithValue("@name", b.Name);
            cmd.Parameters.AddWithValue("@dob", b.Dob);
            cmd.Parameters.AddWithValue("@gender", b.Gender);
            cmd.Parameters.AddWithValue("@roomName", b.RoomName);
            cmd.Parameters.AddWithValue("@bedNo", b.BedNo);
            cmd.Parameters.AddWithValue("@bookingDate", b.BookingDate);
            cmd.Parameters.AddWithValue("@moneyAccount", b.MoneyAccount);
            cmd.Parameters.AddWithValue("@debt", b.Debt);
            cmd.Parameters.AddWithValue("@stuID", b.StuID);
            return(DAO.UpdateTable(cmd));
        }