public static void addRoom(Room room) { SqlParameter[] pams = new SqlParameter[] { new SqlParameter ("@Id",room.Id ), new SqlParameter ("@RoomNumber",room.RoomNumber), new SqlParameter ("@RoomType",room.RoomType ), new SqlParameter ("@RoomRate",room.RoomRate ), new SqlParameter ("@RoomState",room.RoomState ), }; SqlHelper.ExecuteNonQuery(AddRoomDAL .sql , pams); }
private void Button_Click(object sender, RoutedEventArgs e) { Room room = new Room(); room.Id = Guid.NewGuid(); room.RoomNumber = tbRoomNumber.Text; room.RoomRate =Convert .ToDecimal ( tbRoomRate.Text); room.RoomType = tbRoomType.Text; room.RoomState = "空"; AddRoomBLL.addRoom(room); tbRoomNumber.Text = ""; tbRoomRate.Text = ""; tbRoomType.Text = ""; RoomRefresh(sender, e); }
public static void addRoom(Room room) { AddRoomDAL.addRoom( room); }
public static void updateRoomData(string sql, Room room) { SqlParameter pams = new SqlParameter("@RoomNumber", room.RoomNumber); SqlHelper.ExecuteNonQuery(sql, pams); }
private void UpdateRoom(object sender, RoutedEventArgs e) { Room UpdateRoom = new Room(); UpdateRoom.RoomNumber = MainWondows.SelectRoomNumber; UpdateRoom.RoomRate = MainWondows.RoomRate; UpdateRoom.RoomType = MainWondows.RoomType; }