private void button_Click(object sender, RoutedEventArgs e) { button.IsEnabled = false; buttonProgressBar.Visibility = System.Windows.Visibility.Visible; string url = meeting.server.address + "/api/meeting/stop"; StopInput input; input = new StopInput(meeting.server.login, meeting.server.sid, meeting.serverMeetingID.ToString()); new HttpPostRequest <StopInput, StatusReasonOutput>(url, editCallback, input); }
public override async Task <Tfplugin5.Stop.Types.Response> Stop( Tfplugin5.Stop.Types.Request request, ServerCallContext context) { _log.LogDebug(">>>{method}>>>", nameof(Stop)); _log.LogTrace($"->input[{nameof(request)}] = {{@request}}", request); _log.LogTrace($"->input[{nameof(context)}] = {{@context}}", context); try { if (_ProviderInstance == null) { throw new Exception("provider instance was not configured previously"); } var response = new Tfplugin5.Stop.Types.Response(); var plugin = SchemaHelper.GetPluginDetails(PluginAssembly); if (typeof(IHasStop).IsAssignableFrom(plugin.Provider)) { var invokeInput = new StopInput(); var invokeResult = (_ProviderInstance as IHasStop).Stop(invokeInput); if (invokeResult == null) { throw new Exception("invocation result returned null"); } if (!string.IsNullOrEmpty(invokeResult.Error)) { response.Error = invokeResult.Error; } } _log.LogTrace("<-result = {@response}", response); return(await Task.FromResult(response)); } catch (Exception ex) { _log.LogError(ex, "<!exception = "); throw; } }
public List <StopInput> stops() { List <StopInput> stops = new List <StopInput>(); string filePath = @".\Data\stopList.xlsx"; FileStream stream = File.Open(filePath, FileMode.Open, FileAccess.Read); IExcelDataReader excelReader; int counter = 0; if (Path.GetExtension(filePath).ToUpper() == ".XLS") { excelReader = ExcelReaderFactory.CreateBinaryReader(stream); } else { excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream); } while (excelReader.Read()) { counter++; if (counter > 1) { StopReason reason; switch (excelReader.GetString(0)) { case "Mola": reason = StopReason.Break; break; case "Arıza": reason = StopReason.Trouble; break; case "Setup": reason = StopReason.Setup; break; case "Arge": reason = StopReason.ArGe; break; default: reason = StopReason.Break; break; } string startDate = excelReader.GetString(1); string endDate = excelReader.GetString(2); var stopAdd = new StopInput() { StopReason = reason, StartDate = DateTime.Parse(startDate), EndDate = DateTime.Parse(endDate) }; stops.Add(stopAdd); } } excelReader.Close(); return(stops); }