コード例 #1
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);
            }
        }
コード例 #2
0
ファイル: AngularRestEf.cs プロジェクト: mathewsun/My
 /// <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);
     }
 }
コード例 #3
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);
            }
        }
コード例 #4
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);
            }
        }