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.

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

813 Bytes

/*!
* jQuery UI Accordion 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Accordion#theming
*/
/* IE/Win - Fix animation bug - #4615 */
.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; }
/*!
* jQuery UI CSS Framework 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming
*/
@import "jquery.ui.base.css";
@import "jquery.ui.theme.css";
/*!
* jQuery UI Autocomplete 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Autocomplete#theming
*/
.ui-autocomplete { position: absolute; cursor: default; }
/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
/*
* jQuery UI Menu 1.8.20
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Menu#theming
*/
.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;
}
/*!
* jQuery UI CSS Framework 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming
*/
@import url("jquery.ui.core.css");
@import url("jquery.ui.accordion.css");
@import url("jquery.ui.autocomplete.css");
@import url("jquery.ui.button.css");
@import url("jquery.ui.datepicker.css");
@import url("jquery.ui.dialog.css");
@import url("jquery.ui.progressbar.css");
@import url("jquery.ui.resizable.css");
@import url("jquery.ui.selectable.css");
@import url("jquery.ui.slider.css");
@import url("jquery.ui.tabs.css");
/*!
* jQuery UI Button 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Button#theming
*/
.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 */
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }
/*button text element */
.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; }
/* no icon support for input elements, provide padding by default */
input.ui-button { padding: .4em 1em; }
/*button icon element(s) */
.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; }
/*button sets*/
.ui-buttonset { margin-right: 7px; }
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
/*!
* jQuery UI CSS Framework 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 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); }
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/*!
* jQuery UI Datepicker 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Datepicker#theming
*/
.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; }
/* with multiple calendars */
.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; }
/* RTL support */
.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; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}
\ No newline at end of file
/*!
* jQuery UI Dialog 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog#theming
*/
.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; }
/*!
* jQuery UI Progressbar 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Progressbar#theming
*/
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
\ No newline at end of file
/*!
* jQuery UI Resizable 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/
.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
/*!
* jQuery UI Selectable 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Selectable#theming
*/
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
/*!
* jQuery UI Slider 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Slider#theming
*/
.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
/*!
* jQuery UI Tabs 1.8.20
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Licensed under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Tabs#theming
*/
.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") */
.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; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
/*! jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.accordion.css
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
.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
/*! jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.autocomplete.css
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
.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
/*! jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.button.css
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
.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
/*! jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.core.css
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
.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
/*! jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.datepicker.css
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
.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
/*! jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.dialog.css
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
.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
/*! jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.progressbar.css
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}
\ No newline at end of file
/*! jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.resizable.css
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
.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
/*! jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.selectable.css
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}
\ No newline at end of file
/*! jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.slider.css
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
.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
/*! jQuery UI - v1.8.20 - 2012-04-30
* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.tabs.css
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT */
.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ControlPanel.Interfaces.Strategys;
using ControlPanel.Contexts;
using ControlPanel.Models;
namespace ControlPanel.Contexts
{
public class ContextConvert<T>
{
private IConvertToExt<T> _strategy;
public ContextConvert(IConvertToExt<T> strategy)
{
_strategy = strategy;
}
/// <summary>
/// Устанавливаем стратегию конвертирование
/// </summary>
/// <param name="strategy"></param>
public void SetStrategy(IConvertToExt<T> strategy)
{
_strategy = strategy;
}
public object ExecuteOperation(T message)
{
return _strategy.New(message);
}
}
}
This diff could not be displayed because it is too large.
<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>

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlPanel", "ControlPanel.csproj", "{D8F3B13E-7A1C-4C8B-82A9-887823F4EE38}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D8F3B13E-7A1C-4C8B-82A9-887823F4EE38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D8F3B13E-7A1C-4C8B-82A9-887823F4EE38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D8F3B13E-7A1C-4C8B-82A9-887823F4EE38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D8F3B13E-7A1C-4C8B-82A9-887823F4EE38}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using ControlPanel.Models.Extend;
using System.Web;
using System.Web.Mvc;
namespace ControlPanel.Controllers
{
public class AgksController : Controller
{
public JObject Get()
{
List<ExtAgk> lstExtAgk = new List<ExtAgk>();
try
{
lstExtAgk = LogicAgk.instance.GetExtAgk();
lstExtAgk.Sort(delegate(ExtAgk obj1, ExtAgk obj2)
{ return obj1.title.CompareTo(obj2.title); });
}
catch (Exception ex)
{
//
}
JObject result = JObject.FromObject(new
{
agks = lstExtAgk,
success = true,
total = 0
});
return result;
}
public JObject GetLog(int page, int start, int limit)
{
List<Agk> lstAgk = new List<Agk>();
try
{
lstAgk = LogicAgk.instance.Log(page, start, limit);
lstAgk.Sort(delegate(Agk obj1, Agk obj2)
{ return obj1.id.CompareTo(obj2.id); });
}
catch (Exception ex)
{
//
}
JObject result = JObject.FromObject(new
{
agks = lstAgk,
total =LogicAgk.instance.Count()
});
return result;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
namespace ControlPanel.Controllers
{
public class ConfirmLevelsRiversController : ApiController
{
// GET api/confirmlevelsrivers
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/confirmlevelsrivers/5
public string Get(int id)
{
return "value";
}
// POST api/getlevelsrivers
public string Post(JObject data)
{
string error = "";
try
{
var RegKey = data["RegKey"];
var id_webapi_message = data["id_webapi_message"];
var id_agk = data["id_agk"];
List<LevelRiversEmpty> lstLevelRiverEmpty = new List<LevelRiversEmpty>();
LogicEvents.instance.Confirm(id_webapi_message.ToString(),id_agk.ToString(), RegKey.ToString());
}
catch (Exception ex)
{
error=ex.Message;
}
return error;
}
// PUT api/confirmlevelsrivers/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/confirmlevelsrivers/5
public void Delete(int id)
{
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using System.Xml;
using System.Net;
using ControlPanel.Models.Response;
namespace ControlPanel.Controllers
{
public class DataSzsController : ApiController
{
/// <summary>
/// Получение неподтвержденных сообщений для подписчика
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public JObject Post(JObject data)
{
List<LevelRiverAlarm> lastlevelrivers = new List<LevelRiverAlarm>();
List<LevelRiverAlarm> notconfirmlevelrivers = new List<LevelRiverAlarm>();
List<Route> lstRoute = new List<Route>();
List<Agk> lstAgk = new List<Agk>();
LevelRiverAlarm alarmlevelriver = null; // событие для подтверждения
string Subscriber = "";
string titlecontact = "";
bool siren = false; // не включать сирену
try
{
var RegKey = data["RegKey"];
var vers = data["SoftVersion"];
var IDTeamViewer = data["IDTeamViewer"];
bool claim = false; // не требует помощи
try
{
var Claim = data["claim"];
claim = Convert.ToBoolean(Claim.ToString());
}
catch(Exception)
{
}
string key = RegKey.ToString();
LogicLiveSubscribers.instance.UpdateStatusSubscriver(key, vers.ToString());
LogicLiveSubscribers.instance.UpdateClaimSubscriver(key, claim);
try
{
// Получаем маршруты для данного СЗС
lstRoute = LogicRouts.instance.GetRoutsByRegKey(key);
// Получаем список АГК
foreach (Route route in lstRoute)
{
Agk agk = LogicAgk.instance.GetById(route.RefRouteAgk.id);
lstAgk.Add(agk);
}
}
catch (Exception e)
{
}
try
{
// неподтвержденные события
notconfirmlevelrivers = LogicLevelsRivers.instance.GetNotConfirmLevelRivers(lstRoute);
}
catch (Exception e)
{
}
try
{
if (notconfirmlevelrivers.Count > 0)
{
notconfirmlevelrivers.Sort(delegate(LevelRiverAlarm obj1, LevelRiverAlarm obj2)
{ return obj1.id.CompareTo(obj2.id); });
alarmlevelriver = notconfirmlevelrivers[0];
}
}
catch (Exception e)
{
}
try
{
// текущее состояние по всем станциям
lastlevelrivers = LogicLevelsRivers.instance.GetLastLevelRivers(lstRoute);
}
catch (Exception e)
{
}
try
{
// название населенного пункта
List<Subscribers> lstSub = LogicSubscribers.instance.GetSubByRegKey(key);
Subscriber = lstSub[0].Name;
titlecontact = lstSub[0].phoneszs;
siren = lstSub[0].siren;
Subscribers sub = lstSub[0];
sub.idteamviewer = (string)IDTeamViewer;
LogicSubscribers.instance.Uodate(sub);
}
catch (Exception e)
{
}
}
catch (Exception ex)
{
}
List<EventAgk> lrlast = new List<EventAgk>();
foreach (LevelRiverAlarm obj in lastlevelrivers)
{
int id_status;
if (obj.causeevent == "ня")
id_status = 1;
else if (obj.causeevent == "оя")
id_status = 2;
else
id_status=0;
try
{
Agk objagk = LogicAgk.instance.GetById(obj.RefMessageAgk.id);
EventAgk eventagk = new EventAgk
{
id=obj.id,
id_agk=objagk.number,
river = obj.installplace,
datetime=obj.datetimedevice.ToString("dd.MM.yyyy HH:mm:ss"),
value=obj.levelbsv.ToString(),
id_status=id_status,
repair=obj.repair, // true -repair; false- no repair
opendoor=obj.opendoor, // true - open; false-close
veracity=obj.datetimeveracity, // veracity -true, no veracity -false;
};
lrlast.Add(eventagk);
}
catch (Exception e)
{
}
}
List<EventAgk> lralarm= new List<EventAgk>();
if (alarmlevelriver != null)
{
int id_status;
if (alarmlevelriver.causeevent == "ня")
id_status = 1;
else if (alarmlevelriver.causeevent == "оя")
id_status = 2;
else
id_status = 0;
Agk objagk1 = LogicAgk.instance.GetById(alarmlevelriver.RefMessageAgk.id);
EventAgk eventagk = new EventAgk
{
id = alarmlevelriver.id,
id_agk = objagk1.number,
river = alarmlevelriver.installplace,
datetime = alarmlevelriver.datetimedevice.ToString("dd.MM.yyyy HH:mm:ss"),
value = alarmlevelriver.levelbsv.ToString(),
id_status=id_status,
repair = alarmlevelriver.repair, // true -repair; false- no repair
opendoor = alarmlevelriver.opendoor, // true - open; false-close
veracity = alarmlevelriver.datetimeveracity, // veracity -true, no veracity -false;
};
lralarm.Add( eventagk);
}
else
{
}
JObject result = JObject.FromObject(new
{
titlesubscriber=Subscriber,
titlecontact=titlecontact,
siren=siren,
lsteventagkconfirm=lralarm,
lsteventagkstate=lrlast
});
// StreamWriter.WriteLine(result);
// Обновляем поле S2 в таблице Event для каждого сообщения
List<LevelRiver> lr = new List<LevelRiver>();
try
{
LevelRiver o = new LevelRiver
{
id = alarmlevelriver.id,
RefMessageAgk = alarmlevelriver.RefMessageAgk,
datetimedevice = alarmlevelriver.datetimedevice,
datetimeveracity = alarmlevelriver.datetimeveracity,
datetimeserver = alarmlevelriver.datetimeserver,
latitude = alarmlevelriver.latitude,
longitude = alarmlevelriver.longitude,
coordveracity = alarmlevelriver.coordveracity,
installplace = alarmlevelriver.installplace,
levelbsv = alarmlevelriver.levelbsv,
levelpointsuspen = alarmlevelriver.levelpointsuspen,
levelzeropost = alarmlevelriver.levelzeropost,
causeevent = alarmlevelriver.causeevent,
repair = alarmlevelriver.repair,
opendoor=alarmlevelriver.opendoor
};
lr.Add(o);
}
catch (Exception)
{
}
LogicEvents.instance.UpdateFieldS2(lstRoute, lr);
return result;
}
private bool GetInfoNewVersion(string versionsoft)
{
bool flag = false;
try
{
XmlDocument xml = new XmlDocument();
xml.Load(@"C:\SzsWeb\version.xml");
if (xml != null)
{
foreach (XmlElement element in xml.GetElementsByTagName("info"))
{
foreach (XmlElement e in element)
{
if (e.Name.CompareTo("version") == 0)
{
string version = e.InnerText.Trim();
if (versionsoft != version)
flag = true;
}
}
}
};
}
catch (Exception)
{
}
return flag;
}
// PUT api/getlevelsrivers/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/getlevelsrivers/5
public void Delete(int id)
{
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using ControlPanel.Models.Extend;
using System.Web;
using System.Web.Mvc;
namespace ControlPanel.Controllers
{
public class EventsController : Controller
{
/// <summary>
/// Метод доступен для загрузки новых данных
/// </summary>
/// <returns></returns>
public JsonResult Set()
{
return Json(null, JsonRequestBehavior.AllowGet);
}
/// <summary>
/// Получаем массив событий, на которые подписаны
/// </summary>
/// <param name="id_szs"></param>
/// <returns></returns>
public JsonResult Get(string RegKey)
{
// получаем маршруты на которые подписаны
return Json(null, JsonRequestBehavior.AllowGet);
}
/// <summary>
/// Подтверждение событий
/// </summary>
/// <param name="id_szs"></param>
/// <param name="id_msg"></param>
/// <returns></returns>
public JsonResult Confirm(int id_szs, int id_msg)
{
return Json(null, JsonRequestBehavior.AllowGet);
}
/// <summary>
/// Получение истории событий
/// </summary>
/// <returns></returns>
public JsonResult GetLivesEvents()
{
return Json(null, JsonRequestBehavior.AllowGet);
}
public JObject GetLog(int page, int start, int limit, string date, int id_route, bool isconfirm)
{
List<ExtEvent> result = new List<ExtEvent>();
try
{
result = LogicEvents.instance.Log(page, start, limit, date, id_route, isconfirm);
}
catch (Exception)
{
}
JObject res = JObject.FromObject(new
{
total = LogicEvents.instance.Count(date, id_route, isconfirm),
events = result
});
return res;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using System.IO;
using System.Web;
using System.Web.Mvc;
namespace ControlPanel.Controllers
{
public class Region
{
public int id;
public string title;
}
public class GSMNotificationController : Controller
{
public JObject GetGSMNotifications(int page, int start, int limit)
{
List<Region> lstRegion = new List<Region>();
var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://46.226.227.171/importer/regions.php");
httpWebRequest.ContentType = "text/json";
httpWebRequest.Method = "POST";
try
{
var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var res = streamReader.ReadToEnd();
string str = res.ToString();
dynamic obj = JObject.Parse(res);
try
{
var lst = obj["data"];
foreach (var p in lst)
{
try
{
dynamic json = JValue.Parse(p.ToString());
int id = json.id;
string title= json.title;
lstRegion.Add(new Region { id = id, title = title });
}
catch (Exception)
{
}
}
}
catch (Exception)
{
}
}
}
catch (Exception)
{
}
JObject result = JObject.FromObject(new
{
data = lstRegion
});
return result;
}
public String GetList(int id)
{
var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://46.226.227.171/importer/view.php?region=" + id);
httpWebRequest.ContentType = "text/json";
httpWebRequest.Method = "POST";
try
{
var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
System.Text.Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
using (var streamReader = new StreamReader(httpResponse.GetResponseStream(), encode))
{
var res = streamReader.ReadToEnd();
String str = res.ToString();
dynamic obj = JObject.Parse(res);
/*
JObject result = JObject.FromObject(new
{
info = str
});
* */
return str;
}
}
catch (Exception)
{
return null;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
namespace ControlPanel.Controllers
{
public class GetLevelsRiversByDateController : ApiController
{
public JObject Post(JObject data)
{
List<LevelRiver> lstLevelsRivers = new List<LevelRiver>();
List<Route> lstRoute = new List<Route>();
try
{
var date = data["date"];
var RegKey = data["Regkey"];
// Получаем маршруты для данного СЗС
lstRoute = LogicRouts.instance.GetRoutsByRegKey(RegKey.ToString());
DateTime datetime = Convert.ToDateTime(date.ToString());
lstLevelsRivers = LogicLevelsRivers.instance.GetlevelsRiversByDate(lstRoute, datetime);
}
catch (Exception)
{
}
List<LevelRiverForSzs> lstLevelForSzs = new List<LevelRiverForSzs>();
foreach (LevelRiver levelriver in lstLevelsRivers)
{
Agk objagk = LogicAgk.instance.GetById(levelriver.RefMessageAgk.id);
lstLevelForSzs.Add(new LevelRiverForSzs
{
id = levelriver.id,
id_agk = objagk.number,
datetimedevice = levelriver.datetimedevice,
datetimeveracity = levelriver.datetimeveracity,
datetimeserver = levelriver.datetimeserver,
latitude = levelriver.latitude,
longitude = levelriver.longitude,
coordveracity = levelriver.coordveracity,
installplace = levelriver.installplace,
levelbsv = levelriver.levelbsv,
levelpointsuspen = levelriver.levelpointsuspen,
levelzeropost = levelriver.levelzeropost,
causeevent = levelriver.causeevent,
isconfirm = true
});
}
JObject result = JObject.FromObject(new
{
levelsrivers = lstLevelForSzs
});
return result;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using System.Xml;
using System.Net;
namespace SourceRoute.Controllers
{
public class GetLevelsRiversController : ApiController
{
// GET api/getlevelsrivers
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/getlevelsrivers/5
public string Get(int id)
{
return "value";
}
// POST api/getlevelsrivers
public JObject Post(JObject data)
{
List<LevelRiver> res=new List<LevelRiver>();
List<Route> lstRoute = new List<Route>();
List<Agk> lstAgk = new List<Agk>();
List<LevelRiversEmpty> lstLevelRiverEmpty = new List<LevelRiversEmpty>();
try
{
var lst = data["data"];
var RegKey = data["RegKey"];
var vers = data["SoftVersion"];
LogicLiveSubscribers.instance.UpdateStatusSubscriver(RegKey.ToString(), vers.ToString());
try
{
foreach (var p in lst)
{
dynamic json = JValue.Parse(p.ToString());
LevelRiversEmpty obj = new LevelRiversEmpty
{
id_agk = json.id_agk,
dt = json.dt,
status = json.status
};
lstLevelRiverEmpty.Add(obj);
}
// Получаем маршруты для данного СЗС
lstRoute = LogicRouts.instance.GetRoutsByRegKey(RegKey.ToString());
// Получаем список АГК
foreach (Route route in lstRoute)
{
Agk agk = LogicAgk.instance.GetById(route.RefRouteAgk.id);
lstAgk.Add(agk);
}
}
catch (Exception)
{
}
res = LogicLevelsRivers.instance.GetActualLevelRivers(lstRoute);
}
catch (Exception ex)
{
}
// Подготовим для отправки
List<AgkForSzs> lstAgkForSzs = new List<AgkForSzs>();
foreach (Agk agk in lstAgk)
{
lstAgkForSzs.Add( new AgkForSzs {
number=agk.number,
river=agk.river,
latitude=agk.latitude,
longitude=agk.longitude,
enabled=true
});
}
List<LevelRiverForSzs> lstLevelForSzs = new List<LevelRiverForSzs>();
foreach (LevelRiver levelriver in res)
{
Agk objagk = LogicAgk.instance.GetById(levelriver.RefMessageAgk.id);
lstLevelForSzs.Add(new LevelRiverForSzs
{
id = levelriver.id,
id_agk = objagk.number,
datetimedevice = levelriver.datetimedevice,
datetimeveracity = levelriver.datetimeveracity,
datetimeserver = levelriver.datetimeserver,
latitude = levelriver.latitude,
longitude = levelriver.longitude,
coordveracity = levelriver.coordveracity,
installplace = levelriver.installplace,
levelbsv = levelriver.levelbsv,
levelpointsuspen = levelriver.levelpointsuspen,
levelzeropost = levelriver.levelzeropost,
causeevent = levelriver.causeevent,
isconfirm = false
});
}
string softversion="";
try
{
var SoftVersion = data["SoftVersion"];
softversion=SoftVersion.ToString();
}
catch(Exception)
{
}
JObject result= JObject.FromObject(new
{
levelsrivers = lstLevelForSzs,
agks=lstAgk,
softversion = GetInfoNewVersion(softversion)
});
// Обновляем поле S2 в таблице Event для каждого сообщения
LogicEvents.instance.UpdateFieldS2(lstRoute,res);
return result;
}
private bool GetInfoNewVersion(string versionsoft)
{
bool flag = false;
try
{
XmlDocument xml = new XmlDocument();
xml.Load(@"C:\SzsWeb\version.xml");
if (xml != null)
{
foreach (XmlElement element in xml.GetElementsByTagName("info"))
{
foreach (XmlElement e in element)
{
if (e.Name.CompareTo("version") == 0)
{
string version = e.InnerText.Trim();
if (versionsoft != version)
flag = true;
}
}
}
};
}
catch (Exception)
{
}
return flag;
}
// PUT api/getlevelsrivers/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/getlevelsrivers/5
public void Delete(int id)
{
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
namespace ControlPanel.Controllers
{
public class GetNameSubController : ApiController
{
public JObject Post(JObject data)
{
string name="Подписчик не найден";
try
{
var date = data["RegKey"];
string key = date.ToString();
List<Subscribers> lstSub = LogicSubscribers.instance.GetSubByRegKey(key);
name=lstSub[0].Name;
}
catch (Exception)
{
}
JObject result = JObject.FromObject(new
{
name = name
});
return result;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ControlPanel.LogicLayers;
using ControlPanel.Models;
namespace ControlPanel.Controllers
{
[Authorize]
public class HomeController : Controller
{
public ActionResult Index()
{
List<Subscribers> lstSubscribers=new List<Subscribers>();
List<int> SubID=new List<int>();
SubID.Add(991);
SubID.Add(1000);
foreach (int id_sub in SubID)
{
Subscribers sub = LogicSubscribers.instance.GetById(id_sub);
if (sub != null)
{
// Получаем все маршруты для данного подразделения
List<Route> lstRoute = LogicRouts.instance.GetRoutsByRegKeyAll(sub.RegKey);
foreach (Route route in lstRoute)
{
// удаляем все события по этому маршруту
try
{
LogicEvents.instance.DeleteEventsByRoute(route);
}
catch (Exception)
{
}
// удаляем маршрут
try
{
LogicRouts.instance.Delete(route.id);
}
catch (Exception)
{
}
}
// Удаляем из таблицы LiveSubscribers
try
{
LogicLiveSubscribers.instance.DeleteBySub(sub);
}
catch (Exception)
{
}
// Удаляем населенный пункт
// LogicSubscribers.instance.Delete(sub);
}
}
// Удаление мусора
return View();
}
public ActionResult About()
{
ViewBag.Message = "Страница описания приложения.";
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Страница контактов.";
return View();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using System.IO;
namespace ControlPanel.Controllers
{
public class LevelsRiversController : ApiController
{
// POST api/default1
public string Post(JObject data)
{
string error = "Ok";
System.IO.StreamWriter StreamWriter = new System.IO.StreamWriter(System.Web.HttpContext.Current.Server.MapPath("~/Output/data.txt"),true);
try
{
var lst = data["data"];
foreach (var p in lst)
{
dynamic json = JValue.Parse(p.ToString());
int id_agk = json.id_agk;
if (id_agk > 1000)
id_agk = id_agk - 1000;
bool repair = false; // в норме
bool opendoor = false; // дверь закрыта
// если поля существует , то присвоим значение из JSON объека
try
{
int r = json.repair;
int f = json.opendoor;
if (r == 1)
repair = true;
if (f == 1)
opendoor = true;
}
catch (Exception)
{
}
MsgLevelRiver mslevelriver = new MsgLevelRiver
{
id_agk=id_agk,
datetimedevice = json.datetimedevice,
datetimeveracity = json.datetimeveracity,
datetimeserver = json.datetimeserver,
latitude = json.latitude,
longitude = json.longitude,
coordveracity = json.coordveracity,
installplace = json.installplace,
levelbsv = json.levelbsv,
levelpointsuspen = json.levelpointsuspen,
levelzeropost = json.levelzeropost,
causeevent = json.causeevent,
repair = repair,
opendoor = opendoor
};
try
{
string river = json.installplace;
Agk agk = new Agk();
agk.number = id_agk;
agk.river = river;
agk.latitude = mslevelriver.latitude;
agk.longitude = mslevelriver.longitude;
LogicAgk.instance.Add(agk);
//добавляем/ обновляем таблицу оповещаний //
//Notification objnotification = new Notification { number = agk.number, river = river, notification = true };
//LogicNotification.instance.Add(objnotification);
}
catch (Exception ex)
{
StreamWriter.WriteLine(ex.Message);
}
LogicLevelsRivers.instance.InsLevelsRivers(mslevelriver);
}
}
catch (Exception ex)
{
StreamWriter.WriteLine(ex.Message);
}
StreamWriter.Flush();
StreamWriter.Close();
return error;
}
// PUT api/default1/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/default1/5
public void Delete(int id)
{
}
}
}
using System;
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using System.IO;
using ControlPanel.Models.Extend;
using Newtonsoft.Json.Linq;
//using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using ControlPanel.Models;
using System.Web;
using System.Web.Mvc;
namespace ControlPanel.Controllers
{
public class LivesSubscribersController : Controller
{
/// <returns></returns>
public JObject GetLivesSubscribers()
{
List<LiveSubscriberExt> lstLiveSubscriberExt = LogicLiveSubscribers.instance.GetLog();
lstLiveSubscriberExt.Sort(delegate(LiveSubscriberExt obj1, LiveSubscriberExt obj2)
{ return obj1.dt.CompareTo(obj2.dt); });
JObject result = JObject.FromObject(new
{
lstlivesubscribers = lstLiveSubscriberExt
});
return result;
}
public JObject UpdatePhone(int id, string phone, string phoneszs, bool siren)
{
try
{
LiveSubscribers live = LogicLiveSubscribers.instance.GetByID(id);
Subscribers sub = LogicSubscribers.instance.GetById(live.RefLiveSzsSzs.Id);
sub.phone = phone;
sub.phoneszs = phoneszs;
sub.siren = siren;
LogicSubscribers.instance.UpdSzs(sub);
}
catch (Exception)
{
}
JObject result = JObject.FromObject(new
{
data = ""
});
return result;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using System.IO;
using System.Web;
using System.Web.Mvc;
namespace ControlPanel.Controllers
{
public class NotificationController : Controller
{
/// <summary>
///
/// </summary>
/// <returns></returns>
public JObject GetNotifications(int page, int start, int limit)
{
List<Notification> lstNotification = LogicNotification.instance.GetLog( page, start, limit);
JObject result = JObject.FromObject(new
{
notifications = lstNotification,
success = true,
total = LogicNotification.instance.Count()
});
return result;
}
/// <summary>
/// Изменение таблицы, без изменения на сервере оповещения
/// </summary>
/// <param name="number"></param>
/// <param name="f"></param>
/// <returns></returns>
[HttpPost]
public JObject UpdateSzs(int number, bool f)
{
bool changeservernotification = true;
try
{
Notification obj = LogicNotification.instance.GetNotificationByNumber(number);
obj.notification = f;
}
catch (Exception)
{
changeservernotification = false;
}
JObject result = JObject.FromObject(new
{
data = changeservernotification
});
return result;
}
/// <summary>
///
/// </summary>
/// <param name="number"></param>
/// <param name="notification"></param>
/// <returns></returns>
[HttpPost]
public JObject UpdateNotification(int number, bool fszs,bool fphone, bool fopendoor)
{
string changeservernotification = "Изменения приняты!"; // изменили
Notification obj = LogicNotification.instance.GetNotificationByNumber(number);
obj.notification = fszs;
obj.notificationphone = fphone;
obj.opendoor = fopendoor;
try
{
Unchek(number, fszs);
LogicNotification.instance.Update(obj);
}
catch (Exception)
{
changeservernotification = "Изменения для СЗС не приняты!";
}
///////////////////Сервер оповещение ////////////////////
int ff = 0;
if (fphone)
ff = 1;
var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://46.226.227.171/api/alert_handler.php?post=" + number + "&" + "on=" + ff);
httpWebRequest.ContentType = "text/json";
httpWebRequest.Method = "POST";
try
{
var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var res = streamReader.ReadToEnd();
string str = res.ToString();
char p = str[0];
if (p == '0' || p == '1')
{
LogicNotification.instance.Update(obj);
}
else
{
changeservernotification = "Сервер оповещений изменений не принял!";
}
}
}
catch (Exception)
{
changeservernotification = "Ошибка!";
}
JObject result = JObject.FromObject(new
{
data=changeservernotification
});
return result;
}
public void Unchek(int id_agk, bool flag)
{
List<Route> lstRoute = LogicRouts.instance.GetAll();
Agk agk = LogicAgk.instance.GetByNumber(id_agk);
foreach (Route route in lstRoute)
{
if (route.RefRouteAgk.id == agk.id)
{
Route newRoute = route;
newRoute.enabled = flag;
LogicRouts.instance.UpdateEnabled(newRoute);
}
}
}
[HttpPost]
public JObject Varification()
{
var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://46.226.227.171/api/json_info.php?on");
httpWebRequest.ContentType = "text/json";
httpWebRequest.Method = "POST";
try
{
var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var res = streamReader.ReadToEnd();
string str = res.ToString();
dynamic obj = JObject.Parse(res);
try
{
var lst = obj["notifications"];
foreach (var p in lst)
{
try
{
dynamic json = JValue.Parse(p.ToString());
int number = json.number;
bool notificationphone = json.notification;
Notification notification = LogicNotification.instance.GetNotificationByNumber(number);
notification.notificationphone = notificationphone;
LogicNotification.instance.Update(notification);
}
catch (Exception)
{
}
}
}
catch (Exception)
{
}
}
}
catch (Exception)
{
}
JObject result = JObject.FromObject(new
{
data = ""
});
return result;
}
//
/* var request = (HttpWebRequest) HttpWebRequest.Create("http://url");
request.Method = "POST";
const string command = @"Текст POST запроса";
byte[] bytes = Encoding.ASCII.GetBytes(command);
request.ContentLength = bytes.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(bytes, 0, bytes.Length);
}
using(var stream = new StreamReader(request.GetResponse().GetResponseStream()))
{
Console.WriteLine(stream.ReadToEnd());
}
//
*/
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using System.IO;
using ControlPanel.Models.Extend;
using System.Web;
using System.Web.Mvc;
namespace ControlPanel.Controllers
{
public class RoutsController : Controller
{
/// <summary>
/// Получение списка всех маршрутов
/// </summary>
/// <returns></returns>
public JObject GetLog(int page, int start, int limit, int id_subscriber)
{
List<ExtRoute> lstRouts = new List<ExtRoute>();
Subscribers subscriber = null;
try
{
try
{
subscriber = LogicSubscribers.instance.GetById(id_subscriber);
}
catch (Exception)
{
}
lstRouts = LogicRouts.instance.GetLog(page, start, limit, subscriber);
// lstRouts.Sort(delegate(ExtRoute obj1, ExtRoute obj2)
// { return obj1.titleagk.CompareTo(obj2.Name); });
}
catch (Exception ex)
{
//
}
lstRouts.Sort(delegate(ExtRoute obj1, ExtRoute obj2)
{ return obj2.id.CompareTo(obj1.id); });
JObject result = JObject.FromObject(new
{
total = LogicRouts.instance.Count(subscriber),
routs = lstRouts
});
return result;
}
public JObject EditRoute(int id,string titleszs,string titleagk,bool enabled)
{
try
{
Route route = LogicRouts.instance.GetById(id);
List<ExtAgk> lstAgk = LogicAgk.instance.GetExtAgk();
ExtAgk extagk = lstAgk.Find(x => x.title == titleagk);
Agk agk = LogicAgk.instance.GetById(extagk.id);
route.RefRouteAgk = agk;
route.enabled = enabled;
LogicRouts.instance.Edit(route);
}
catch (Exception)
{
}
JObject result = JObject.FromObject(new
{
data = ""
});
return result;
}
public JObject AddRoute(int id_subscribers,int id_agk)
{
ExtRoute routelast = null;
string error = "";
try
{
routelast = LogicRouts.instance.New(id_subscribers, id_agk);
if (true)
{
error = "Ошибка при добавлении нового маршрута, такая запись уже существует в базе!";
}
}
catch (Exception)
{
}
JObject result = JObject.FromObject(new
{
data = routelast,
error = error
});
return result;
}
public JObject GetExtRoute()
{
List<RouteExt> lstRouteExt = new List<RouteExt>();
try
{
List<ExtRoute> lstExtRoute = LogicRouts.instance.Get();
foreach (ExtRoute extroute in lstExtRoute)
lstRouteExt.Add(new RouteExt
{
id = extroute.id,
title = extroute.titleszs + " - " + extroute.titleagk
});
}
catch (Exception)
{
}
lstRouteExt.Add(new RouteExt { id = 0, title = "Все маршруты" });
lstRouteExt.Sort(delegate(RouteExt obj1, RouteExt obj2)
{ return obj2.id.CompareTo(obj1.id); });
JObject res = JObject.FromObject(new
{
routeext = lstRouteExt,
success = true,
total = lstRouteExt.Count
});
return res;
}
public JObject Delete(int id)
{
string error = "";
try
{
error = LogicRouts.instance.Delete(id);
}
catch (Exception)
{
}
JObject result = JObject.FromObject(new
{
error = error
});
return result;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace ControlPanel.Controllers
{
public class SoftInfoController : ApiController
{
// GET api/softinfo
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/softinfo/5
public string Get(int id)
{
return "value";
}
// POST api/softinfo
public void Post([FromBody]string value)
{
}
// PUT api/softinfo/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/softinfo/5
public void Delete(int id)
{
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Linq;
//using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using ControlPanel.Models.Extend;
using ControlPanel.Models;
using System.IO;
using System.Web;
using System.Web.Mvc;
/// jr
namespace ControlPanel.Controllers
{
public class SubscribersController : Controller
{
public JObject List()
{
List<Subscribers> lstSubscribers = new List<Subscribers>();
try
{
lstSubscribers = LogicSubscribers.instance.GetSubscribers();
lstSubscribers.Add(new Subscribers { Id = 0, Name = "Все подписчики", RegKey = "" });
lstSubscribers.Sort(delegate(Subscribers obj1, Subscribers obj2)
{ return obj1.Id.CompareTo(obj2.Id); });
}
catch (Exception ex)
{
//
}
JObject result = JObject.FromObject(new
{
subscribers = lstSubscribers,
success = true,
total = 0
});
return result;
}
/// <summary>
///
/// </summary>
/// <param name="page"></param>
/// <param name="start"></param>
/// <param name="limit"></param>
/// <returns></returns>
///
/*
public JObject GetLog(int page, int start, int limit)
{
List<Subscribers> lstSubscribers = LogicSubscribers.instance.GetLog(page, start, limit);
JObject result = JObject.FromObject(new
{
subscribers = lstSubscribers,
success = true,
total = LogicSubscribers.instance.Count()
});
return result;
}
*/
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Newtonsoft.Json.Linq;
using ControlPanel.Models.Szs;
using ControlPanel.LogicLayers;
using ControlPanel.Models;
using System.IO;
namespace ControlPanel.Controllers
{
public class SzsController : ApiController
{
public JObject GetLog(int page, int start, int limit, string date,string regkey )
{
List<MsgLog> buffer = new List<MsgLog>();
List<MsgLog> result = new List<MsgLog>();
DateTime dt1 = DateTime.Now;
DateTime dt2 = DateTime.Now;
try
{
buffer = LogicSzs.instance.GetLog(page, start, limit, date,regkey);
}
catch (Exception)
{
}
JObject res = JObject.FromObject(new
{
total = LogicSzs.instance.Count(date,regkey),
msglog = buffer
});
return res;
}
public void Confirm(string levelriver, string RegKey, string id_webapi_message, string id_agk )
{ try
{
LogicEvents.instance.Confirm(id_webapi_message.ToString(),id_agk.ToString(), RegKey.ToString());
}
catch(Exception)
{
}
}
/// <summary>
/// данные для диалога
/// </summary>
/// <returns></returns>
public JObject GetDataDialog(string regkey)
{
List<ExtLevelRiver> res = new List<ExtLevelRiver>();
try
{
// var RegKey = data["RegKey"];
//string regkey= RegKey.ToString();
res = LogicSzs.instance.GetLevelsNotConfirm(regkey);
res.Sort(delegate(ExtLevelRiver obj1, ExtLevelRiver obj2)
{ return obj2.titledatetimedevice.CompareTo(obj1.titledatetimedevice); });
// Сортировка по статусу
res.Sort(delegate(ExtLevelRiver obj1, ExtLevelRiver obj2)
{ return obj1.id_causeevent.CompareTo(obj2.id_causeevent); });
}
catch (Exception)
{
}
JObject result = JObject.FromObject(new { data = res });
return result;
}
/// <summary>
/// Получаем текущие сообщения для СЗС
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public JObject GetDataCurrentTable(string data)
{
List<ExtLevelRiver> lstExtLevelsRivers = new List<ExtLevelRiver>();
try
{
// var RegKey = data["RegKey"];
//string regkey = RegKey.ToString();
lstExtLevelsRivers = LogicSzs.instance.GetLastExtLevelRiver(data);
lstExtLevelsRivers.Sort(delegate(ExtLevelRiver obj1, ExtLevelRiver obj2)
{ return obj2.titledatetimedevice.CompareTo(obj1.titledatetimedevice); });
// Сортировка по статусу
lstExtLevelsRivers.Sort(delegate(ExtLevelRiver obj1, ExtLevelRiver obj2)
{ return obj2.id_causeevent.CompareTo(obj1.id_causeevent); });
}
catch (Exception)
{
}
JObject result = JObject.FromObject(new { data = lstExtLevelsRivers });
return result;
}
/// <summary>
/// Получаем название подписчика
/// </summary>
/// <param name="regkey"></param>
/// <returns></returns>
public JObject GetNameSubByregKey(string regkey)
{
string name = "";
try
{
List<Subscribers> lstSubscribers = LogicSubscribers.instance.GetSubByRegKey(regkey);
}
catch (Exception)
{
}
JObject result = JObject.FromObject(new { data = name });
return result;
}
/// <summary>
/// Получаем текущию дату и время
/// </summary>
/// <returns></returns>
public JObject GetDateTime()
{
string datetime="";
try
{
datetime=DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss");
}
catch(Exception)
{
}
JObject result = JObject.FromObject(new { data = datetime });
return result;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Newtonsoft.Json.Linq;
using ControlPanel.Models;
using System.Runtime.Serialization;
using ControlPanel.LogicLayers;
using System.IO;
using ControlPanel.Models.Extend;
using ControlPanel.Interfaces;
using ControlPanel.Interfaces.Reposytorys;
using ControlPanel.NHInplimentRepository;
using ControlPanel.ImplimentStrateges;
using ControlPanel.Contexts;
using System.Xml;
using System.Net;
using ControlPanel.LogicLayers;
namespace ControlPanel.Controllers
{
public class UpdInfoController : ApiController
{
public class Task
{
public bool isupdszs { get; set; }
public bool isupddb { get; set; }
public bool isdownload { get; set; }
}
/// <summary>
///
/// </summary>
/// <param name="page"></param>
/// <param name="start"></param>
/// <param name="limit"></param>
/// <returns></returns>
public JObject GetLog(int page, int start, int limit)
{
LogicUpdInfo.instance.InitTableInfo();
List<UpdInfoExt> lstUpdInfo = LogicUpdInfo.instance.GetLog(page, start, limit);
JObject result = JObject.FromObject(new
{
lstUpdInfo = lstUpdInfo,
success = true,
total = LogicUpdInfo.instance.Count()
});
return result;
}
/// <summary>
/// Получение статуса обновление БД на СЗС
/// </summary>
/// <param name="data"></param>
public void SetEndUpdDb(JObject data)
{
try
{
var RegKey = data["RegKey"];
var IsUpdSzs = data["isupddb"];
string regkey = RegKey.ToString();
bool isupddb = Convert.ToBoolean(IsUpdSzs.ToString());
LogicUpdInfo.instance.SetIsUpdDb(regkey, isupddb);
}
catch(Exception)
{
}
}
/// <summary>
/// Установка статуса обновления программы на СЗС
/// </summary>
/// <param name="data"></param>
public void SetEndUpdSoft(JObject data)
{
try
{
var RegKey = data["RegKey"];
var IsUpdDb = data["isupdszs"];
string regkey = RegKey.ToString();
bool isupddb = Convert.ToBoolean(IsUpdDb.ToString());
LogicUpdInfo.instance.SetIsUpdSzs(regkey, isupddb);
}
catch (Exception)
{
}
}
/// <summary>
/// Установка статуса загрузки новых версий script.sql и ПО Szs
/// </summary>
/// <param name="data"></param>
public void SetEndDownload(JObject data)
{
try
{
var RegKey = data["RegKey"];
var IsDownLoad = data["isdownload"];
string regkey = RegKey.ToString();
bool isdownload = Convert.ToBoolean(IsDownLoad.ToString());
LogicUpdInfo.instance.SetisUpdDownload(regkey, isdownload);
}
catch (Exception)
{
}
}
/// <summary>
/// Получение команд на обновление и загрузки данных
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public JObject InfoUpdate(JObject data)
{
UpdInfo updinfo = null;
try
{
var RegKey = data["RegKey"];
string regkey= RegKey.ToString();
List<Subscribers> lstSubsriber = LogicSubscribers.instance.GetSubByRegKey(regkey).ToList();
if (lstSubsriber[0] != null)
updinfo = LogicUpdInfo.instance.GetBySubsriber(lstSubsriber[0]);
}
catch (Exception)
{
}
Task task = new Task { isdownload = updinfo.isdownload, isupddb = updinfo.isupddb, isupdszs = updinfo.isupdszs };
JObject result = JObject.FromObject(new
{
result = task
});
return result;
}
/// <summary>
/// Установить к обновлению
/// </summary>
/// <param name="id"></param>
/// <param name="tobeupd"></param>
public void Update(JObject data)
{
try
{
dynamic json = JValue.Parse(data.ToString());
int id=json.id;
bool isupdszs=json.isupdszs;
bool isupddb=json.isupddb;
bool isdownload=json.isdownload;
LogicUpdInfo.instance.Edit(id, isupdszs,isupddb,isdownload);
}
catch (Exception)
{
}
}
/// <summary>
///
/// </summary>
// GET api/db
public IEnumerable<string> Get()
{
LogicUpdInfo.instance.InitTableInfo();
return new string[] { "Создание БД", "DataStorage" };
}
}
}
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.