Beispiel #1
0
        /// <summary>
        /// Выгрузка модели телефонного справочника
        /// </summary>
        /// <param name="logic">Логика выборки</param>
        /// <param name="listparametr">Параметры</param>
        /// <returns>Возвращает объект для превращения его в схему</returns>
        public object GenerateSchemeXsdSql <TKey, TValue>(LogicaSelect logic, Dictionary <TKey, TValue> listparametr = null)
        {
            var sqlConnect = new SqlConnectionType();

            switch (logic.Id)
            {
            case 10:
                TelephoneHelp telephoneHelp = new TelephoneHelp
                {
                    TelephonHeaders =
                        ((TelephoneHelp)sqlConnect.SelectFullParametrSqlReader(ConnectionString, logic.SelectUser,
                                                                               typeof(TelephoneHelp), ModelSqlFullService.ParamCommand("1"))).TelephonHeaders,
                    TelephonBody =
                        ((TelephoneHelp)
                         sqlConnect.SelectFullParametrSqlReader(ConnectionString, logic.SelectUser,
                                                                typeof(TelephoneHelp), ModelSqlFullService.ParamCommand("2"))).TelephonBody
                };
                return(telephoneHelp);

            case 12:
                Book book = new Book
                {
                    BareCodeBook = new BareCodeBook(),
                    Organization = ((Book)sqlConnect.SelectFullParametrSqlReader(ConnectionString, logic.SelectUser, typeof(Book), listparametr)).Organization
                };
                return(book);

            default:
                return(null);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Создание процесса Прием КРСБ Наследника Массово
 /// </summary>
 /// <param name="conectstring">Строка соединения</param>
 /// <param name="setting">Настройки</param>
 /// <returns></returns>
 public string CreateKrsb(string conectstring, FullSetting setting)
 {
     try
     {
         var           delocreate    = new AddKrsb();
         var           sqlconnect    = new SqlConnectionType();
         SerializeJson serializeJson = new SerializeJson();
         if (setting.DeloPriem.DelaPriem.Count > 0)
         {
             delocreate.CreateDelo(setting.DeloPriem.DelaPriem);
             sqlconnect.StartingProcedure <string, string>(conectstring, ((ServiceWcf)
                                                                          sqlconnect.SelectFullParametrSqlReader(conectstring,
                                                                                                                 ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf),
                                                                                                                 ModelSqlFullService.ParamCommand("19"))).ServiceWcfCommand.Command);
             return(serializeJson.JsonLibary((CreateDela)sqlconnect.SelectFullParametrSqlReader <string, string>(conectstring,
                                                                                                                 ((ServiceWcf)
                                                                                                                  sqlconnect.SelectFullParametrSqlReader(conectstring,
                                                                                                                                                         ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf),
                                                                                                                                                         ModelSqlFullService.ParamCommand("20"))).ServiceWcfCommand.Command, typeof(CreateDela))));
         }
         Loggers.Log4NetLogger.Error(new Exception("Нет дел для создания процессов!!!"));
         return(null);
     }
     catch (Exception e)
     {
         Loggers.Log4NetLogger.Error(e);
         return(null);
     }
 }
Beispiel #3
0
        public string SqlSelect(string conectionstring, AngularModel command)
        {
            var           sqlconnect    = new SqlConnectionType();
            SerializeJson serializeJson = new SerializeJson();

            switch (command.Id)
            {
            case 1:
                return(serializeJson.JsonLibary((SysNum)sqlconnect.SelectFullParametrSqlReader <string, string>(conectionstring, command.Command, typeof(SysNum))));

            case 12:
                return(serializeJson.JsonLibary((Mail)sqlconnect.SelectFullParametrSqlReader <string, string>(conectionstring, command.Command, typeof(Mail))));

            case 13:
                return(serializeJson.JsonLibary((ModelFull)sqlconnect.SelectFullParametrSqlReader <string, string>(conectionstring, command.Command, typeof(ModelFull))));

            case 14:
                return
                    (serializeJson.JsonLibary(
                         (Soprovod)
                         sqlconnect.SelectFullParametrSqlReader <string, string>(conectionstring, command.Command,
                                                                                 typeof(Soprovod))));

            case 21: return(serializeJson.JsonLibary((No)sqlconnect.SelectFullParametrSqlReader <string, string>(conectionstring, command.Command, typeof(No))));

            default:
                return("Данная комманда не определена!!!");
            }
        }
Beispiel #4
0
        /// <summary>
        /// Данный блок относится к БДК
        /// </summary>
        /// <param name="conectionstring">Строка соединения</param>
        /// <param name="select">Команда Select</param>
        /// <returns>Возвращаем модель JSON в виде строки</returns>
        public string BdkSqlSelect(string conectionstring, string select)
        {
            var           sqlconnect    = new SqlConnectionType();
            SerializeJson serializeJson = new SerializeJson();

            return(serializeJson.JsonLibary((AnalisBdkFull)sqlconnect.SelectFullParametrSqlReader <string, string>(conectionstring, select, typeof(AnalisBdkFull))));
        }
Beispiel #5
0
        /// <summary>
        /// Возвращает название инспекции по номеру инспекции FullSetting.Inspection.Number
        /// </summary>
        /// <param name="conectionstring">Строка соединения</param>
        /// <param name="N279">Номер инспекции</param>
        /// <returns>Название инспекции</returns>
        public Insp Inspection(string conectionstring, string N279)
        {
            var sqlconnect = new SqlConnectionType();
            Dictionary <string, string> listparametr = new Dictionary <string, string>();

            listparametr.Add("@N279", N279);
            return((Insp)sqlconnect.SelectFullParametrSqlReader(conectionstring, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(conectionstring, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand("30"))).ServiceWcfCommand.Command, typeof(Insp), listparametr));
        }
Beispiel #6
0
        /// <summary>
        /// Вытаскиваем внутреннею команду с сайта
        /// </summary>
        /// <param name="setting">Параметры</param>
        /// <returns></returns>
        private ServiceWcf Service(FullSetting setting)
        {
            var sqlConnect = new SqlConnectionType();

            return
                ((ServiceWcf)
                 sqlConnect.SelectFullParametrSqlReader(ConnectionString, ModelSqlFullService.ProcedureSelectParametr,
                                                        typeof(ServiceWcf), ModelSqlFullService.ParamCommand(setting.Id.ToString())));
        }
        /// <summary>
        /// Конструктор выполнения процедуры на сервере
        /// </summary>
        /// <param name="connectin"></param>
        public SelectInventory(string connectin)
        {
            Connection = connectin;
            var sqlconnect = new SqlConnectionType();

            Command =
                (InventarizationCommandWcfToSql)
                sqlconnect.SelectFullParametrSqlReader(Connection, ModelProcedure.ModelProcedure.ProcedureSelect,
                                                       typeof(InventarizationCommandWcfToSql), ModelProcedure.ModelProcedure.ParamCommand("1"));
        }
Beispiel #8
0
        /// <summary>
        /// Вытягивание выборки на сайт для подставления в нее параметров данных
        /// </summary>
        /// <param name="conectionstring">Строка соединения</param>
        /// <param name="setting">Параметры настройки</param>
        /// <returns></returns>
        public string ServiceCommand(string conectionstring, FullSetting setting)
        {
            var           sqlconnect    = new SqlConnectionType();
            SerializeJson serializeJson = new SerializeJson();

            return(serializeJson.JsonLibary(
                       (ServiceWcf)
                       sqlconnect.SelectFullParametrSqlReader(conectionstring, ModelSqlFullService.ProcedureSelectParametr,
                                                              typeof(ServiceWcf), ModelSqlFullService.ParamCommand(setting.ParamService.IdCommand.ToString()))));
        }
Beispiel #9
0
        /// <summary>
        /// Шаблон который используем написано кустарно нужно давать Ун шаблона на вход!!!
        /// </summary>
        /// <param name="conectionstring">Строка соединения</param>
        /// <param name="setting">Параметры шаблона</param>
        /// <returns></returns>
        public Document Template(string conectionstring, FullSetting setting)
        {
            var sqlconnect = new SqlConnectionType();
            Dictionary <string, string> listparametr = new Dictionary <string, string>();

            GenerateParametrSql.GenerateParametrSql sql = new GenerateParametrSql.GenerateParametrSql();
            if (setting.UseTemplate.IdTemplate != 0)
            {
                sql.CreateParamert(ref listparametr, setting.UseTemplate.GetType(), setting.UseTemplate);
            }
            return((Document)sqlconnect.SelectFullParametrSqlReader(conectionstring, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(conectionstring, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand("10"))).ServiceWcfCommand.Command, typeof(Document), listparametr));
        }
        /// <summary>
        /// Выборка Всех из БД B зависимости от номера 1: Пользователи 2: Отделы и т д
        /// </summary>
        /// <returns></returns>
        public string SelectFull(ModelParametr.ModelParametr parametr)
        {
            var           sqlconnect    = new SqlConnectionType();
            SerializeJson serializeJson = new SerializeJson();

            switch (parametr.IdParamSelect)
            {
            case 1:
                return
                    (serializeJson.JsonLibrary(
                         (AllUsers)
                         sqlconnect.SelectFullParametrSqlReader(Connection, Command.InfoLogic.NameProcedure,
                                                                typeof(AllUsers), ModelProcedure.ModelProcedure.ParamCommand(parametr.IdParamSelect.ToString()))));

            default:
                return(null);
            }
        }
Beispiel #11
0
 /// <summary>
 /// Данные которые будут раскладываться на шаблоне
 /// </summary>
 /// <param name="conectionstring">Строка соединения с сервером</param>
 /// <param name="connecttestsqlcommand">Строка соединения с таблицей комманд для запроса данных</param>
 /// <param name="setting">Настроики пользователя</param>
 /// <returns></returns>
 public Report ReportBdk(string conectionstring, string connecttestsqlcommand, FullSetting setting)
 {
     try
     {
         var sqlconnect = new SqlConnectionType();
         Dictionary <string, string>             listparametr = new Dictionary <string, string>();
         GenerateParametrSql.GenerateParametrSql sql          = new GenerateParametrSql.GenerateParametrSql();
         if (setting.ParametrBdkOut.D85DateStart != DateTime.MinValue)
         {
             sql.CreateParamert(ref listparametr, setting.ParametrBdkOut.GetType(), setting.ParametrBdkOut);
         }
         return((Report)sqlconnect.SelectFullParametrSqlReader(conectionstring, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connecttestsqlcommand, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand("11"))).ServiceWcfCommand.Command, typeof(Report), listparametr));
     }
     catch (Exception e)
     {
         Loggers.Log4NetLogger.Error(e);
     }
     return(null);
 }
Beispiel #12
0
        /// <summary>
        /// Выполнение команды на сервере под номером
        /// </summary>
        /// <param name="setting">Параметры</param>
        /// <returns></returns>
        public string SqlSelect(FullSetting setting)
        {
            var           sqlConnect    = new SqlConnectionType();
            SerializeJson serializeJson = new SerializeJson();
            var           ping          = new PingIp.PingIp();

            switch (setting.Id)
            {
            case 29:
                var server =
                    ping.Ping(
                        (ServerAndComputer)
                        sqlConnect.SelectFullParametrSqlReader <string, string>(ConnectionString,
                                                                                Service(setting).ServiceWcfCommand.Command, typeof(ServerAndComputer)));
                return(serializeJson.JsonLibrary(server));

            default:
                return("Данная команда не определена!!!");
            }
        }
Beispiel #13
0
        /// <summary>
        /// Подгрузка БДК Статистики
        /// </summary>
        /// <param name="setting"></param>
        /// <returns></returns>
        public async Task <string> LoaderBdk(FullSetting setting)
        {
            var selectfull = new SelectFull();

            switch (setting.Db)
            {
            case "Work":
                var sqlconnect = new SqlConnectionType();
                return
                    (await Task.Factory.StartNew(
                         () =>
                         selectfull.BdkSqlSelect(_parametrService.ConectWork,
                                                 ((ServiceWcf)
                                                  sqlconnect.SelectFullParametrSqlReader(_parametrService.ConectWork,
                                                                                         ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf),
                                                                                         ModelSqlFullService.ParamCommand("7"))).ServiceWcfCommand.Command)));

            default:
                return(null);
            }
        }
Beispiel #14
0
        /// <summary>
        /// Процедуры выполнения создания КРСБ
        /// </summary>
        /// <param name="connection">Строка соединения</param>
        /// <param name="seting">Настройки</param>
        /// <returns></returns>
        public async Task <string> TaskSqlProcedureKrsb(string connection, FullSetting seting)
        {
            var sqlconnect = new SqlConnectionType();
            Dictionary <string, dynamic> listparametr = new Dictionary <string, dynamic>();

            if (seting.DeloCreate.DateDelo != System.DateTime.MinValue)
            {
                listparametr.Add("@DateStart", seting.DeloCreate.DateDelo.Date);
            }
            if (seting.DeloCreate.D3979 != 0)
            {
                listparametr.Add("@D3979", seting.DeloCreate.D3979);
            }
            if (!String.IsNullOrWhiteSpace(seting.DeloCreate.Okato))
            {
                listparametr.Add("@Okato", seting.DeloCreate.Okato);
            }
            switch (seting.ParamService.IdCommand)
            {
            case 22:
                if (seting.DeloPriem.DelaPriem.Count > 0)
                {
                    //Добавляем в таблицу данные для дальнейшего анализа
                    AddKrsb krsb = new AddKrsb();
                    krsb.CreateDeloAnalizKrsb(seting.DeloPriem.DelaPriem);
                }
                return(await Task.Factory.StartNew(() => sqlconnect.StartingProcedure(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand(seting.ParamService.IdCommand.ToString()))).ServiceWcfCommand.Command, listparametr)));

            case 23:
                return(await Task.Factory.StartNew(() => sqlconnect.StartingProcedure(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand(seting.ParamService.IdCommand.ToString()))).ServiceWcfCommand.Command, listparametr)));

            case 24:
                return(await Task.Factory.StartNew(() => sqlconnect.StartingProcedure(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand(seting.ParamService.IdCommand.ToString()))).ServiceWcfCommand.Command, listparametr)));

            case 25:
                return(await Task.Factory.StartNew(() => sqlconnect.StartingProcedure(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand(seting.ParamService.IdCommand.ToString()))).ServiceWcfCommand.Command, listparametr)));

            case 27:
                return(await Task.Factory.StartNew(() => sqlconnect.StartingProcedure(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand(seting.ParamService.IdCommand.ToString()))).ServiceWcfCommand.Command, listparametr)));

            default:
                return(null);
            }
        }
Beispiel #15
0
        /// <summary>
        /// Данный блок относится к слиянию лиц
        /// </summary>
        /// <param name="conectionstring">Строка соединения</param>
        /// <param name="select">Параметры выборки</param>
        /// <returns>Модель Face</returns>
        public Face FaceError(string conectionstring, string select)
        {
            var sqlconnect = new SqlConnectionType();

            return((Face)sqlconnect.SelectFullParametrSqlReader <string, string>(conectionstring, select, typeof(Face)));
        }
Beispiel #16
0
        /// <summary>
        /// Процедуры предпроверки
        /// </summary>
        /// <param name="connection">Строка соединения</param>
        /// <param name="seting">Настройки</param>
        /// <returns></returns>
        public async Task <string> TaskSqlProcedureSoprovod(string connection, FullSetting seting)
        {
            var sqlconnect = new SqlConnectionType();

            GenerateParametrSql.GenerateParametrSql sql          = new GenerateParametrSql.GenerateParametrSql();
            Dictionary <string, string>             listparametr = new Dictionary <string, string>();

            if (seting.ParamPredproverka.N441 != 0)
            {
                sql.CreateParamert(ref listparametr, seting.ParamPredproverka.GetType(), seting.ParamPredproverka);
            }
            switch (seting.Id)
            {
            case 1:
                return(await Task.Factory.StartNew(() => sqlconnect.StartingProcedure(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand("15"))).ServiceWcfCommand.Command, listparametr)));

            case 2:
                return(await Task.Factory.StartNew(() => sqlconnect.StartingProcedure(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand("16"))).ServiceWcfCommand.Command, listparametr)));

            case 3:
                return(await Task.Factory.StartNew(() => sqlconnect.StartingProcedure(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand("17"))).ServiceWcfCommand.Command, listparametr)));

            default:
                return(null);
            }
        }
Beispiel #17
0
        /// <summary>
        /// Выбор процедуры в зависимости от настроек:
        /// 1 - Процедура добавления значения на добавления а название под ун 3
        /// 2 - Процедура запуска процесса решений а название под ун 4
        /// 3 - Процедура запуска инкассовых поручений а название под ун 5
        /// Процесс генерации параметров для процедуры нужно улучшить!!!!
        /// </summary>
        /// <param name="connection">Строка соединения</param>
        /// <param name="seting">Настойки</param>
        /// <returns>Строка с ответа с сервера</returns>
        public async Task <string> TaskSqlProcedure(string connection, FullSetting seting)
        {
            var sqlconnect = new SqlConnectionType();
            Dictionary <string, int> listparametr = new Dictionary <string, int>();

            if (seting.ParametrReshen.D270 != 0)
            {
                listparametr.Add("@D270", seting.ParametrReshen.D270);
            }
            switch (seting.Id)
            {
            case 1:
                return(await Task.Factory.StartNew(() => sqlconnect.StartingProcedure(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand("3"))).ServiceWcfCommand.Command, listparametr)));

            case 2:
                return(await Task.Factory.StartNew(() => sqlconnect.StartingProcedure(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand("4"))).ServiceWcfCommand.Command, listparametr)));

            case 3:
                return(await Task.Factory.StartNew(() => sqlconnect.StartingProcedure(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand("5"))).ServiceWcfCommand.Command, listparametr)));

            default:
                return(null);
            }
        }
Beispiel #18
0
        public async Task <DataSet> TaskSqlProcedureKam5(string connection, FullSetting seting)
        {
            var sqlconnect = new SqlConnectionType();

            GenerateParametrSql.GenerateParametrSql sql          = new GenerateParametrSql.GenerateParametrSql();
            Dictionary <string, string>             listparametr = new Dictionary <string, string>();

            if (seting.ReportRvs.Qvartal != 0)
            {
                sql.CreateParamert(ref listparametr, seting.ReportRvs.GetType(), seting.ReportRvs);
            }
            switch (seting.ParamService.IdCommand)
            {
            case 28:
                return(await await Task.Factory.StartNew(() => sqlconnect.ProcedureReturnTable(connection, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(connection, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand(seting.ParamService.IdCommand.ToString()))).ServiceWcfCommand.Command, seting.ModelUser.UserNameGuide, listparametr)));

            default:
                return(null);
            }
        }
Beispiel #19
0
        /// <summary>
        /// Выбор файла для передачи
        /// </summary>
        /// <param name="path">Путь к файлу</param>
        /// <param name="filename">Имя файла</param>
        /// <param name="conectionstring">Строка соединения с БД для формирования таблицы</param>
        /// <returns></returns>
        public async Task <Stream> SelectDonloadsFile(string path, string filename, string conectionstring = null, DataSet dataSet = null)
        {
            var sqlconnect = new SqlConnectionType();
            var xlsx       = new ReportExcel();

            switch (filename)
            {
            case "Требования.xlsx":
                if (File.Exists(Path.Combine(path, filename)))
                {
                    return
                        (await Task.Factory.StartNew <Stream>(
                             () => DonloadFile(Path.Combine(path, filename))));
                }
                return(null);

            case "Бдк.xlsx":
                xlsx.ReportSave(path, "Бдк", "Бдк", sqlconnect.ReportQbe(conectionstring, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(conectionstring, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand("6"))).ServiceWcfCommand.Command));
                if (File.Exists(Path.Combine(path, filename)))
                {
                    return
                        (await Task.Factory.StartNew <Stream>(
                             () => DonloadFile(Path.Combine(path, filename))));
                }
                xlsx.Dispose();
                return(null);

            case "Истребование.xlsx":
                xlsx.ReportSave(path, "Истребование", "Не доделки по документам", sqlconnect.ReportQbe(conectionstring, ((ServiceWcf)sqlconnect.SelectFullParametrSqlReader(conectionstring, ModelSqlFullService.ProcedureSelectParametr, typeof(ServiceWcf), ModelSqlFullService.ParamCommand("18"))).ServiceWcfCommand.Command));
                if (File.Exists(Path.Combine(path, filename)))
                {
                    return
                        (await Task.Factory.StartNew <Stream>(
                             () => DonloadFile(Path.Combine(path, filename))));
                }
                xlsx.Dispose();
                return(null);

            case "Камеральный №5.xlsx":
                xlsx.ReportSave(path, "Камеральный №5", "Отчет", dataSet);
                if (File.Exists(Path.Combine(path, filename)))
                {
                    return
                        (await Task.Factory.StartNew <Stream>(
                             () => DonloadFile(Path.Combine(path, filename))));
                }
                xlsx.Dispose();
                return(null);

            default:
                return(null);
            }
        }