public JsonResult Control() { string constr = _configuration["ConnectionStrings:0"]; TempControl tempControl = new TempControl(); using (MySqlConnection con = new MySqlConnection(constr)) { con.Open(); using (MySqlCommand cmd = new MySqlCommand("get_control", con)) { cmd.CommandType = CommandType.StoredProcedure; using (MySqlDataReader reader = cmd.ExecuteReader()) { reader.Read(); tempControl.tempMode = reader.GetInt16("temp_mode"); tempControl.tempSetpoint = reader.GetFloat("temp_setpoint"); tempControl.tempSource = reader.GetInt16("temp_source"); tempControl.fanMode = reader.GetInt16("fan_mode"); } } } return(Json(tempControl)); }
public void NoSelectItem() { TempControl.Focus(); TempControl.Select(); }