public static bool Update(KhachSan ks) { object rs = DataProvider.Instance.ExecuteNonQuery("KhachSan_Update", ks.ID, ks.TenKS, ks.SoSao, ks.DiaChi, ks.SoDienThoai); int affected = MyConvert.ToInt32(rs); if (affected > 0) { return(true); } return(false); }
public static int Add(KhachSan ks) { try { object rs = DataProvider.Instance.ExecuteNonQueryWithOutput("@ID", "KhachSan_Add", ks.ID, ks.TenKS, ks.SoSao, ks.DiaChi, ks.SoDienThoai); int affected = MyConvert.ToInt32(rs); if (affected > 0) { return(int.Parse(rs.ToString())); } return(0); } catch { return(0); } }