public string changeState(int SN = 0) { Comm_Pet pet = PetModel.getPetBySN(SN); if (pet == null) { return("輸入的寵物編號有誤"); } string txt = "進美容室"; pet.isState = !pet.isState; PetModel.Update(pet); if (pet.isState == true) { txt = "離開美容室"; } return(txt); }
public ApiResponse Put([FromBody] PetModel pet) { return(pet.Update(Configuration.GetConnectionString("MySQL"))); }