Commit 6a7c34f8 6a7c34f878af296872fb7b7791ceb824b77d5c49 by d.a.korytko@gmail.com

Сохранение проекта

1 parent 2575c64b
Showing 1000 changed files with 3140 additions and 0 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using Microsoft.Web.WebPages.OAuth;
6 using ControlPanel.Models;
7
8 namespace ControlPanel
9 {
10 public static class AuthConfig
11 {
12 public static void RegisterAuth()
13 {
14 // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
15 // следует обновить сайт. Дополнительные сведения: http://go.microsoft.com/fwlink/?LinkID=252166
16
17 //OAuthWebSecurity.RegisterMicrosoftClient(
18 // clientId: "",
19 // clientSecret: "");
20
21 //OAuthWebSecurity.RegisterTwitterClient(
22 // consumerKey: "",
23 // consumerSecret: "");
24
25 //OAuthWebSecurity.RegisterFacebookClient(
26 // appId: "",
27 // appSecret: "");
28
29 //OAuthWebSecurity.RegisterGoogleClient();
30 }
31 }
32 }
1 using System.Web;
2 using System.Web.Optimization;
3
4 namespace ControlPanel
5 {
6 public class BundleConfig
7 {
8 // Дополнительные сведения о Bundling см. по адресу http://go.microsoft.com/fwlink/?LinkId=254725
9 public static void RegisterBundles(BundleCollection bundles)
10 {
11 bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
12 "~/Scripts/jquery-{version}.js"));
13
14 bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
15 "~/Scripts/jquery-ui-{version}.js"));
16
17 bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
18 "~/Scripts/jquery.unobtrusive*",
19 "~/Scripts/jquery.validate*"));
20
21 // Используйте версию Modernizr для разработчиков, чтобы учиться работать. Когда вы будете готовы перейти к работе,
22 // используйте средство построения на сайте http://modernizr.com, чтобы выбрать только нужные тесты.
23 bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
24 "~/Scripts/modernizr-*"));
25
26 bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
27
28
29 bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
30 "~/Content/themes/base/jquery.ui.core.css",
31 "~/Content/themes/base/jquery.ui.resizable.css",
32 "~/Content/themes/base/jquery.ui.selectable.css",
33 "~/Content/themes/base/jquery.ui.accordion.css",
34 "~/Content/themes/base/jquery.ui.autocomplete.css",
35 "~/Content/themes/base/jquery.ui.button.css",
36 "~/Content/themes/base/jquery.ui.dialog.css",
37 "~/Content/themes/base/jquery.ui.slider.css",
38 "~/Content/themes/base/jquery.ui.tabs.css",
39 "~/Content/themes/base/jquery.ui.datepicker.css",
40 "~/Content/themes/base/jquery.ui.progressbar.css",
41 "~/Content/themes/base/jquery.ui.theme.css"));
42 }
43 }
44 }
...\ No newline at end of file ...\ No newline at end of file
1 using System.Web;
2 using System.Web.Mvc;
3
4 namespace ControlPanel
5 {
6 public class FilterConfig
7 {
8 public static void RegisterGlobalFilters(GlobalFilterCollection filters)
9 {
10 filters.Add(new HandleErrorAttribute());
11 }
12 }
13 }
...\ No newline at end of file ...\ No newline at end of file
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Web;
5 using System.Web.Mvc;
6 using System.Web.Routing;
7
8 namespace ControlPanel
9 {
10 public class RouteConfig
11 {
12 public static void RegisterRoutes(RouteCollection routes)
13 {
14 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15
16 routes.MapRoute(
17 name: "Default",
18 url: "{controller}/{action}/{id}",
19 defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
20 );
21 }
22 }
23 }
...\ No newline at end of file ...\ No newline at end of file
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Web.Http;
5
6 namespace ControlPanel
7 {
8 public static class WebApiConfig
9 {
10 public static void Register(HttpConfiguration config)
11 {
12 config.Routes.MapHttpRoute(
13 name: "DefaultApi",
14 routeTemplate: "api/{controller}/{id}",
15 defaults: new { id = RouteParameter.Optional }
16 );
17 }
18 }
19 }

813 Bytes

1 /*!
2 * jQuery UI Accordion 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Accordion#theming
9 */
10 /* IE/Win - Fix animation bug - #4615 */
11 .ui-accordion { width: 100%; }
12 .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
13 .ui-accordion .ui-accordion-li-fix { display: inline; }
14 .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
15 .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
16 .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
17 .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
18 .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
19 .ui-accordion .ui-accordion-content-active { display: block; }
1 /*!
2 * jQuery UI CSS Framework 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Theming
9 */
10 @import "jquery.ui.base.css";
11 @import "jquery.ui.theme.css";
1 /*!
2 * jQuery UI Autocomplete 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Autocomplete#theming
9 */
10 .ui-autocomplete { position: absolute; cursor: default; }
11
12 /* workarounds */
13 * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
14
15 /*
16 * jQuery UI Menu 1.8.20
17 *
18 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
19 * Licensed under the MIT license.
20 * http://jquery.org/license
21 *
22 * http://docs.jquery.com/UI/Menu#theming
23 */
24 .ui-menu {
25 list-style:none;
26 padding: 2px;
27 margin: 0;
28 display:block;
29 float: left;
30 }
31 .ui-menu .ui-menu {
32 margin-top: -3px;
33 }
34 .ui-menu .ui-menu-item {
35 margin:0;
36 padding: 0;
37 zoom: 1;
38 float: left;
39 clear: left;
40 width: 100%;
41 }
42 .ui-menu .ui-menu-item a {
43 text-decoration:none;
44 display:block;
45 padding:.2em .4em;
46 line-height:1.5;
47 zoom:1;
48 }
49 .ui-menu .ui-menu-item a.ui-state-hover,
50 .ui-menu .ui-menu-item a.ui-state-active {
51 font-weight: normal;
52 margin: -1px;
53 }
1 /*!
2 * jQuery UI CSS Framework 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Theming
9 */
10 @import url("jquery.ui.core.css");
11
12 @import url("jquery.ui.accordion.css");
13 @import url("jquery.ui.autocomplete.css");
14 @import url("jquery.ui.button.css");
15 @import url("jquery.ui.datepicker.css");
16 @import url("jquery.ui.dialog.css");
17 @import url("jquery.ui.progressbar.css");
18 @import url("jquery.ui.resizable.css");
19 @import url("jquery.ui.selectable.css");
20 @import url("jquery.ui.slider.css");
21 @import url("jquery.ui.tabs.css");
1 /*!
2 * jQuery UI Button 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Button#theming
9 */
10 .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
11 .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
12 button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
13 .ui-button-icons-only { width: 3.4em; }
14 button.ui-button-icons-only { width: 3.7em; }
15
16 /*button text element */
17 .ui-button .ui-button-text { display: block; line-height: 1.4; }
18 .ui-button-text-only .ui-button-text { padding: .4em 1em; }
19 .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
20 .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
21 .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
22 .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
23 /* no icon support for input elements, provide padding by default */
24 input.ui-button { padding: .4em 1em; }
25
26 /*button icon element(s) */
27 .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
28 .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
29 .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
30 .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
31 .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
32
33 /*button sets*/
34 .ui-buttonset { margin-right: 7px; }
35 .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
36
37 /* workarounds */
38 button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
1 /*!
2 * jQuery UI CSS Framework 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Theming/API
9 */
10
11 /* Layout helpers
12 ----------------------------------*/
13 .ui-helper-hidden { display: none; }
14 .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15 .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16 .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
17 .ui-helper-clearfix:after { clear: both; }
18 .ui-helper-clearfix { zoom: 1; }
19 .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
20
21
22 /* Interaction Cues
23 ----------------------------------*/
24 .ui-state-disabled { cursor: default !important; }
25
26
27 /* Icons
28 ----------------------------------*/
29
30 /* states and images */
31 .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
32
33
34 /* Misc visuals
35 ----------------------------------*/
36
37 /* Overlays */
38 .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
1 /*!
2 * jQuery UI Datepicker 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Datepicker#theming
9 */
10 .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
11 .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
12 .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
13 .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
14 .ui-datepicker .ui-datepicker-prev { left:2px; }
15 .ui-datepicker .ui-datepicker-next { right:2px; }
16 .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
17 .ui-datepicker .ui-datepicker-next-hover { right:1px; }
18 .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
19 .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
20 .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
21 .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
22 .ui-datepicker select.ui-datepicker-month,
23 .ui-datepicker select.ui-datepicker-year { width: 49%;}
24 .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
25 .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
26 .ui-datepicker td { border: 0; padding: 1px; }
27 .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
28 .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
29 .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
30 .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
31
32 /* with multiple calendars */
33 .ui-datepicker.ui-datepicker-multi { width:auto; }
34 .ui-datepicker-multi .ui-datepicker-group { float:left; }
35 .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
36 .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
37 .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
38 .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
39 .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
40 .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
41 .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
42 .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
43
44 /* RTL support */
45 .ui-datepicker-rtl { direction: rtl; }
46 .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
47 .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
48 .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
49 .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
50 .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
51 .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
52 .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
53 .ui-datepicker-rtl .ui-datepicker-group { float:right; }
54 .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
55 .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
56
57 /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
58 .ui-datepicker-cover {
59 display: none; /*sorry for IE5*/
60 display/**/: block; /*sorry for IE5*/
61 position: absolute; /*must have*/
62 z-index: -1; /*must have*/
63 filter: mask(); /*must have*/
64 top: -4px; /*must have*/
65 left: -4px; /*must have*/
66 width: 200px; /*must have*/
67 height: 200px; /*must have*/
68 }
...\ No newline at end of file ...\ No newline at end of file
1 /*!
2 * jQuery UI Dialog 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Dialog#theming
9 */
10 .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
11 .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
12 .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
13 .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
14 .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
15 .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
16 .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
17 .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
18 .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
19 .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
20 .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
21 .ui-draggable .ui-dialog-titlebar { cursor: move; }
1 /*!
2 * jQuery UI Progressbar 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Progressbar#theming
9 */
10 .ui-progressbar { height:2em; text-align: left; overflow: hidden; }
11 .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
...\ No newline at end of file ...\ No newline at end of file
1 /*!
2 * jQuery UI Resizable 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Resizable#theming
9 */
10 .ui-resizable { position: relative;}
11 .ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
12 .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
13 .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
14 .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
15 .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
16 .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
17 .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
18 .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
19 .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
20 .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
...\ No newline at end of file ...\ No newline at end of file
1 /*!
2 * jQuery UI Selectable 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Selectable#theming
9 */
10 .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
1 /*!
2 * jQuery UI Slider 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Slider#theming
9 */
10 .ui-slider { position: relative; text-align: left; }
11 .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
12 .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
13
14 .ui-slider-horizontal { height: .8em; }
15 .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
16 .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
17 .ui-slider-horizontal .ui-slider-range-min { left: 0; }
18 .ui-slider-horizontal .ui-slider-range-max { right: 0; }
19
20 .ui-slider-vertical { width: .8em; height: 100px; }
21 .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
22 .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
23 .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
24 .ui-slider-vertical .ui-slider-range-max { top: 0; }
...\ No newline at end of file ...\ No newline at end of file
1 /*!
2 * jQuery UI Tabs 1.8.20
3 *
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Licensed under the MIT license.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Tabs#theming
9 */
10 .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
11 .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
12 .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
13 .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
14 .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
15 .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
16 .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
17 .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
18 .ui-tabs .ui-tabs-hide { display: none !important; }
1 /*! jQuery UI - v1.8.20 - 2012-04-30
2 * https://github.com/jquery/jquery-ui
3 * Includes: jquery.ui.accordion.css
4 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
5 .ui-accordion{width:100%}.ui-accordion .ui-accordion-header{cursor:pointer;position:relative;margin-top:1px;zoom:1}.ui-accordion .ui-accordion-li-fix{display:inline}.ui-accordion .ui-accordion-header-active{border-bottom:0!important}.ui-accordion .ui-accordion-header a{display:block;font-size:1em;padding:.5em .5em .5em .7em}.ui-accordion-icons .ui-accordion-header a{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;margin-top:-2px;position:relative;top:1px;margin-bottom:2px;overflow:auto;display:none;zoom:1}.ui-accordion .ui-accordion-content-active{display:block}
...\ No newline at end of file ...\ No newline at end of file
1 /*! jQuery UI - v1.8.20 - 2012-04-30
2 * https://github.com/jquery/jquery-ui
3 * Includes: jquery.ui.autocomplete.css
4 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
5 .ui-autocomplete{position:absolute;cursor:default}* html .ui-autocomplete{width:1px}.ui-menu{list-style:none;padding:2px;margin:0;display:block;float:left}.ui-menu .ui-menu{margin-top:-3px}.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;float:left;clear:left;width:100%}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:.2em .4em;line-height:1.5;zoom:1}.ui-menu .ui-menu-item a.ui-state-hover,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}
...\ No newline at end of file ...\ No newline at end of file
1 /*! jQuery UI - v1.8.20 - 2012-04-30
2 * https://github.com/jquery/jquery-ui
3 * Includes: jquery.ui.button.css
4 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
5 .ui-button{display:inline-block;position:relative;padding:0;margin-right:.1em;text-decoration:none!important;cursor:pointer;text-align:center;zoom:1;overflow:visible}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:1.4}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-inner{border:0;padding:0}
...\ No newline at end of file ...\ No newline at end of file
1 /*! jQuery UI - v1.8.20 - 2012-04-30
2 * https://github.com/jquery/jquery-ui
3 * Includes: jquery.ui.core.css
4 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
5 .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px);clip:rect(1px,1px,1px,1px)}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{zoom:1}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}
...\ No newline at end of file ...\ No newline at end of file
1 /*! jQuery UI - v1.8.20 - 2012-04-30
2 * https://github.com/jquery/jquery-ui
3 * Includes: jquery.ui.datepicker.css
4 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
5 .ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0em}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right}.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-cover{display:none;display position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px}
...\ No newline at end of file ...\ No newline at end of file
1 /*! jQuery UI - v1.8.20 - 2012-04-30
2 * https://github.com/jquery/jquery-ui
3 * Includes: jquery.ui.dialog.css
4 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
5 .ui-dialog{position:absolute;padding:.2em;width:300px;overflow:hidden}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 16px .1em 0}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:19px;margin:-10px 0 0 0;padding:1px;height:18px}.ui-dialog .ui-dialog-titlebar-close span{display:block;margin:1px}.ui-dialog .ui-dialog-titlebar-close:hover,.ui-dialog .ui-dialog-titlebar-close:focus{padding:0}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto;zoom:1}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px}.ui-draggable .ui-dialog-titlebar{cursor:move}
...\ No newline at end of file ...\ No newline at end of file
1 /*! jQuery UI - v1.8.20 - 2012-04-30
2 * https://github.com/jquery/jquery-ui
3 * Includes: jquery.ui.progressbar.css
4 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
5 .ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}
...\ No newline at end of file ...\ No newline at end of file
1 /*! jQuery UI - v1.8.20 - 2012-04-30
2 * https://github.com/jquery/jquery-ui
3 * Includes: jquery.ui.resizable.css
4 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
5 .ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}
...\ No newline at end of file ...\ No newline at end of file
1 /*! jQuery UI - v1.8.20 - 2012-04-30
2 * https://github.com/jquery/jquery-ui
3 * Includes: jquery.ui.selectable.css
4 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
5 .ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}
...\ No newline at end of file ...\ No newline at end of file
1 /*! jQuery UI - v1.8.20 - 2012-04-30
2 * https://github.com/jquery/jquery-ui
3 * Includes: jquery.ui.slider.css
4 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
5 .ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}
...\ No newline at end of file ...\ No newline at end of file
1 /*! jQuery UI - v1.8.20 - 2012-04-30
2 * https://github.com/jquery/jquery-ui
3 * Includes: jquery.ui.tabs.css
4 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
5 .ui-tabs{position:relative;padding:.2em;zoom:1}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:1px;margin:0 .2em 1px 0;border-bottom:0!important;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-selected{margin-bottom:0;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-selected a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-state-processing a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tabs .ui-tabs-hide{display:none!important}
...\ No newline at end of file ...\ No newline at end of file
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Web;
5 using ControlPanel.Interfaces.Strategys;
6 using ControlPanel.Contexts;
7 using ControlPanel.Models;
8
9
10 namespace ControlPanel.Contexts
11 {
12 public class ContextConvert<T>
13 {
14 private IConvertToExt<T> _strategy;
15
16 public ContextConvert(IConvertToExt<T> strategy)
17 {
18 _strategy = strategy;
19 }
20
21 /// <summary>
22 /// Устанавливаем стратегию конвертирование
23 /// </summary>
24 /// <param name="strategy"></param>
25 public void SetStrategy(IConvertToExt<T> strategy)
26 {
27 _strategy = strategy;
28 }
29
30 public object ExecuteOperation(T message)
31 {
32 return _strategy.New(message);
33 }
34
35 }
36 }
37
38
39
40
This diff could not be displayed because it is too large.
1 <Configurations active="Default"><Configuration name="Default"><GuestCommandRemote val="project command through a shared folder"></GuestCommandRemote><ShareFoldersRemote val=""></ShareFoldersRemote><RemoteDebugMonitor val="C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe"></RemoteDebugMonitor><MonitorName val="VMDebug"></MonitorName><RemoteVM val=""></RemoteVM><StartMode val="No"></StartMode><TerminationModeRemote val="No operation"></TerminationModeRemote><CopyFilesRemote val=""></CopyFilesRemote><PreRemoteCommandLine val=""></PreRemoteCommandLine><PostRemoteCommandLine val=""></PostRemoteCommandLine><RecordingToReplay val=""></RecordingToReplay><ReplayVM val=""></ReplayVM><BaseSnapshotForRecording val=""></BaseSnapshotForRecording><CopyFilesRecord val=""></CopyFilesRecord><PreRecordCommandLine val=""></PreRecordCommandLine><PostRecordCommandLine val=""></PostRecordCommandLine><TerminationModeRecord val="No operation"></TerminationModeRecord><InstanceToDebug val=""></InstanceToDebug><GuestCommandReplay val="project command through a shared folder"></GuestCommandReplay><ShareFoldersRecord val=""></ShareFoldersRecord><RemoteReplayFlag val=""></RemoteReplayFlag><RemoteMachine val=""></RemoteMachine><RemoteReplayVM val=""></RemoteReplayVM><RemoteRecordingToReplay val=""></RemoteRecordingToReplay><RemoteReplayPasscode val=""></RemoteReplayPasscode><HostSearchPath val=""></HostSearchPath></Configuration></Configurations>
1 
2 Microsoft Visual Studio Solution File, Format Version 12.00
3 # Visual Studio 2013
4 VisualStudioVersion = 12.0.21005.1
5 MinimumVisualStudioVersion = 10.0.40219.1
6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlPanel", "ControlPanel.csproj", "{D8F3B13E-7A1C-4C8B-82A9-887823F4EE38}"
7 EndProject
8 Global
9 GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 Debug|Any CPU = Debug|Any CPU
11 Release|Any CPU = Release|Any CPU
12 EndGlobalSection
13 GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 {D8F3B13E-7A1C-4C8B-82A9-887823F4EE38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 {D8F3B13E-7A1C-4C8B-82A9-887823F4EE38}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 {D8F3B13E-7A1C-4C8B-82A9-887823F4EE38}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 {D8F3B13E-7A1C-4C8B-82A9-887823F4EE38}.Release|Any CPU.Build.0 = Release|Any CPU
18 EndGlobalSection
19 GlobalSection(SolutionProperties) = preSolution
20 HideSolutionNode = FALSE
21 EndGlobalSection
22 EndGlobal
1 
2 using System;
3 using System.Collections.Generic;
4 using System.Linq;
5 using System.Net;
6 using Newtonsoft.Json.Linq;
7 using ControlPanel.Models;
8 using System.Runtime.Serialization;
9 using ControlPanel.LogicLayers;
10 using ControlPanel.Models.Extend;
11 using System.Web;
12 using System.Web.Mvc;
13
14 namespace ControlPanel.Controllers
15 {
16
17 public class AgksController : Controller
18 {
19
20 public JObject Get()
21 {
22
23 List<ExtAgk> lstExtAgk = new List<ExtAgk>();
24
25 try
26 {
27
28 lstExtAgk = LogicAgk.instance.GetExtAgk();
29
30 lstExtAgk.Sort(delegate(ExtAgk obj1, ExtAgk obj2)
31 { return obj1.title.CompareTo(obj2.title); });
32
33
34 }
35 catch (Exception ex)
36 {
37 //
38 }
39
40 JObject result = JObject.FromObject(new
41 {
42 agks = lstExtAgk,
43 success = true,
44 total = 0
45 });
46
47 return result;
48
49 }
50
51
52 public JObject GetLog(int page, int start, int limit)
53 {
54
55 List<Agk> lstAgk = new List<Agk>();
56
57 try
58 {
59
60 lstAgk = LogicAgk.instance.Log(page, start, limit);
61
62 lstAgk.Sort(delegate(Agk obj1, Agk obj2)
63 { return obj1.id.CompareTo(obj2.id); });
64
65
66 }
67 catch (Exception ex)
68 {
69 //
70 }
71
72 JObject result = JObject.FromObject(new
73 {
74 agks = lstAgk,
75 total =LogicAgk.instance.Count()
76 });
77
78 return result;
79
80 }
81
82
83
84
85
86
87
88 }
89 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5 using System.Net.Http;
6 using System.Web.Http;
7 using Newtonsoft.Json.Linq;
8 using ControlPanel.Models;
9 using System.Runtime.Serialization;
10 using ControlPanel.LogicLayers;
11
12 namespace ControlPanel.Controllers
13 {
14
15 public class ConfirmLevelsRiversController : ApiController
16 {
17 // GET api/confirmlevelsrivers
18 public IEnumerable<string> Get()
19 {
20 return new string[] { "value1", "value2" };
21 }
22
23 // GET api/confirmlevelsrivers/5
24 public string Get(int id)
25 {
26 return "value";
27 }
28
29 // POST api/getlevelsrivers
30 public string Post(JObject data)
31 {
32 string error = "";
33
34
35 try
36 {
37
38 var RegKey = data["RegKey"];
39 var id_webapi_message = data["id_webapi_message"];
40 var id_agk = data["id_agk"];
41
42 List<LevelRiversEmpty> lstLevelRiverEmpty = new List<LevelRiversEmpty>();
43
44
45
46 LogicEvents.instance.Confirm(id_webapi_message.ToString(),id_agk.ToString(), RegKey.ToString());
47
48
49 }
50 catch (Exception ex)
51 {
52 error=ex.Message;
53 }
54
55
56 return error;
57
58 }
59
60 // PUT api/confirmlevelsrivers/5
61 public void Put(int id, [FromBody]string value)
62 {
63 }
64
65 // DELETE api/confirmlevelsrivers/5
66 public void Delete(int id)
67 {
68 }
69 }
70 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5 using System.Net.Http;
6 using System.Web.Http;
7 using Newtonsoft.Json.Linq;
8 using ControlPanel.Models;
9 using System.Runtime.Serialization;
10 using ControlPanel.LogicLayers;
11 using System.Xml;
12 using System.Net;
13
14 using ControlPanel.Models.Response;
15
16
17 namespace ControlPanel.Controllers
18 {
19 public class DataSzsController : ApiController
20 {
21
22 /// <summary>
23 /// Получение неподтвержденных сообщений для подписчика
24 /// </summary>
25 /// <param name="data"></param>
26 /// <returns></returns>
27 public JObject Post(JObject data)
28 {
29 List<LevelRiverAlarm> lastlevelrivers = new List<LevelRiverAlarm>();
30 List<LevelRiverAlarm> notconfirmlevelrivers = new List<LevelRiverAlarm>();
31 List<Route> lstRoute = new List<Route>();
32 List<Agk> lstAgk = new List<Agk>();
33
34 LevelRiverAlarm alarmlevelriver = null; // событие для подтверждения
35
36 string Subscriber = "";
37 string titlecontact = "";
38 bool siren = false; // не включать сирену
39
40
41 try
42 {
43 var RegKey = data["RegKey"];
44 var vers = data["SoftVersion"];
45 var IDTeamViewer = data["IDTeamViewer"];
46
47 bool claim = false; // не требует помощи
48 try
49 {
50 var Claim = data["claim"];
51 claim = Convert.ToBoolean(Claim.ToString());
52 }
53 catch(Exception)
54 {
55 }
56
57 string key = RegKey.ToString();
58 LogicLiveSubscribers.instance.UpdateStatusSubscriver(key, vers.ToString());
59 LogicLiveSubscribers.instance.UpdateClaimSubscriver(key, claim);
60
61 try
62 {
63 // Получаем маршруты для данного СЗС
64 lstRoute = LogicRouts.instance.GetRoutsByRegKey(key);
65
66 // Получаем список АГК
67 foreach (Route route in lstRoute)
68 {
69 Agk agk = LogicAgk.instance.GetById(route.RefRouteAgk.id);
70 lstAgk.Add(agk);
71 }
72 }
73 catch (Exception e)
74 {
75
76 }
77
78 try
79 {
80 // неподтвержденные события
81 notconfirmlevelrivers = LogicLevelsRivers.instance.GetNotConfirmLevelRivers(lstRoute);
82
83
84 }
85 catch (Exception e)
86 {
87
88 }
89
90 try
91 {
92
93 if (notconfirmlevelrivers.Count > 0)
94 {
95
96 notconfirmlevelrivers.Sort(delegate(LevelRiverAlarm obj1, LevelRiverAlarm obj2)
97 { return obj1.id.CompareTo(obj2.id); });
98
99
100 alarmlevelriver = notconfirmlevelrivers[0];
101
102 }
103
104 }
105 catch (Exception e)
106 {
107
108 }
109
110 try
111 {
112 // текущее состояние по всем станциям
113 lastlevelrivers = LogicLevelsRivers.instance.GetLastLevelRivers(lstRoute);
114
115 }
116 catch (Exception e)
117 {
118
119 }
120
121
122 try
123 {
124 // название населенного пункта
125 List<Subscribers> lstSub = LogicSubscribers.instance.GetSubByRegKey(key);
126 Subscriber = lstSub[0].Name;
127 titlecontact = lstSub[0].phoneszs;
128 siren = lstSub[0].siren;
129
130 Subscribers sub = lstSub[0];
131 sub.idteamviewer = (string)IDTeamViewer;
132 LogicSubscribers.instance.Uodate(sub);
133
134 }
135 catch (Exception e)
136 {
137
138 }
139 }
140 catch (Exception ex)
141 {
142 }
143
144
145
146 List<EventAgk> lrlast = new List<EventAgk>();
147
148 foreach (LevelRiverAlarm obj in lastlevelrivers)
149 {
150 int id_status;
151
152 if (obj.causeevent == "ня")
153 id_status = 1;
154 else if (obj.causeevent == "оя")
155 id_status = 2;
156 else
157 id_status=0;
158
159 try
160 {
161
162 Agk objagk = LogicAgk.instance.GetById(obj.RefMessageAgk.id);
163
164 EventAgk eventagk = new EventAgk
165 {
166 id=obj.id,
167 id_agk=objagk.number,
168 river = obj.installplace,
169 datetime=obj.datetimedevice.ToString("dd.MM.yyyy HH:mm:ss"),
170 value=obj.levelbsv.ToString(),
171 id_status=id_status,
172 repair=obj.repair, // true -repair; false- no repair
173 opendoor=obj.opendoor, // true - open; false-close
174 veracity=obj.datetimeveracity, // veracity -true, no veracity -false;
175 };
176
177 lrlast.Add(eventagk);
178 }
179 catch (Exception e)
180 {
181
182 }
183
184 }
185
186
187 List<EventAgk> lralarm= new List<EventAgk>();
188
189 if (alarmlevelriver != null)
190 {
191
192 int id_status;
193
194 if (alarmlevelriver.causeevent == "ня")
195 id_status = 1;
196 else if (alarmlevelriver.causeevent == "оя")
197 id_status = 2;
198 else
199 id_status = 0;
200
201 Agk objagk1 = LogicAgk.instance.GetById(alarmlevelriver.RefMessageAgk.id);
202
203
204 EventAgk eventagk = new EventAgk
205 {
206 id = alarmlevelriver.id,
207 id_agk = objagk1.number,
208 river = alarmlevelriver.installplace,
209 datetime = alarmlevelriver.datetimedevice.ToString("dd.MM.yyyy HH:mm:ss"),
210 value = alarmlevelriver.levelbsv.ToString(),
211 id_status=id_status,
212 repair = alarmlevelriver.repair, // true -repair; false- no repair
213 opendoor = alarmlevelriver.opendoor, // true - open; false-close
214 veracity = alarmlevelriver.datetimeveracity, // veracity -true, no veracity -false;
215 };
216 lralarm.Add( eventagk);
217
218 }
219 else
220 {
221
222 }
223
224 JObject result = JObject.FromObject(new
225 {
226 titlesubscriber=Subscriber,
227 titlecontact=titlecontact,
228 siren=siren,
229 lsteventagkconfirm=lralarm,
230 lsteventagkstate=lrlast
231 });
232
233
234 // StreamWriter.WriteLine(result);
235 // Обновляем поле S2 в таблице Event для каждого сообщения
236
237 List<LevelRiver> lr = new List<LevelRiver>();
238
239 try
240 {
241 LevelRiver o = new LevelRiver
242 {
243 id = alarmlevelriver.id,
244 RefMessageAgk = alarmlevelriver.RefMessageAgk,
245 datetimedevice = alarmlevelriver.datetimedevice,
246 datetimeveracity = alarmlevelriver.datetimeveracity,
247 datetimeserver = alarmlevelriver.datetimeserver,
248 latitude = alarmlevelriver.latitude,
249 longitude = alarmlevelriver.longitude,
250 coordveracity = alarmlevelriver.coordveracity,
251 installplace = alarmlevelriver.installplace,
252 levelbsv = alarmlevelriver.levelbsv,
253 levelpointsuspen = alarmlevelriver.levelpointsuspen,
254 levelzeropost = alarmlevelriver.levelzeropost,
255 causeevent = alarmlevelriver.causeevent,
256 repair = alarmlevelriver.repair,
257 opendoor=alarmlevelriver.opendoor
258
259 };
260
261 lr.Add(o);
262 }
263 catch (Exception)
264 {
265 }
266
267 LogicEvents.instance.UpdateFieldS2(lstRoute, lr);
268 return result;
269 }
270
271
272
273
274
275
276
277
278 private bool GetInfoNewVersion(string versionsoft)
279 {
280
281 bool flag = false;
282
283 try
284 {
285
286
287 XmlDocument xml = new XmlDocument();
288 xml.Load(@"C:\SzsWeb\version.xml");
289 if (xml != null)
290 {
291 foreach (XmlElement element in xml.GetElementsByTagName("info"))
292 {
293 foreach (XmlElement e in element)
294 {
295 if (e.Name.CompareTo("version") == 0)
296 {
297 string version = e.InnerText.Trim();
298
299 if (versionsoft != version)
300 flag = true;
301
302 }
303 }
304 }
305 };
306
307
308 }
309 catch (Exception)
310 {
311
312 }
313
314
315
316 return flag;
317
318
319 }
320
321
322
323
324 // PUT api/getlevelsrivers/5
325 public void Put(int id, [FromBody]string value)
326 {
327 }
328
329 // DELETE api/getlevelsrivers/5
330 public void Delete(int id)
331 {
332 }
333
334
335
336
337
338
339
340
341
342 }
343 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5 using Newtonsoft.Json.Linq;
6 using ControlPanel.Models;
7 using System.Runtime.Serialization;
8 using ControlPanel.LogicLayers;
9 using ControlPanel.Models.Extend;
10 using System.Web;
11 using System.Web.Mvc;
12
13
14 namespace ControlPanel.Controllers
15 {
16 public class EventsController : Controller
17 {
18
19 /// <summary>
20 /// Метод доступен для загрузки новых данных
21 /// </summary>
22 /// <returns></returns>
23 public JsonResult Set()
24 {
25 return Json(null, JsonRequestBehavior.AllowGet);
26 }
27
28 /// <summary>
29 /// Получаем массив событий, на которые подписаны
30 /// </summary>
31 /// <param name="id_szs"></param>
32 /// <returns></returns>
33 public JsonResult Get(string RegKey)
34 {
35 // получаем маршруты на которые подписаны
36 return Json(null, JsonRequestBehavior.AllowGet);
37 }
38
39 /// <summary>
40 /// Подтверждение событий
41 /// </summary>
42 /// <param name="id_szs"></param>
43 /// <param name="id_msg"></param>
44 /// <returns></returns>
45 public JsonResult Confirm(int id_szs, int id_msg)
46 {
47
48 return Json(null, JsonRequestBehavior.AllowGet);
49 }
50
51 /// <summary>
52 /// Получение истории событий
53 /// </summary>
54 /// <returns></returns>
55 public JsonResult GetLivesEvents()
56 {
57
58 return Json(null, JsonRequestBehavior.AllowGet);
59 }
60
61
62
63 public JObject GetLog(int page, int start, int limit, string date, int id_route, bool isconfirm)
64 {
65 List<ExtEvent> result = new List<ExtEvent>();
66 try
67 {
68 result = LogicEvents.instance.Log(page, start, limit, date, id_route, isconfirm);
69
70 }
71 catch (Exception)
72 {
73
74 }
75 JObject res = JObject.FromObject(new
76 {
77 total = LogicEvents.instance.Count(date, id_route, isconfirm),
78 events = result
79
80 });
81 return res;
82 }
83
84
85 }
86 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Web;
5 using System.Web.Mvc;
6
7
8 using System;
9 using System.Collections.Generic;
10 using System.Linq;
11 using System.Net;
12 using Newtonsoft.Json.Linq;
13 using ControlPanel.Models;
14 using System.Runtime.Serialization;
15 using ControlPanel.LogicLayers;
16 using System.IO;
17 using System.Web;
18 using System.Web.Mvc;
19
20
21 namespace ControlPanel.Controllers
22 {
23
24 public class Region
25 {
26 public int id;
27 public string title;
28 }
29
30 public class GSMNotificationController : Controller
31 {
32 public JObject GetGSMNotifications(int page, int start, int limit)
33 {
34
35 List<Region> lstRegion = new List<Region>();
36
37 var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://46.226.227.171/importer/regions.php");
38 httpWebRequest.ContentType = "text/json";
39 httpWebRequest.Method = "POST";
40
41 try
42 {
43 var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());
44
45 var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
46 using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
47 {
48 var res = streamReader.ReadToEnd();
49
50 string str = res.ToString();
51
52
53
54 dynamic obj = JObject.Parse(res);
55
56 try
57 {
58
59 var lst = obj["data"];
60
61 foreach (var p in lst)
62 {
63 try
64 {
65 dynamic json = JValue.Parse(p.ToString());
66
67 int id = json.id;
68 string title= json.title;
69
70 lstRegion.Add(new Region { id = id, title = title });
71
72 }
73 catch (Exception)
74 {
75 }
76 }
77 }
78 catch (Exception)
79 {
80
81 }
82 }
83
84 }
85 catch (Exception)
86 {
87
88 }
89
90 JObject result = JObject.FromObject(new
91 {
92 data = lstRegion
93 });
94 return result;
95 }
96
97
98
99
100
101
102
103
104
105
106
107 public String GetList(int id)
108 {
109
110
111 var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://46.226.227.171/importer/view.php?region=" + id);
112 httpWebRequest.ContentType = "text/json";
113 httpWebRequest.Method = "POST";
114
115
116
117 try
118 {
119 var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());
120
121 var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
122
123 System.Text.Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
124 using (var streamReader = new StreamReader(httpResponse.GetResponseStream(), encode))
125 {
126 var res = streamReader.ReadToEnd();
127
128 String str = res.ToString();
129 dynamic obj = JObject.Parse(res);
130
131
132 /*
133 JObject result = JObject.FromObject(new
134 {
135 info = str
136 });
137 * */
138
139 return str;
140
141
142
143
144 }
145
146 }
147 catch (Exception)
148 {
149 return null;
150 }
151
152
153
154 }
155
156
157
158
159 }
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174 }
175
176
177
178
179
180
181
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5 using System.Net.Http;
6 using System.Web.Http;
7 using Newtonsoft.Json.Linq;
8 using ControlPanel.Models;
9 using System.Runtime.Serialization;
10 using ControlPanel.LogicLayers;
11
12
13 namespace ControlPanel.Controllers
14 {
15 public class GetLevelsRiversByDateController : ApiController
16 {
17
18 public JObject Post(JObject data)
19 {
20
21 List<LevelRiver> lstLevelsRivers = new List<LevelRiver>();
22 List<Route> lstRoute = new List<Route>();
23
24 try
25 {
26
27 var date = data["date"];
28 var RegKey = data["Regkey"];
29
30
31 // Получаем маршруты для данного СЗС
32 lstRoute = LogicRouts.instance.GetRoutsByRegKey(RegKey.ToString());
33
34 DateTime datetime = Convert.ToDateTime(date.ToString());
35
36 lstLevelsRivers = LogicLevelsRivers.instance.GetlevelsRiversByDate(lstRoute, datetime);
37
38 }
39 catch (Exception)
40 {
41
42
43 }
44
45
46
47 List<LevelRiverForSzs> lstLevelForSzs = new List<LevelRiverForSzs>();
48
49 foreach (LevelRiver levelriver in lstLevelsRivers)
50 {
51 Agk objagk = LogicAgk.instance.GetById(levelriver.RefMessageAgk.id);
52 lstLevelForSzs.Add(new LevelRiverForSzs
53 {
54 id = levelriver.id,
55 id_agk = objagk.number,
56 datetimedevice = levelriver.datetimedevice,
57 datetimeveracity = levelriver.datetimeveracity,
58 datetimeserver = levelriver.datetimeserver,
59 latitude = levelriver.latitude,
60 longitude = levelriver.longitude,
61 coordveracity = levelriver.coordveracity,
62 installplace = levelriver.installplace,
63 levelbsv = levelriver.levelbsv,
64 levelpointsuspen = levelriver.levelpointsuspen,
65 levelzeropost = levelriver.levelzeropost,
66 causeevent = levelriver.causeevent,
67 isconfirm = true
68
69 });
70 }
71
72
73
74 JObject result = JObject.FromObject(new
75 {
76 levelsrivers = lstLevelForSzs
77 });
78
79
80
81 return result;
82 }
83
84
85
86 }
87 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5 using System.Net.Http;
6 using System.Web.Http;
7 using Newtonsoft.Json.Linq;
8 using ControlPanel.Models;
9 using System.Runtime.Serialization;
10 using ControlPanel.LogicLayers;
11 using System.Xml;
12 using System.Net;
13
14 namespace SourceRoute.Controllers
15 {
16 public class GetLevelsRiversController : ApiController
17 {
18 // GET api/getlevelsrivers
19 public IEnumerable<string> Get()
20 {
21 return new string[] { "value1", "value2" };
22 }
23
24 // GET api/getlevelsrivers/5
25 public string Get(int id)
26 {
27 return "value";
28 }
29
30 // POST api/getlevelsrivers
31
32 public JObject Post(JObject data)
33 {
34 List<LevelRiver> res=new List<LevelRiver>();
35 List<Route> lstRoute = new List<Route>();
36 List<Agk> lstAgk = new List<Agk>();
37 List<LevelRiversEmpty> lstLevelRiverEmpty = new List<LevelRiversEmpty>();
38
39
40
41 try
42 {
43 var lst = data["data"];
44 var RegKey = data["RegKey"];
45 var vers = data["SoftVersion"];
46
47 LogicLiveSubscribers.instance.UpdateStatusSubscriver(RegKey.ToString(), vers.ToString());
48
49 try
50 {
51
52 foreach (var p in lst)
53 {
54 dynamic json = JValue.Parse(p.ToString());
55
56 LevelRiversEmpty obj = new LevelRiversEmpty
57 {
58 id_agk = json.id_agk,
59 dt = json.dt,
60 status = json.status
61 };
62
63 lstLevelRiverEmpty.Add(obj);
64 }
65
66 // Получаем маршруты для данного СЗС
67 lstRoute = LogicRouts.instance.GetRoutsByRegKey(RegKey.ToString());
68
69 // Получаем список АГК
70
71 foreach (Route route in lstRoute)
72 {
73 Agk agk = LogicAgk.instance.GetById(route.RefRouteAgk.id);
74
75 lstAgk.Add(agk);
76 }
77 }
78 catch (Exception)
79 {
80
81 }
82
83 res = LogicLevelsRivers.instance.GetActualLevelRivers(lstRoute);
84
85
86
87 }
88 catch (Exception ex)
89 {
90
91
92
93 }
94
95 // Подготовим для отправки
96
97 List<AgkForSzs> lstAgkForSzs = new List<AgkForSzs>();
98
99 foreach (Agk agk in lstAgk)
100 {
101 lstAgkForSzs.Add( new AgkForSzs {
102 number=agk.number,
103 river=agk.river,
104 latitude=agk.latitude,
105 longitude=agk.longitude,
106 enabled=true
107 });
108 }
109
110 List<LevelRiverForSzs> lstLevelForSzs = new List<LevelRiverForSzs>();
111
112 foreach (LevelRiver levelriver in res)
113 {
114
115 Agk objagk = LogicAgk.instance.GetById(levelriver.RefMessageAgk.id);
116
117
118
119 lstLevelForSzs.Add(new LevelRiverForSzs
120 {
121 id = levelriver.id,
122 id_agk = objagk.number,
123 datetimedevice = levelriver.datetimedevice,
124 datetimeveracity = levelriver.datetimeveracity,
125 datetimeserver = levelriver.datetimeserver,
126 latitude = levelriver.latitude,
127 longitude = levelriver.longitude,
128 coordveracity = levelriver.coordveracity,
129 installplace = levelriver.installplace,
130 levelbsv = levelriver.levelbsv,
131 levelpointsuspen = levelriver.levelpointsuspen,
132 levelzeropost = levelriver.levelzeropost,
133 causeevent = levelriver.causeevent,
134 isconfirm = false
135
136 });
137 }
138
139
140 string softversion="";
141 try
142 {
143 var SoftVersion = data["SoftVersion"];
144 softversion=SoftVersion.ToString();
145
146 }
147 catch(Exception)
148 {
149 }
150
151
152 JObject result= JObject.FromObject(new
153 {
154 levelsrivers = lstLevelForSzs,
155 agks=lstAgk,
156 softversion = GetInfoNewVersion(softversion)
157
158 });
159
160
161 // Обновляем поле S2 в таблице Event для каждого сообщения
162 LogicEvents.instance.UpdateFieldS2(lstRoute,res);
163
164
165 return result;
166
167 }
168
169
170
171
172 private bool GetInfoNewVersion(string versionsoft)
173 {
174
175 bool flag = false;
176
177 try
178 {
179
180
181 XmlDocument xml = new XmlDocument();
182 xml.Load(@"C:\SzsWeb\version.xml");
183 if (xml != null)
184 {
185 foreach (XmlElement element in xml.GetElementsByTagName("info"))
186 {
187 foreach (XmlElement e in element)
188 {
189 if (e.Name.CompareTo("version") == 0)
190 {
191 string version = e.InnerText.Trim();
192
193 if (versionsoft != version)
194 flag = true;
195
196 }
197 }
198 }
199 };
200
201
202 }
203 catch (Exception)
204 {
205
206 }
207
208
209
210 return flag;
211
212
213 }
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233 // PUT api/getlevelsrivers/5
234 public void Put(int id, [FromBody]string value)
235 {
236 }
237
238 // DELETE api/getlevelsrivers/5
239 public void Delete(int id)
240 {
241 }
242 }
243 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5 using System.Net.Http;
6 using System.Web.Http;
7 using Newtonsoft.Json.Linq;
8 using ControlPanel.Models;
9 using System.Runtime.Serialization;
10 using ControlPanel.LogicLayers;
11
12 namespace ControlPanel.Controllers
13 {
14 public class GetNameSubController : ApiController
15 {
16
17
18 public JObject Post(JObject data)
19 {
20
21 string name="Подписчик не найден";
22
23 try
24 {
25
26 var date = data["RegKey"];
27 string key = date.ToString();
28
29 List<Subscribers> lstSub = LogicSubscribers.instance.GetSubByRegKey(key);
30 name=lstSub[0].Name;
31
32
33 }
34 catch (Exception)
35 {
36
37
38 }
39
40 JObject result = JObject.FromObject(new
41 {
42 name = name
43 });
44
45
46
47
48
49
50
51 return result;
52 }
53
54
55
56
57 }
58 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Web;
5 using System.Web.Mvc;
6 using ControlPanel.LogicLayers;
7 using ControlPanel.Models;
8
9
10 namespace ControlPanel.Controllers
11 {
12 [Authorize]
13 public class HomeController : Controller
14 {
15 public ActionResult Index()
16 {
17
18
19
20 List<Subscribers> lstSubscribers=new List<Subscribers>();
21
22 List<int> SubID=new List<int>();
23
24
25
26
27
28 SubID.Add(991);
29 SubID.Add(1000);
30
31
32
33
34
35
36 foreach (int id_sub in SubID)
37 {
38
39 Subscribers sub = LogicSubscribers.instance.GetById(id_sub);
40
41 if (sub != null)
42 {
43 // Получаем все маршруты для данного подразделения
44
45 List<Route> lstRoute = LogicRouts.instance.GetRoutsByRegKeyAll(sub.RegKey);
46
47 foreach (Route route in lstRoute)
48 {
49 // удаляем все события по этому маршруту
50 try
51 {
52 LogicEvents.instance.DeleteEventsByRoute(route);
53 }
54 catch (Exception)
55 {
56 }
57
58 // удаляем маршрут
59 try
60 {
61 LogicRouts.instance.Delete(route.id);
62 }
63 catch (Exception)
64 {
65
66 }
67 }
68
69 // Удаляем из таблицы LiveSubscribers
70
71 try
72 {
73 LogicLiveSubscribers.instance.DeleteBySub(sub);
74 }
75 catch (Exception)
76 {
77
78 }
79
80
81 // Удаляем населенный пункт
82 // LogicSubscribers.instance.Delete(sub);
83
84
85 }
86
87
88 }
89
90
91
92
93
94
95
96
97
98 // Удаление мусора
99
100
101
102
103
104 return View();
105 }
106
107 public ActionResult About()
108 {
109 ViewBag.Message = "Страница описания приложения.";
110
111 return View();
112 }
113
114 public ActionResult Contact()
115 {
116 ViewBag.Message = "Страница контактов.";
117
118 return View();
119 }
120 }
121 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5 using System.Net.Http;
6 using System.Web.Http;
7 using Newtonsoft.Json.Linq;
8 using ControlPanel.Models;
9 using System.Runtime.Serialization;
10 using ControlPanel.LogicLayers;
11 using System.IO;
12
13
14 namespace ControlPanel.Controllers
15 {
16 public class LevelsRiversController : ApiController
17 {
18 // POST api/default1
19 public string Post(JObject data)
20 {
21 string error = "Ok";
22 System.IO.StreamWriter StreamWriter = new System.IO.StreamWriter(System.Web.HttpContext.Current.Server.MapPath("~/Output/data.txt"),true);
23
24 try
25 {
26
27 var lst = data["data"];
28
29 foreach (var p in lst)
30 {
31 dynamic json = JValue.Parse(p.ToString());
32
33 int id_agk = json.id_agk;
34
35 if (id_agk > 1000)
36 id_agk = id_agk - 1000;
37
38
39
40
41 bool repair = false; // в норме
42 bool opendoor = false; // дверь закрыта
43
44
45 // если поля существует , то присвоим значение из JSON объека
46 try
47 {
48 int r = json.repair;
49 int f = json.opendoor;
50 if (r == 1)
51 repair = true;
52
53 if (f == 1)
54 opendoor = true;
55
56
57 }
58 catch (Exception)
59 {
60 }
61
62 MsgLevelRiver mslevelriver = new MsgLevelRiver
63 {
64 id_agk=id_agk,
65 datetimedevice = json.datetimedevice,
66 datetimeveracity = json.datetimeveracity,
67 datetimeserver = json.datetimeserver,
68 latitude = json.latitude,
69 longitude = json.longitude,
70 coordveracity = json.coordveracity,
71 installplace = json.installplace,
72 levelbsv = json.levelbsv,
73 levelpointsuspen = json.levelpointsuspen,
74 levelzeropost = json.levelzeropost,
75 causeevent = json.causeevent,
76 repair = repair,
77 opendoor = opendoor
78 };
79
80 try
81 {
82 string river = json.installplace;
83
84 Agk agk = new Agk();
85
86 agk.number = id_agk;
87 agk.river = river;
88 agk.latitude = mslevelriver.latitude;
89 agk.longitude = mslevelriver.longitude;
90
91 LogicAgk.instance.Add(agk);
92
93 //добавляем/ обновляем таблицу оповещаний //
94 //Notification objnotification = new Notification { number = agk.number, river = river, notification = true };
95 //LogicNotification.instance.Add(objnotification);
96 }
97 catch (Exception ex)
98 {
99 StreamWriter.WriteLine(ex.Message);
100
101 }
102 LogicLevelsRivers.instance.InsLevelsRivers(mslevelriver);
103 }
104
105 }
106 catch (Exception ex)
107 {
108 StreamWriter.WriteLine(ex.Message);
109
110 }
111
112
113 StreamWriter.Flush();
114 StreamWriter.Close();
115
116
117 return error;
118
119 }
120
121 // PUT api/default1/5
122 public void Put(int id, [FromBody]string value)
123 {
124 }
125
126 // DELETE api/default1/5
127 public void Delete(int id)
128 {
129 }
130 }
131 }
1 using System;
2 using System.Collections.Generic;
3 using System;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Net;
7 using Newtonsoft.Json.Linq;
8 using ControlPanel.Models;
9 using System.Runtime.Serialization;
10 using ControlPanel.LogicLayers;
11 using System.IO;
12 using ControlPanel.Models.Extend;
13 using Newtonsoft.Json.Linq;
14 //using System.Runtime.Serialization;
15 using ControlPanel.LogicLayers;
16 using ControlPanel.Models;
17 using System.Web;
18 using System.Web.Mvc;
19
20 namespace ControlPanel.Controllers
21 {
22 public class LivesSubscribersController : Controller
23 {
24 /// <returns></returns>
25 public JObject GetLivesSubscribers()
26 {
27 List<LiveSubscriberExt> lstLiveSubscriberExt = LogicLiveSubscribers.instance.GetLog();
28
29 lstLiveSubscriberExt.Sort(delegate(LiveSubscriberExt obj1, LiveSubscriberExt obj2)
30 { return obj1.dt.CompareTo(obj2.dt); });
31
32 JObject result = JObject.FromObject(new
33 {
34 lstlivesubscribers = lstLiveSubscriberExt
35 });
36 return result;
37 }
38
39 public JObject UpdatePhone(int id, string phone, string phoneszs, bool siren)
40 {
41
42 try
43 {
44
45 LiveSubscribers live = LogicLiveSubscribers.instance.GetByID(id);
46
47 Subscribers sub = LogicSubscribers.instance.GetById(live.RefLiveSzsSzs.Id);
48
49 sub.phone = phone;
50 sub.phoneszs = phoneszs;
51 sub.siren = siren;
52
53 LogicSubscribers.instance.UpdSzs(sub);
54
55 }
56 catch (Exception)
57 {
58
59 }
60
61
62
63 JObject result = JObject.FromObject(new
64 {
65 data = ""
66
67 });
68 return result;
69 }
70
71
72
73
74 }
75 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5 using Newtonsoft.Json.Linq;
6 using ControlPanel.Models;
7 using System.Runtime.Serialization;
8 using ControlPanel.LogicLayers;
9 using System.IO;
10 using System.Web;
11 using System.Web.Mvc;
12
13
14
15 namespace ControlPanel.Controllers
16 {
17
18
19 public class NotificationController : Controller
20 {
21
22 /// <summary>
23 ///
24 /// </summary>
25 /// <returns></returns>
26
27 public JObject GetNotifications(int page, int start, int limit)
28 {
29
30 List<Notification> lstNotification = LogicNotification.instance.GetLog( page, start, limit);
31
32
33
34 JObject result = JObject.FromObject(new
35 {
36 notifications = lstNotification,
37 success = true,
38 total = LogicNotification.instance.Count()
39 });
40 return result;
41 }
42
43
44 /// <summary>
45 /// Изменение таблицы, без изменения на сервере оповещения
46 /// </summary>
47 /// <param name="number"></param>
48 /// <param name="f"></param>
49 /// <returns></returns>
50 [HttpPost]
51 public JObject UpdateSzs(int number, bool f)
52 {
53 bool changeservernotification = true;
54 try
55 {
56 Notification obj = LogicNotification.instance.GetNotificationByNumber(number);
57
58 obj.notification = f;
59
60 }
61 catch (Exception)
62 {
63 changeservernotification = false;
64 }
65
66 JObject result = JObject.FromObject(new
67 {
68 data = changeservernotification
69 });
70 return result;
71 }
72
73
74 /// <summary>
75 ///
76 /// </summary>
77 /// <param name="number"></param>
78 /// <param name="notification"></param>
79 /// <returns></returns>
80 [HttpPost]
81 public JObject UpdateNotification(int number, bool fszs,bool fphone, bool fopendoor)
82 {
83 string changeservernotification = "Изменения приняты!"; // изменили
84
85 Notification obj = LogicNotification.instance.GetNotificationByNumber(number);
86
87
88
89 obj.notification = fszs;
90 obj.notificationphone = fphone;
91 obj.opendoor = fopendoor;
92
93
94 try
95 {
96
97
98 Unchek(number, fszs);
99 LogicNotification.instance.Update(obj);
100
101 }
102 catch (Exception)
103 {
104 changeservernotification = "Изменения для СЗС не приняты!";
105 }
106
107
108
109
110
111 ///////////////////Сервер оповещение ////////////////////
112
113 int ff = 0;
114 if (fphone)
115 ff = 1;
116
117 var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://46.226.227.171/api/alert_handler.php?post=" + number + "&" + "on=" + ff);
118 httpWebRequest.ContentType = "text/json";
119 httpWebRequest.Method = "POST";
120
121 try
122 {
123 var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());
124
125 var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
126 using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
127 {
128 var res = streamReader.ReadToEnd();
129
130 string str = res.ToString();
131
132 char p = str[0];
133 if (p == '0' || p == '1')
134 {
135 LogicNotification.instance.Update(obj);
136
137
138
139
140
141 }
142 else
143 {
144 changeservernotification = "Сервер оповещений изменений не принял!";
145 }
146
147 }
148
149
150
151
152
153
154 }
155 catch (Exception)
156 {
157 changeservernotification = "Ошибка!";
158 }
159
160
161
162
163
164
165 JObject result = JObject.FromObject(new
166 {
167 data=changeservernotification
168 });
169
170 return result;
171 }
172
173 public void Unchek(int id_agk, bool flag)
174 {
175
176 List<Route> lstRoute = LogicRouts.instance.GetAll();
177
178 Agk agk = LogicAgk.instance.GetByNumber(id_agk);
179
180 foreach (Route route in lstRoute)
181 {
182
183
184
185 if (route.RefRouteAgk.id == agk.id)
186 {
187 Route newRoute = route;
188 newRoute.enabled = flag;
189 LogicRouts.instance.UpdateEnabled(newRoute);
190 }
191
192 }
193
194
195
196 }
197
198
199
200 [HttpPost]
201 public JObject Varification()
202 {
203
204
205 var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://46.226.227.171/api/json_info.php?on");
206 httpWebRequest.ContentType = "text/json";
207 httpWebRequest.Method = "POST";
208
209 try
210 {
211 var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());
212
213 var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
214 using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
215 {
216 var res = streamReader.ReadToEnd();
217
218 string str = res.ToString();
219
220
221
222 dynamic obj = JObject.Parse(res);
223
224 try
225 {
226
227 var lst = obj["notifications"];
228
229 foreach (var p in lst)
230 {
231 try
232 {
233 dynamic json = JValue.Parse(p.ToString());
234
235 int number = json.number;
236 bool notificationphone = json.notification;
237
238 Notification notification = LogicNotification.instance.GetNotificationByNumber(number);
239 notification.notificationphone = notificationphone;
240 LogicNotification.instance.Update(notification);
241 }
242 catch (Exception)
243 {
244 }
245 }
246 }
247 catch (Exception)
248 {
249
250 }
251 }
252
253 }
254 catch (Exception)
255 {
256
257 }
258
259
260
261
262
263
264
265
266
267
268
269
270
271 JObject result = JObject.FromObject(new
272 {
273 data = ""
274 });
275 return result;
276 }
277
278
279
280
281
282
283
284 //
285
286 /* var request = (HttpWebRequest) HttpWebRequest.Create("http://url");
287 request.Method = "POST";
288 const string command = @"Текст POST запроса";
289 byte[] bytes = Encoding.ASCII.GetBytes(command);
290 request.ContentLength = bytes.Length;
291 using (var stream = request.GetRequestStream())
292 {
293 stream.Write(bytes, 0, bytes.Length);
294 }
295 using(var stream = new StreamReader(request.GetResponse().GetResponseStream()))
296 {
297 Console.WriteLine(stream.ReadToEnd());
298 }
299 //
300 */
301
302 }
303 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5
6 using Newtonsoft.Json.Linq;
7 using ControlPanel.Models;
8 using System.Runtime.Serialization;
9 using ControlPanel.LogicLayers;
10 using System.IO;
11 using ControlPanel.Models.Extend;
12 using System.Web;
13 using System.Web.Mvc;
14
15 namespace ControlPanel.Controllers
16 {
17 public class RoutsController : Controller
18 {
19 /// <summary>
20 /// Получение списка всех маршрутов
21 /// </summary>
22 /// <returns></returns>
23 public JObject GetLog(int page, int start, int limit, int id_subscriber)
24 {
25
26 List<ExtRoute> lstRouts = new List<ExtRoute>();
27 Subscribers subscriber = null;
28
29 try
30 {
31
32
33 try
34 {
35 subscriber = LogicSubscribers.instance.GetById(id_subscriber);
36 }
37 catch (Exception)
38 {
39
40 }
41
42 lstRouts = LogicRouts.instance.GetLog(page, start, limit, subscriber);
43
44 // lstRouts.Sort(delegate(ExtRoute obj1, ExtRoute obj2)
45 // { return obj1.titleagk.CompareTo(obj2.Name); });
46
47 }
48 catch (Exception ex)
49 {
50 //
51 }
52
53
54 lstRouts.Sort(delegate(ExtRoute obj1, ExtRoute obj2)
55 { return obj2.id.CompareTo(obj1.id); });
56
57
58 JObject result = JObject.FromObject(new
59 {
60 total = LogicRouts.instance.Count(subscriber),
61 routs = lstRouts
62
63 });
64
65 return result;
66 }
67
68
69
70
71
72 public JObject EditRoute(int id,string titleszs,string titleagk,bool enabled)
73 {
74 try
75 {
76
77
78
79
80
81 Route route = LogicRouts.instance.GetById(id);
82
83 List<ExtAgk> lstAgk = LogicAgk.instance.GetExtAgk();
84 ExtAgk extagk = lstAgk.Find(x => x.title == titleagk);
85
86 Agk agk = LogicAgk.instance.GetById(extagk.id);
87
88 route.RefRouteAgk = agk;
89 route.enabled = enabled;
90
91 LogicRouts.instance.Edit(route);
92
93 }
94 catch (Exception)
95 {
96 }
97
98 JObject result = JObject.FromObject(new
99 {
100 data = ""
101 });
102 return result;
103
104 }
105
106
107 public JObject AddRoute(int id_subscribers,int id_agk)
108 {
109 ExtRoute routelast = null;
110 string error = "";
111 try
112 {
113
114
115
116 routelast = LogicRouts.instance.New(id_subscribers, id_agk);
117
118 if (true)
119 {
120 error = "Ошибка при добавлении нового маршрута, такая запись уже существует в базе!";
121 }
122
123 }
124 catch (Exception)
125 {
126
127 }
128
129
130 JObject result = JObject.FromObject(new
131 {
132 data = routelast,
133 error = error
134 });
135 return result;
136 }
137
138
139 public JObject GetExtRoute()
140 {
141
142 List<RouteExt> lstRouteExt = new List<RouteExt>();
143 try
144 {
145 List<ExtRoute> lstExtRoute = LogicRouts.instance.Get();
146
147 foreach (ExtRoute extroute in lstExtRoute)
148 lstRouteExt.Add(new RouteExt
149 {
150 id = extroute.id,
151 title = extroute.titleszs + " - " + extroute.titleagk
152
153 });
154
155 }
156 catch (Exception)
157 {
158
159
160 }
161
162 lstRouteExt.Add(new RouteExt { id = 0, title = "Все маршруты" });
163
164
165 lstRouteExt.Sort(delegate(RouteExt obj1, RouteExt obj2)
166 { return obj2.id.CompareTo(obj1.id); });
167
168
169 JObject res = JObject.FromObject(new
170 {
171 routeext = lstRouteExt,
172 success = true,
173 total = lstRouteExt.Count
174 });
175
176
177
178
179
180 return res;
181 }
182
183
184 public JObject Delete(int id)
185 {
186 string error = "";
187 try
188 {
189 error = LogicRouts.instance.Delete(id);
190
191 }
192 catch (Exception)
193 {
194
195 }
196 JObject result = JObject.FromObject(new
197 {
198 error = error
199 });
200
201 return result;
202
203
204 }
205 }
206 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5 using System.Net.Http;
6 using System.Web.Http;
7
8 namespace ControlPanel.Controllers
9 {
10 public class SoftInfoController : ApiController
11 {
12 // GET api/softinfo
13 public IEnumerable<string> Get()
14 {
15 return new string[] { "value1", "value2" };
16 }
17
18 // GET api/softinfo/5
19 public string Get(int id)
20 {
21 return "value";
22 }
23
24 // POST api/softinfo
25 public void Post([FromBody]string value)
26 {
27 }
28
29 // PUT api/softinfo/5
30 public void Put(int id, [FromBody]string value)
31 {
32 }
33
34 // DELETE api/softinfo/5
35 public void Delete(int id)
36 {
37 }
38 }
39 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using Newtonsoft.Json.Linq;
5 //using System.Runtime.Serialization;
6 using ControlPanel.LogicLayers;
7 using ControlPanel.Models.Extend;
8 using ControlPanel.Models;
9 using System.IO;
10 using System.Web;
11 using System.Web.Mvc;
12
13 /// jr
14
15 namespace ControlPanel.Controllers
16 {
17 public class SubscribersController : Controller
18 {
19
20 public JObject List()
21 {
22 List<Subscribers> lstSubscribers = new List<Subscribers>();
23 try
24 {
25 lstSubscribers = LogicSubscribers.instance.GetSubscribers();
26
27 lstSubscribers.Add(new Subscribers { Id = 0, Name = "Все подписчики", RegKey = "" });
28
29 lstSubscribers.Sort(delegate(Subscribers obj1, Subscribers obj2)
30 { return obj1.Id.CompareTo(obj2.Id); });
31
32
33 }
34 catch (Exception ex)
35 {
36 //
37 }
38
39 JObject result = JObject.FromObject(new
40 {
41 subscribers = lstSubscribers,
42 success = true,
43 total = 0
44 });
45 return result;
46
47 }
48
49
50
51 /// <summary>
52 ///
53 /// </summary>
54 /// <param name="page"></param>
55 /// <param name="start"></param>
56 /// <param name="limit"></param>
57 /// <returns></returns>
58 ///
59 /*
60 public JObject GetLog(int page, int start, int limit)
61 {
62 List<Subscribers> lstSubscribers = LogicSubscribers.instance.GetLog(page, start, limit);
63
64 JObject result = JObject.FromObject(new
65 {
66 subscribers = lstSubscribers,
67 success = true,
68 total = LogicSubscribers.instance.Count()
69 });
70 return result;
71 }
72 */
73
74 }
75 }
76
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5 using System.Net.Http;
6 using System.Web.Http;
7 using Newtonsoft.Json.Linq;
8 using ControlPanel.Models.Szs;
9 using ControlPanel.LogicLayers;
10 using ControlPanel.Models;
11 using System.IO;
12
13
14 namespace ControlPanel.Controllers
15 {
16 public class SzsController : ApiController
17 {
18
19
20
21
22 public JObject GetLog(int page, int start, int limit, string date,string regkey )
23 {
24
25 List<MsgLog> buffer = new List<MsgLog>();
26 List<MsgLog> result = new List<MsgLog>();
27
28 DateTime dt1 = DateTime.Now;
29 DateTime dt2 = DateTime.Now;
30 try
31 {
32 buffer = LogicSzs.instance.GetLog(page, start, limit, date,regkey);
33 }
34 catch (Exception)
35 {
36 }
37
38 JObject res = JObject.FromObject(new
39 {
40 total = LogicSzs.instance.Count(date,regkey),
41 msglog = buffer
42
43 });
44
45 return res;
46 }
47
48
49
50 public void Confirm(string levelriver, string RegKey, string id_webapi_message, string id_agk )
51 { try
52 {
53
54 LogicEvents.instance.Confirm(id_webapi_message.ToString(),id_agk.ToString(), RegKey.ToString());
55 }
56 catch(Exception)
57 {
58
59 }
60 }
61
62
63
64
65
66
67 /// <summary>
68 /// данные для диалога
69 /// </summary>
70 /// <returns></returns>
71 public JObject GetDataDialog(string regkey)
72 {
73 List<ExtLevelRiver> res = new List<ExtLevelRiver>();
74 try
75 {
76 // var RegKey = data["RegKey"];
77 //string regkey= RegKey.ToString();
78
79 res = LogicSzs.instance.GetLevelsNotConfirm(regkey);
80
81 res.Sort(delegate(ExtLevelRiver obj1, ExtLevelRiver obj2)
82 { return obj2.titledatetimedevice.CompareTo(obj1.titledatetimedevice); });
83
84 // Сортировка по статусу
85 res.Sort(delegate(ExtLevelRiver obj1, ExtLevelRiver obj2)
86 { return obj1.id_causeevent.CompareTo(obj2.id_causeevent); });
87
88 }
89 catch (Exception)
90 {
91
92 }
93
94
95
96
97
98 JObject result = JObject.FromObject(new { data = res });
99
100 return result;
101 }
102
103 /// <summary>
104 /// Получаем текущие сообщения для СЗС
105 /// </summary>
106 /// <param name="data"></param>
107 /// <returns></returns>
108 public JObject GetDataCurrentTable(string data)
109 {
110 List<ExtLevelRiver> lstExtLevelsRivers = new List<ExtLevelRiver>();
111
112 try
113 {
114 // var RegKey = data["RegKey"];
115 //string regkey = RegKey.ToString();
116
117 lstExtLevelsRivers = LogicSzs.instance.GetLastExtLevelRiver(data);
118
119 lstExtLevelsRivers.Sort(delegate(ExtLevelRiver obj1, ExtLevelRiver obj2)
120 { return obj2.titledatetimedevice.CompareTo(obj1.titledatetimedevice); });
121
122 // Сортировка по статусу
123 lstExtLevelsRivers.Sort(delegate(ExtLevelRiver obj1, ExtLevelRiver obj2)
124 { return obj2.id_causeevent.CompareTo(obj1.id_causeevent); });
125
126
127
128 }
129 catch (Exception)
130 {
131
132
133 }
134
135 JObject result = JObject.FromObject(new { data = lstExtLevelsRivers });
136
137 return result;
138
139 }
140
141
142 /// <summary>
143 /// Получаем название подписчика
144 /// </summary>
145 /// <param name="regkey"></param>
146 /// <returns></returns>
147 public JObject GetNameSubByregKey(string regkey)
148 {
149 string name = "";
150 try
151 {
152
153 List<Subscribers> lstSubscribers = LogicSubscribers.instance.GetSubByRegKey(regkey);
154
155
156 }
157 catch (Exception)
158 {
159
160 }
161
162 JObject result = JObject.FromObject(new { data = name });
163
164 return result;
165 }
166
167
168 /// <summary>
169 /// Получаем текущию дату и время
170 /// </summary>
171 /// <returns></returns>
172 public JObject GetDateTime()
173 {
174 string datetime="";
175 try
176 {
177 datetime=DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss");
178
179 }
180 catch(Exception)
181 {
182
183 }
184 JObject result = JObject.FromObject(new { data = datetime });
185
186 return result;
187
188 }
189
190
191
192
193
194
195 }
196 }
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Net;
5 using System.Net.Http;
6 using System.Web.Http;
7 using Newtonsoft.Json.Linq;
8 using ControlPanel.Models;
9 using System.Runtime.Serialization;
10 using ControlPanel.LogicLayers;
11 using System.IO;
12 using ControlPanel.Models.Extend;
13 using ControlPanel.Interfaces;
14 using ControlPanel.Interfaces.Reposytorys;
15 using ControlPanel.NHInplimentRepository;
16 using ControlPanel.ImplimentStrateges;
17 using ControlPanel.Contexts;
18 using System.Xml;
19 using System.Net;
20 using ControlPanel.LogicLayers;
21
22
23
24 namespace ControlPanel.Controllers
25 {
26 public class UpdInfoController : ApiController
27 {
28 public class Task
29 {
30 public bool isupdszs { get; set; }
31 public bool isupddb { get; set; }
32 public bool isdownload { get; set; }
33
34 }
35
36
37 /// <summary>
38 ///
39 /// </summary>
40 /// <param name="page"></param>
41 /// <param name="start"></param>
42 /// <param name="limit"></param>
43 /// <returns></returns>
44
45
46
47
48
49 public JObject GetLog(int page, int start, int limit)
50 {
51
52 LogicUpdInfo.instance.InitTableInfo();
53
54
55 List<UpdInfoExt> lstUpdInfo = LogicUpdInfo.instance.GetLog(page, start, limit);
56
57 JObject result = JObject.FromObject(new
58 {
59 lstUpdInfo = lstUpdInfo,
60 success = true,
61 total = LogicUpdInfo.instance.Count()
62 });
63 return result;
64
65 }
66
67
68
69 /// <summary>
70 /// Получение статуса обновление БД на СЗС
71 /// </summary>
72 /// <param name="data"></param>
73 public void SetEndUpdDb(JObject data)
74 {
75 try
76 {
77 var RegKey = data["RegKey"];
78 var IsUpdSzs = data["isupddb"];
79 string regkey = RegKey.ToString();
80 bool isupddb = Convert.ToBoolean(IsUpdSzs.ToString());
81 LogicUpdInfo.instance.SetIsUpdDb(regkey, isupddb);
82
83 }
84 catch(Exception)
85 {
86
87 }
88
89 }
90
91 /// <summary>
92 /// Установка статуса обновления программы на СЗС
93 /// </summary>
94 /// <param name="data"></param>
95 public void SetEndUpdSoft(JObject data)
96 {
97 try
98 {
99 var RegKey = data["RegKey"];
100 var IsUpdDb = data["isupdszs"];
101
102 string regkey = RegKey.ToString();
103 bool isupddb = Convert.ToBoolean(IsUpdDb.ToString());
104
105 LogicUpdInfo.instance.SetIsUpdSzs(regkey, isupddb);
106
107 }
108 catch (Exception)
109 {
110
111 }
112
113 }
114
115 /// <summary>
116 /// Установка статуса загрузки новых версий script.sql и ПО Szs
117 /// </summary>
118 /// <param name="data"></param>
119 public void SetEndDownload(JObject data)
120 {
121 try
122 {
123 var RegKey = data["RegKey"];
124 var IsDownLoad = data["isdownload"];
125
126 string regkey = RegKey.ToString();
127
128 bool isdownload = Convert.ToBoolean(IsDownLoad.ToString());
129 LogicUpdInfo.instance.SetisUpdDownload(regkey, isdownload);
130
131 }
132 catch (Exception)
133 {
134
135 }
136 }
137
138
139
140 /// <summary>
141 /// Получение команд на обновление и загрузки данных
142 /// </summary>
143 /// <param name="data"></param>
144 /// <returns></returns>
145 public JObject InfoUpdate(JObject data)
146 {
147
148 UpdInfo updinfo = null;
149
150 try
151 {
152 var RegKey = data["RegKey"];
153 string regkey= RegKey.ToString();
154 List<Subscribers> lstSubsriber = LogicSubscribers.instance.GetSubByRegKey(regkey).ToList();
155
156 if (lstSubsriber[0] != null)
157 updinfo = LogicUpdInfo.instance.GetBySubsriber(lstSubsriber[0]);
158
159 }
160 catch (Exception)
161 {
162
163 }
164
165 Task task = new Task { isdownload = updinfo.isdownload, isupddb = updinfo.isupddb, isupdszs = updinfo.isupdszs };
166
167
168 JObject result = JObject.FromObject(new
169 {
170 result = task
171 });
172
173 return result;
174
175 }
176
177 /// <summary>
178 /// Установить к обновлению
179 /// </summary>
180 /// <param name="id"></param>
181 /// <param name="tobeupd"></param>
182 public void Update(JObject data)
183 {
184
185 try
186 {
187 dynamic json = JValue.Parse(data.ToString());
188
189 int id=json.id;
190
191 bool isupdszs=json.isupdszs;
192 bool isupddb=json.isupddb;
193 bool isdownload=json.isdownload;
194
195 LogicUpdInfo.instance.Edit(id, isupdszs,isupddb,isdownload);
196 }
197 catch (Exception)
198 {
199
200 }
201
202 }
203
204
205
206
207
208
209
210
211
212 /// <summary>
213 ///
214 /// </summary>
215 // GET api/db
216 public IEnumerable<string> Get()
217 {
218 LogicUpdInfo.instance.InitTableInfo();
219 return new string[] { "Создание БД", "DataStorage" };
220 }
221
222
223
224
225
226
227
228
229 }
230 }
231
232
233
234
235
This diff is collapsed. Click to expand it.
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.