public void CreateOrUpdateServerSideDefinition(MeterDefinitionServerBased definition) { // get the entity var entity = AzureTableMeterDefinitionServerBased.FromModel(definition); // merge InsertOrMerge(entity, "MeterDefinitionServerBased"); }
public ActionResult Add() { // create the model var meterDefinition = new MeterDefinitionServerBased() { MeterId = Guid.NewGuid().ToString(), MeterType = client.Models.nMeterTypes.Heartbeat, MeterServerCheckType = "HTTP", MeterServerCheckInformation = String.Empty }; return(View("Add", meterDefinition)); }
public ActionResult Add(MeterDefinitionServerBased model) { // instantiate the meter manager var meterManagerEx = initializeMeterManager(); // store the meterdefinition to the settings meterManagerEx.CreateOrUpdateServerSideDefinition(model); // trigger the webjib AzureWebJobShutdownService.Peek(); // Render the meters return(RedirectToAction("Index")); }
public static AzureTableMeterDefinitionServerBased FromModel(MeterDefinitionServerBased model) { return(new AzureTableMeterDefinitionServerBased(model.MeterId, model.MeterServerCheckType) { MeterId = model.MeterId, MeterName = model.MeterName, MeterCategory = model.MeterCategory, MeterDisplayOrder = model.MeterDisplayOrder, MeterType = Convert.ToDouble(Convert.ToInt32(model.MeterType)), MeterValue = Convert.ToDouble(model.MeterValue), MeterServerCheckType = model.MeterServerCheckType, MeterServerCheckInterval = model.MeterServerCheckInterval, MeterServerCheckInformation = model.MeterServerCheckInformation }); }
public void CreateOrUpdateServerSideDefinition(MeterDefinitionServerBased definition) { MeterManagerRepository.CreateOrUpdateServerSideDefinition(definition); }