public IActionResult getCurrentCurses() { try { CursModel c = new CursModel(); CURSES curses = c.GetCursOnDate(); return(View(curses)); } catch (Exception ex) { Console.WriteLine("controllerEX - " + ex.ToString()); return(View()); } }
public CURSES GetCursOnDate() { string tabl = string.Empty; DailyInfoSoapClient clientCurs = new DailyInfoSoapClient(DailyInfoSoapClient.EndpointConfiguration.DailyInfoSoap); Task <XElement> t = clientCurs.GetCursOnDateXMLAsync(DateTime.Now); XElement elemCurs = t.Result; Console.WriteLine("elemCurs - " + elemCurs.ToString()); XmlSerializer xmlSerializer = new XmlSerializer(typeof(CURSES)); CURSES curCurs = (CURSES)xmlSerializer.Deserialize(elemCurs.CreateReader()); Console.WriteLine("curCurs.Count - " + curCurs.Count); if (curCurs.Count == 0) { tabl = "Нет данных"; } Console.WriteLine("result - " + tabl); return(curCurs); }
#pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { BeginContext(130, 41, true); WriteLiteral("\r\n\r\n\r\n<!doctype html>\r\n<html lang=\"ru\">\r\n"); EndContext(); BeginContext(171, 123, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("head", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "58ae61aa8d8b412dbf258acd6693bcda", async() => { BeginContext(177, 110, true); WriteLiteral("\r\n <meta charset=\"utf-8\" />\r\n <title>\"Курс ЦБ\"</title>\r\n <link rel=\"stylesheet\" href=\"style.css\" />\r\n"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(294, 2, true); WriteLiteral("\r\n"); EndContext(); BeginContext(296, 3304, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("body", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "136be9f682ad444f8ef294549717a32b", async() => { BeginContext(302, 41, true); WriteLiteral("\r\n\r\n <p id=\"qrCode\"></p>\r\n\r\n\r\n\r\n\r\n\r\n\r\n"); EndContext(); #line 24 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" using (Html.BeginForm("Index", "Home", FormMethod.Post)) { #line default #line hidden BeginContext(413, 33, true); WriteLiteral(" <SELECT NAME=\"Valutes\">\r\n"); EndContext(); #line 27 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" try { VALUTES vals = ViewBag.Valutes; /*Model.GetValutes()*/; foreach (Val val in vals) { if (@val.Vname.Contains("Евро")) { #line default #line hidden BeginContext(733, 28, true); WriteLiteral(" "); EndContext(); BeginContext(761, 117, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("OPTION", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "5173b089dd184734a2807a2ff1c0b909", async() => { BeginContext(795, 34, true); WriteLiteral("\r\n "); EndContext(); BeginContext(830, 9, false); #line 36 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" Write(val.Vname); #line default #line hidden EndContext(); BeginContext(839, 30, true); WriteLiteral("\r\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper); BeginWriteTagHelperAttribute(); #line 35 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" WriteLiteral(val.Vcode); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("VALUE", __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("selected", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.Minimized); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(878, 2, true); WriteLiteral("\r\n"); EndContext(); #line 38 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" } else { #line default #line hidden BeginContext(964, 28, true); WriteLiteral(" "); EndContext(); BeginContext(992, 108, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("OPTION", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "5e87b1e847264175a824b72ec47dd781", async() => { BeginContext(1017, 34, true); WriteLiteral("\r\n "); EndContext(); BeginContext(1052, 9, false); #line 42 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" Write(val.Vname); #line default #line hidden EndContext(); BeginContext(1061, 30, true); WriteLiteral("\r\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper); BeginWriteTagHelperAttribute(); #line 41 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" WriteLiteral(val.Vcode); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("VALUE", __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1100, 2, true); WriteLiteral("\r\n"); EndContext(); #line 44 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" } } } catch (Exception ex) { #line default #line hidden BeginContext(1230, 20, true); WriteLiteral(" "); EndContext(); BeginContext(1250, 87, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("OPTION", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "3ba578e8faf3424893e77cef2e363fcb", async() => { BeginContext(1277, 26, true); WriteLiteral("\r\n "); EndContext(); BeginContext(1304, 2, false); #line 51 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" Write(ex); #line default #line hidden EndContext(); BeginContext(1306, 22, true); WriteLiteral("\r\n "); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.OptionTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper); BeginWriteTagHelperAttribute(); #line 50 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" WriteLiteral(ex); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("VALUE", __Microsoft_AspNetCore_Mvc_TagHelpers_OptionTagHelper.Value, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); BeginWriteTagHelperAttribute(); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __tagHelperExecutionContext.AddHtmlAttribute("selected", Html.Raw(__tagHelperStringValueBuffer), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.Minimized); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(1337, 2, true); WriteLiteral("\r\n"); EndContext(); #line 53 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" } #line default #line hidden BeginContext(1375, 21, true); WriteLiteral("\r\n </SELECT>\r\n"); EndContext(); BeginContext(1398, 238, true); WriteLiteral(" <input type=\"date\" name=\"StartDate\" />\r\n <input type=\"date\" name=\"EndDate\" />\r\n <button name=\"action\" value=\"GetCurCurs\">Текущий курс</button>\r\n <button name=\"action\" value=\"GetDynamicCurs\">Динамика</button>\r\n"); EndContext(); BeginContext(1638, 44, true); WriteLiteral(" <p>\r\n <table id=\"data\">\r\n"); EndContext(); #line 66 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" try { bool isCur = (bool)ViewBag.Act; if (isCur) { CURSES curs = ViewBag.CurCurs; /*Model.GetValutes()*/; foreach (CURS c in curs) { #line default #line hidden BeginContext(2040, 120, true); WriteLiteral(" <tr>\r\n <td>\r\n "); EndContext(); BeginContext(2161, 7, false); #line 78 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" Write(c.Vname); #line default #line hidden EndContext(); BeginContext(2168, 127, true); WriteLiteral("\r\n </td>\r\n <td>\r\n "); EndContext(); BeginContext(2296, 9, false); #line 81 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" Write(c.VchCode); #line default #line hidden EndContext(); BeginContext(2305, 127, true); WriteLiteral("\r\n </td>\r\n <td>\r\n "); EndContext(); BeginContext(2433, 7, false); #line 84 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" Write(c.Vcurs); #line default #line hidden EndContext(); BeginContext(2440, 84, true); WriteLiteral("\r\n </td>\r\n </tr>\r\n"); EndContext(); #line 87 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" } } else { DCURSES curs = ViewBag.DynCurs; /*Model.GetValutes()*/; foreach (DCURS c in curs) { #line default #line hidden BeginContext(2811, 120, true); WriteLiteral(" <tr>\r\n <td>\r\n "); EndContext(); BeginContext(2932, 10, false); #line 97 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" Write(c.CursDate); #line default #line hidden EndContext(); BeginContext(2942, 127, true); WriteLiteral("\r\n </td>\r\n <td>\r\n "); EndContext(); BeginContext(3070, 7, false); #line 100 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" Write(c.Vcode); #line default #line hidden EndContext(); BeginContext(3077, 127, true); WriteLiteral("\r\n </td>\r\n <td>\r\n "); EndContext(); BeginContext(3205, 7, false); #line 103 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" Write(c.Vcurs); #line default #line hidden EndContext(); BeginContext(3212, 84, true); WriteLiteral("\r\n </td>\r\n </tr>\r\n"); EndContext(); #line 106 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" } } } catch (Exception ex) { #line default #line hidden BeginContext(3471, 2, false); #line 113 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" Write(ex); #line default #line hidden EndContext(); #line 113 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" } #line default #line hidden BeginContext(3519, 38, true); WriteLiteral("\r\n </table>\r\n </p>\r\n"); EndContext(); #line 120 "C:\Users\admin\source\repos\WebApplication2\WebApplication2\Views\Home\Index.cshtml" } #line default #line hidden BeginContext(3566, 27, true); WriteLiteral(" <div>\r\n\r\n\r\n </div>\r\n"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3600, 9, true); WriteLiteral("\r\n</html>"); EndContext(); }