public NewNoteCommand(string s) { completeNote = string.IsNullOrWhiteSpace(s) ? "None" : s; WriteActions writeActions = new WriteActions(); writeActions.Write(s); }
/// <summary> /// Write new request into persistent data json file on Azure /// </summary> /// <param name="objNewRequest">New complex request object to save</param> /// <returns>Action result type to specified the insertion or update</returns> public WriteActions WriteRegister(RequestObject objNewRequest) { //Read registration file List <RequestObject> objListRequest = ReadRegisters(); //Specify if values is the request is alredy exists in the data file bool boolIsNew = true; WriteActions actionResult = WriteActions.None; //Check if ID exists on registers foreach (var item in objListRequest) { if (objNewRequest.ID == item.ID && objNewRequest.Type == item.Type) { //update existing request boolIsNew = false; item.Data = objNewRequest.Data; actionResult = WriteActions.Update; } } //if theres is no update on existing request if (boolIsNew) { objListRequest.Add(objNewRequest); actionResult = WriteActions.Creation; } //Upload new content in data file on azure GetCloudFile().UploadText(JsonConvert.SerializeObject(objListRequest)); return(actionResult); }
public IHttpActionResult SaveDeviceScene(SceneEntity sceneObj) { WriteActions.WriteDeviceScene(sceneObj); ReadActions.SaveCurrentLutronQuatumDetail(); return(Ok()); }
public IHttpActionResult SaveLightState(DeviceEntity deviceObj) { WriteActions.WriteLightState(deviceObj); ReadActions.SaveCurrentLutronQuatumDetail(); return(Ok()); }