//БейзФайл без всяких там public static Guid CreateBaseFile(string contentType, byte[] content, string name) { string connectionString = $"Data Source={CustomRequestInt.GetSettingByKey<string>("DataSource")},{CustomRequestInt.GetSettingByKey<string>("Port")};Initial Catalog={CustomRequestInt.GetSettingByKey<string>("InitialCatalog")};Persist Security Info=True;User ID={CustomRequestInt.GetSettingByKey<string>("UserId")};Password={CustomRequestInt.GetSettingByKey<string>("Password")}"; using (SqlConnection connection = new SqlConnection(connectionString)) using (SqlCommand command = connection.CreateCommand()) { //string Name = "main.xsd"; Guid id = Guid.NewGuid(); DateTime createDate = DateTime.Now; command.Parameters.AddWithValue("@id", id); command.Parameters.AddWithValue("@name", name); command.Parameters.AddWithValue("@content", content); command.Parameters.AddWithValue("@contentType", contentType); command.Parameters.AddWithValue("@createDate", createDate); command.CommandText = $"INSERT INTO [BaseFiles] (Id, CreateDate, Name, ContentType, Content) VALUES(@id, @createDate, @name, @contentType, @content)"; try { connection.Open(); command.ExecuteNonQuery(); connection.Close(); return(id); } catch (Exception ex) { Console.WriteLine("Не удалось обновить данные в БД", ex.InnerException.Message); return(Guid.Empty); } } }
/// <summary> /// Получение айди задачи для получения шаблона отчетности /// </summary> /// <returns></returns> public static string ReturnTaskId() { string conString = $"Data Source={CustomRequestInt.GetSettingByKey<string>("DataSource")},{CustomRequestInt.GetSettingByKey<string>("Port")};Initial Catalog={CustomRequestInt.GetSettingByKey<string>("InitialCatalog")};Persist Security Info=True;User ID={CustomRequestInt.GetSettingByKey<string>("UserId")};Password={CustomRequestInt.GetSettingByKey<string>("Password")}"; //string conString = "Data Source=localhost;Initial Catalog=LoginScreen;Integrated Security=True"; SqlConnection con = new SqlConnection(conString); string selectSql = $"SELECT TOP (1) CatalogTaskId from [{CustomRequestInt.GetSettingByKey<string>("InitialCatalog")}].[dbo].[CatalogTasksToReportForms]"; SqlCommand com = new SqlCommand(selectSql, con); string item = null; try { con.Open(); using (SqlDataReader read = com.ExecuteReader()) { while (read.Read()) { item = (read["CatalogTaskId"].ToString()); } } return(item); } catch (Exception ex) { Console.WriteLine(ex.Message); return(item); } finally { con.Close(); } }
public static IEnumerable <TestCaseData> BlockTestTestData() { Random rnd = new Random(); //Создаем массив из перечисления Array values = Enum.GetValues(typeof(BlockingReasonType)); //Вытягиваем рандомно элемент BlockingReasonType randomType = (BlockingReasonType)values.GetValue(rnd.Next(values.Length)); yield return(new TestCaseData(randomType, CustomRequestInt.GetSettingByKey <string>("AccountIdForBlock"), 200)); }
public static IEnumerable <TestCaseData> AccountGeRegistryTypesTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("AccountIdGetUfr"), CustomRequestInt.GetSettingByKey <string>("EndedAtGetUfr"), 200)); }
public static IEnumerable <TestCaseData> AccountGetAvatarTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("AccountId"), 200)); }
public static IEnumerable <TestCaseData> SetUFRAdditionalInfoTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("SetAdditionalInfoAccountId"), CustomRequestInt.GetSettingByKey <string>("AdditionalInfoRegistryTypeToAccountId"), CustomRequestInt.GetSettingByKey <string>("AdditionalInfoAdditionalFieldsBlockId"), CustomRequestInt.GetSettingByKey <string>("IdDateOfDecide"), CustomRequestInt.GetSettingByKey <string>("idDateEnd"), 200)); }
//Для AdminIB public static IEnumerable <TestCaseData> LoginAdminIBTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("LoginAdminIB"), CustomRequestInt.GetSettingByKey <string>("PassAdminIB"), 200)); }
public static IEnumerable <TestCaseData> SendToNevaActualInfoTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("AccountId"), 200)); }
public static IEnumerable <TestCaseData> AccountGetUserCatalogsThisAccountTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("AccountIdGetUfr"), CustomRequestInt.GetSettingByKey <string>("AccountCatalogId"), CustomRequestInt.GetSettingByKey <int>("page"), CustomRequestInt.GetSettingByKey <int>("pageSize"), 200)); }
public static IEnumerable <TestCaseData> RejectTestTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("RejectReason"), 200)); }
public static IEnumerable <TestCaseData> AcceptCredentialsTestTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("AccountIdForAccept"), 200)); }
public static IEnumerable <TestCaseData> UnBlockTestTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("AccountIdForUnBlock"), 200)); }
public static IEnumerable <TestCaseData> TestSendBlockingReasonTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("AccountIdBlock"), 200)); }
public static IEnumerable <TestCaseData> ExportTestTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("isactual"), 200)); }
public static IEnumerable <TestCaseData> AccountGetUfrConfigurationTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("AccountIdGetUfr"), 200)); }
public static IEnumerable <TestCaseData> AccountGetCertificatesTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("AccountIdGetUfr"), CustomRequestInt.GetSettingByKey <int>("page"), CustomRequestInt.GetSettingByKey <int>("pageSize"), 200)); }
public static IEnumerable <TestCaseData> GetMessagesTestTestData() { MessageVmType type = MessageVmType.All; yield return(new TestCaseData(type, CustomRequestInt.GetSettingByKey <string>("AccountId"), CustomRequestInt.GetSettingByKey <int>("pageForGetMessages"), CustomRequestInt.GetSettingByKey <int>("size"), 200)); }
public static IEnumerable <TestCaseData> GetAddInfoTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("GenerateCredentialsAccountId"), 200)); }
public static IEnumerable <TestCaseData> GetActionsTestTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("AccountId"), CustomRequestInt.GetSettingByKey <int>("pageForGetActionsUFR"), CustomRequestInt.GetSettingByKey <int>("size"), 200)); }
public static IEnumerable <TestCaseData> SaveUFRConfigurationTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("SaveConfigSettingsAccountId"), CustomRequestInt.GetSettingByKey <bool>("RufrSync"), CustomRequestInt.GetSettingByKey <long>("PersonalPacketSize"), CustomRequestInt.GetSettingByKey <long>("PersonalQuotaSize"), 200)); }
public static IEnumerable <TestCaseData> UFREditTestData() { yield return(new TestCaseData(CustomRequestInt.GetSettingByKey <string>("idUfrForEdit"), CustomRequestInt.GetSettingByKey <string>("ShortName"), /*CustomRequestInt.GetSettingByKey<string>("FirstName"), CustomRequestInt.GetSettingByKey<string>("SecondName"), CustomRequestInt.GetSettingByKey<string>("Patronymic"),*/ CustomRequestInt.GetSettingByKey <string>("Code"), CustomRequestInt.GetSettingByKey <string>("OGRN"), CustomRequestInt.GetSettingByKey <string>("INN"), CustomRequestInt.GetSettingByKey <string>("BIC"), CustomRequestInt.GetSettingByKey <string>("RegNum"), CustomRequestInt.GetSettingByKey <string>("IssuedCertificateNumber"), CustomRequestInt.GetSettingByKey <string>("InclusionDate"), CustomRequestInt.GetSettingByKey <string>("CreationDate"), CustomRequestInt.GetSettingByKey <string>("Email"), CustomRequestInt.GetSettingByKey <string>("Address"), CustomRequestInt.GetSettingByKey <string>("Phone"), CustomRequestInt.GetSettingByKey <string>("TerritorialInstituteId"), CustomRequestInt.GetSettingByKey <string>("OrgLegalFormCode"), CustomRequestInt.GetSettingByKey <string>("PersonalAccountStatus"), CustomRequestInt.GetSettingByKey <string>("EnterpriseType"), CustomRequestInt.GetSettingByKey <string>("AccountStatus"), 200)); }