本文整理汇总了C#中OracleConnection.CreateStoreCommand方法的典型用法代码示例。如果您正苦于以下问题:C# OracleConnection.CreateStoreCommand方法的具体用法?C# OracleConnection.CreateStoreCommand怎么用?C# OracleConnection.CreateStoreCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OracleConnection
的用法示例。
在下文中一共展示了OracleConnection.CreateStoreCommand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: migrateCaa
private void migrateCaa(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("caa");
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.CAA")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE") == "BG" ? "BGR" : r.Field<string>("CODE"),
Name = r.Field<string>("NAME"),
NameAlt = r.Field<string>("NAME_TRANS"),
Alias = r.Field<string>("CODE") == "BG" ? "BGR" : r.Field<string>("CODE"),
IsActive = r.Field<string>("VALID_YN") == "Y" ? true : false,
ParentValueId = noms["countries"].ByOldId(r.Field<decimal?>("COUNTRY_ID").ToString()).NomValueId(),
TextContentString = JsonConvert.SerializeObject(
new
{
heading = r.Field<string>("HEADING"),
headingAlt = r.Field<string>("HEADING_TRANS"),
subHeading = r.Field<string>("SUBHEADING"),
subHeadingAlt = r.Field<string>("SUBHEADING_TRANS"),
})
})
.ToList();
noms["caa"] = new Dictionary<string, NomValue>();
foreach (var row in results)
{
noms["caa"][row.OldId] = row;
nom.NomValues.Add(row);
}
}
示例2: migrateAircraftCategories
private void migrateAircraftCategories(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("aircraftCategories");
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_AC_CATEGORY")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("NAME"),
NameAlt = r.Field<string>("NAME_TRANS"),
Alias = null,
IsActive = r.Field<string>("VALID_YN") == "Y" ? true : false,
ParentValueId = null,
TextContentString = null
})
.ToList();
results.Add(new NomValue() {
OldId = "11",
Code = "VP",
Name = "Мотопарапланер",
NameAlt = "Paramotor-Trike",
Alias = null,
IsActive = true,
ParentValueId = null,
TextContentString = null
});
results.Add(new NomValue() {
OldId = "12",
Code = "GR",
Name = "Автожир",
NameAlt = "Gyroplane",
Alias = null,
IsActive = true,
ParentValueId = null,
TextContentString = null
});
noms["aircraftCategories"] = new Dictionary<string, NomValue>();
foreach (var row in results)
{
noms["aircraftCategories"][row.OldId] = row;
nom.NomValues.Add(row);
}
}
示例3: migrateAircraftOccurrenceClasses
private void migrateAircraftOccurrenceClasses(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("aircraftOccurrenceClasses");
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_SHORT_LISTS where domain = 'INCIDENT_CLASS'")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("MEANING"),
NameAlt = r.Field<string>("MEANING_TRANS"),
Alias = null,
IsActive = true,
ParentValueId = null,
TextContentString = null
})
.ToList();
noms["aircraftOccurrenceClasses"] = new Dictionary<string, NomValue>();
foreach (var row in results)
{
noms["aircraftOccurrenceClasses"][row.OldId] = row;
nom.NomValues.Add(row);
}
}
示例4: migrateRatingSubClasses
private void migrateRatingSubClasses(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("ratingSubClasses");
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_SUBCLASS_ATSM")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("DESCRIPTION"),
NameAlt = null,
Alias = null,
IsActive = r.Field<string>("VALID_YN") == "Y" ? true : false,
ParentValueId = noms["ratingClasses"].ByOldId(r.Field<decimal>("CLASS_ID").ToString()).NomValueId(),
TextContentString = null
})
.ToList();
noms["ratingSubClasses"] = new Dictionary<string, NomValue>();
foreach (var row in results)
{
noms["ratingSubClasses"][row.OldId] = row;
nom.NomValues.Add(row);
}
}
示例5: migrateSchools
private void migrateSchools(INomRepository repo, OracleConnection conn)
{
Func<string, int?> getGradId = (oldId) => noms["graduations"].ByOldId(oldId).NomValueId();
Nom nom = repo.GetNom("schools");
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.SCHOOL")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("NAME"),
NameAlt = r.Field<string>("NAME_TRANS"),
Alias = null,
IsActive = r.Field<string>("VALID_YN") == "Y" ? true : false,
ParentValueId = null,
TextContentString = JsonConvert.SerializeObject(
new
{
isPilotTraining = r.Field<string>("PILOT_TRAINING")== "Y" ? true : false,
graduationId = getGradId(r.Field<decimal?>("GRADUATION_ID").ToString()),
graduationIds = r.Field<string>("GRADUATION_ID_LIST")
.Split(':')
.Select(gi => getGradId(gi))
.Where(gi => gi.HasValue)
.Select(gi => gi.Value)
.ToArray()
})
})
.GroupBy(r => r.Name)
.ToList();
noms["schools"] = new Dictionary<string, NomValue>();
foreach (var rows in results)
{
foreach (var row in rows)
{
noms["schools"][row.OldId] = rows.First();
}
nom.NomValues.Add(rows.First());
}
}
示例6: migrateOrganizationTypes
private void migrateOrganizationTypes(INomRepository repo, OracleConnection oracleConection, SqlConnection sqlConnection)
{
Nom nom = repo.GetNom("organizationTypes");
var orgApexTypes = oracleConection.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_FIRM_TYPE")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("NAME"),
NameAlt = r.Field<string>("NAME_TRANS"),
Alias = null,
IsActive = r.Field<string>("VALID_YN") == "Y" ? true : false,
ParentValueId = null,
TextContentString = null
})
.ToList();
noms["organizationTypes"] = new Dictionary<string, NomValue>();
foreach (var row in orgApexTypes)
{
noms["organizationTypes"][row.OldId] = row;
nom.NomValues.Add(row);
}
List<string> addedCodes = orgApexTypes.Select(a => a.Code).ToList();
var orgFmTypes = sqlConnection.CreateStoreCommand(@"select * from OrgGrp")
.Materialize(r =>
new NomValue
{
OldId = null,
Code = r.Field<string>("Code"),
Name = r.Field<string>("Group Organization"),
NameAlt = r.Field<string>("Group Organization"),
Alias = null,
IsActive = true,
ParentValueId = null,
TextContentString = null
})
.ToList();
foreach (var row in orgFmTypes.Where(t => !addedCodes.Contains(t.Code)))
{
noms["organizationTypes"][Guid.NewGuid().ToString()] = row;
nom.NomValues.Add(row);
}
}
示例7: migratePersonStatusTypes
private void migratePersonStatusTypes(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("personStatusTypes");
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_SHORT_LISTS where domain = 'STATE_REASON'")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("MEANING"),
NameAlt = r.Field<string>("MEANING_TRANS"),
Alias = null,
IsActive = r.Field<string>("CODE") != "BR" ? true : false,
ParentValueId = null,
TextContentString = null
})
.ToList();
noms["personStatusTypes"] = new Dictionary<string, NomValue>();
foreach (var row in results)
{
noms["personStatusTypes"][row.OldId] = row;
nom.NomValues.Add(row);
}
}
示例8: migrateEmploymentCategories
private void migrateEmploymentCategories(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("employmentCategories");
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_JOB_CATEGORY")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("NAME"),
NameAlt = r.Field<string>("NAME_TRANS"),
ParentValueId = (r.Field<decimal?>("STAFF_TYPE_ID") != null) ? noms["staffTypes"][r.Field<decimal?>("STAFF_TYPE_ID").ToString()].NomValueId : (int?)null,
Alias = null,
TextContentString = JsonConvert.SerializeObject(
new
{
codeCA = r.Field<string>("CA_CODE"),
dateValidFrom = r.Field<DateTime?>("DATE_FROM"),
dateValidTo = r.Field<DateTime?>("DATE_TO")
}),
IsActive = true
})
.ToList();
noms["employmentCategories"] = new Dictionary<string, NomValue>();
foreach (var row in results)
{
noms["employmentCategories"][row.OldId] = row;
nom.NomValues.Add(row);
}
}
示例9: migrateGenders
private void migrateGenders(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("gender");
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_SEX")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("NAME"),
NameAlt = r.Field<string>("NAME_TRANS"),
ParentValueId = null,
Alias = r.Field<string>("NAME_TRANS"),
TextContentString = null,
IsActive = true
})
.ToList();
noms["gender"] = new Dictionary<string, NomValue>();
foreach (var row in results)
{
noms["gender"][row.OldId] = row;
nom.NomValues.Add(row);
}
}
示例10: migrateDocumentRoles
private void migrateDocumentRoles(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("documentRoles");
var categoryAliases = new Dictionary<string, string>()
{
{ "T", "check" },
{ "O", "training"},
{ "A", "other"},
{ "P", "docId"},
{ "F", "flying"},
{ "E", "graduation"}
};
Func<string, string, string> getCategoryAliases = (categoryCode, code) =>
{
var categoryAlias = categoryAliases[categoryCode];
if (categoryAlias == "training" && (code == "ENG" || code == "BG"))
{
return "languageCert";
}
return categoryAlias;
};
var roleAliases = new Dictionary<string, string>()
{
{ "ENG", "engCert" },
{ "BG", "bgCert" },
{ "BTT", "basicTrainingTheorExam" },
{ "RT1", "ratingTrainingTheorExam" },
{ "RT2", "ratingTrainingPractExam" },
{ "1", "flyingCheck" },
{ "3", "diploma" },
{ "4", "theoreticalTraining" },
{ "5", "flyingTraining" },
{ "6", "exam" },
{ "7", "simulator" },
{ "08", "education" },
{ "15", "practicalCheck" },
{ "25", "practicalTraining" },
{ "47A", "accessOrderPractEduc" },
{ "48A", "accessOrderWorkAlone" },
{ "49A", "checkAtWork" },
{ "50A", "theorExamTransEducation" },
{ "51A", "practExamPrelimEduc" },
{ "52A", "RPcert" },
{ "53", "practExamToGainAccess" },
{ "54", "practicalExams" }
};
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_DOCUMENT_ROLE")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("NAME"),
NameAlt = r.Field<string>("NAME_TRANS"),
Alias = roleAliases.ContainsKey(r.Field<string>("CODE")) ? roleAliases[r.Field<string>("CODE")] : null,
IsActive = r.Field<string>("VALID_YN") == "Y" ? true : false,
ParentValueId = null,
TextContentString = JsonConvert.SerializeObject(
new
{
caseTypeAlias =
noms["staffTypes"]
.ByCodeOrDefault(
noms["directions"]
.ByOldId(r.Field<string>("ID_DIRECTION"))
.Code())
.Alias(),
isPersonsOnly = r.Field<string>("PERSON_ONLY") == "Y" ? true : false,
categoryAlias = getCategoryAliases(r.Field<string>("CATEGORY_CODE"), r.Field<string>("CODE"))
})
})
.ToList();
results.Add(new NomValue()
{
OldId = "0",
Name = "Вътрешна проверка",
NameAlt = "Вътрешна проверка",
Alias = null,
IsActive = true,
TextContentString = JsonConvert.SerializeObject(
new
{
direction = 6393,
caseTypeAlia = "flightCrew",
isPersonsOnly = true,
categoryCode = "T",
categoryAlias = "check"
})
});
var systemTypes = new List<Tuple<string, string, string>>()
{
{ new Tuple<string,string, string>("Образование" , "education" , "personEducation")},
{ new Tuple<string,string, string>("Месторабота" , "employment" , "personEmployment")},
//.........这里部分代码省略.........
示例11: migrateDocumentTypes
private void migrateDocumentTypes(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("documentTypes");
string[] codes = {"3","4","5","115"};
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_DOCUMENT_TYPE")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("NAME"),
NameAlt = r.Field<string>("NAME_TRANS"),
Alias = null,
IsActive = r.Field<string>("VALID_YN") == "Y" ? true : false,
ParentValueId = null,
TextContentString = JsonConvert.SerializeObject(
new
{
caseTypeAlias =
noms["staffTypes"]
.ByCodeOrDefault(
noms["directions"]
.ByOldId(r.Field<string>("ID_DIRECTION"))
.Code())
.Alias(),
isPersonsOnly = r.Field<string>("PERSON_ONLY") == "Y" ? true : false,
isIdDocument = codes.Contains(r.Field<string>("CODE")) ? true : false
})
})
.ToList();
noms["documentTypes"] = new Dictionary<string, NomValue>();
foreach (var row in results)
{
noms["documentTypes"][row.OldId] = row;
nom.NomValues.Add(row);
}
}
示例12: migrateDirections
private void migrateDirections(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("directions");
var nameAlts = new Dictionary<string, string>()
{
{ "F", "Ekipaji" },
{ "T", "OVD"},
{ "G", "TO(AML)"},
{ "M", "TO(SUVD)"},
{ "C", "VS"},
{ "O", "Organizacii"},
};
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_DIRECTION")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("ID"),
Name = r.Field<string>("NAME"),
NameAlt = nameAlts[r.Field<string>("ID")],
Alias = null,
IsActive = true,
ParentValueId = null,
TextContentString = null
})
.ToList();
noms["directions"] = new Dictionary<string, NomValue>();
foreach (var row in results)
{
noms["directions"][row.OldId] = row;
nom.NomValues.Add(row);
}
}
示例13: migrateCountires
private void migrateCountires(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("countries");
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_COUNTRY")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("NAME"),
NameAlt = r.Field<string>("NAME_TRANS"),
ParentValueId = null,
Alias = r.Field<string>("CODE") == "BG" ? "BG" : null,
TextContentString = JsonConvert.SerializeObject(
new {
NationalityCodeCA = r.Field<string>("CA_NATIONALITY_CODE"),
Heading = r.Field<string>("HEADING"),
HeadingAlt = r.Field<string>("HEADING_TRANS"),
LicenceCodeCA = r.Field<string>("CA_LICENCE_CODE"),
}),
IsActive = true
})
.GroupBy(r => r.Name)
.ToList();
noms["countries"] = new Dictionary<string, NomValue>();
foreach (var rows in results)
{
foreach(var row in rows)
{
noms["countries"][row.OldId] = rows.First();
}
nom.NomValues.Add(rows.First());
}
}
示例14: migrateCities
private void migrateCities(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("cities");
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_TOWN_VILLAGE")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("NAME"),
NameAlt = r.Field<string>("NAME_TRANS"),
ParentValueId = noms["countries"].ByOldId(r.Field<decimal?>("COUNTRY_ID").ToString()).NomValueId(),
Alias = null,
TextContentString = JsonConvert.SerializeObject(
new
{
type = r.Field<string>("TV_TYPE"),
notes = r.Field<string>("NOTES"),
postCode = r.Field<string>("POSTAL_CODE_DEFAULT"),
oblCode = r.Field<string>("OBL_CODE"),
obstCode = r.Field<string>("OBST_CODE")
}),
IsActive = r.Field<string>("VALID_YN") == "Y" ? true : false
})
.GroupBy(r => r.Name)
.ToList();
noms["cities"] = new Dictionary<string, NomValue>();
foreach (var rows in results)
{
foreach (var row in rows)
{
noms["cities"][row.OldId] = rows.First();
}
nom.NomValues.Add(rows.First());
}
}
示例15: migrateLocationIndicators
private void migrateLocationIndicators(INomRepository repo, OracleConnection conn)
{
Nom nom = repo.GetNom("locationIndicators");
var results = conn.CreateStoreCommand(@"SELECT * FROM CAA_DOC.NM_INDICATOR")
.Materialize(r =>
new NomValue
{
OldId = r.Field<object>("ID").ToString(),
Code = r.Field<string>("CODE"),
Name = r.Field<string>("POSITION"),
NameAlt = r.Field<string>("POSITION_TRANS"),
Alias = null,
IsActive = true,
ParentValueId = null,
TextContentString = JsonConvert.SerializeObject(
new
{
type = r.Field<string>("FLAG_YN"),
})
})
.ToList();
noms["locationIndicators"] = new Dictionary<string, NomValue>();
foreach (var row in results)
{
noms["locationIndicators"][row.OldId] = row;
nom.NomValues.Add(row);
}
}