//dbo.PatentRegNum /// <summary> /// Добавление регистрационных номеров в систему для отработки /// </summary> /// <param name="templatePatent">Шаблон для добавления</param> /// <param name="userIdGuid">GUID Пользователя</param> public void AddRegNumPatentModel(TemplatePatent templatePatent, string userIdGuid) { try { var logicModel = Automation.LogicsSelectAutomations.FirstOrDefault(logic => logic.Id == 25); if (logicModel != null) { EventSqlEf.EventSqlEf eventMessage = new EventSqlEf.EventSqlEf() { UserNameGuid = userIdGuid }; var con = (SqlConnection)Automation.Database.Connection; con.FireInfoMessageEventOnUserErrors = true; Automation.Database.CommandTimeout = 120000; con.InfoMessage += eventMessage.Con_InfoMessageSignalR; Automation.Database.ExecuteSqlCommand(logicModel.SelectUser, new SqlParameter { ParameterName = logicModel.SelectedParametr.Split(',')[0], Value = CreteParameterTableSql(templatePatent.RegNumberPatent, "RegNumPatent", typeof(long)), TypeName = "dbo.PatentRegNum", SqlDbType = SqlDbType.Structured }); } } catch (Exception ex) { Loggers.Log4NetLogger.Error(ex); } }
/// <summary> /// Добавление регистрационных номеров патента для отработки /// /// </summary> /// <param name="templatePatent">Шаблон для добавления</param> /// <param name="userIdGuid">GUID Пользователя</param> /// <returns></returns> public async Task AddRegNumberPatent(TemplatePatent templatePatent, string userIdGuid) { await Task.Factory.StartNew(() => { var model = new ModelGetPost(); model.AddRegNumPatentModel(templatePatent, userIdGuid); model.Dispose(); }); }