Exemple #1
0
        public static bool ThemPhong(Phong phong)
        {
            string query = "EXEC uspTaoPhong @maloaiphong";

            string ma = TaoMa.TaoMaPhong();

            List <SqlParameter> parameters = new List <SqlParameter>()
            {
                new SqlParameter("@maloaiphong", SqlDbType.NVarChar)
                {
                    Value = phong.TenLoai
                }
            };

            return(Dataprovider.ExcuteNonQuery(query, parameters.ToArray()) > 0);
        }
Exemple #2
0
        public static bool CapNhatPhong(Phong phong)
        {
            string query = "EXEC uspCapNhatPhong @maphong,@maloaiphong";

            List <SqlParameter> parameters = new List <SqlParameter>()
            {
                new SqlParameter("@maphong", SqlDbType.NVarChar)
                {
                    Value = phong.Ten
                },
                new SqlParameter("@maloaiphong", SqlDbType.NVarChar)
                {
                    Value = phong.TenLoai
                }
            };

            return(Dataprovider.ExcuteNonQuery(query, parameters.ToArray()) > 0);
        }
Exemple #3
0
        public bool SuaPhong(Phong P)
        {
            string query = "UPDATE Phong SET SUCCHUA = " + P.SucChua + ",SOSVHT = " + P.SoSVHT + ", MADAY = '" + P.MaDay + "',TRANGTHAI = N'" + P.TrangThai + "' WHERE SOPHONG = " + P.SoPhong;

            return(Connec.ThucThi(query));
        }
Exemple #4
0
        public bool ThemPhong(Phong P)
        {
            string query = "INSERT INTO Phong VALUES(" + P.SoPhong + "," + P.SucChua + "," + P.SoSVHT + ",'" + P.MaDay + "',N'" + P.TrangThai + "')";

            return(Connec.ThucThi(query));
        }