本文整理汇总了C#中OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_MONLOC方法的典型用法代码示例。如果您正苦于以下问题:C# OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_MONLOC方法的具体用法?C# OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_MONLOC怎么用?C# OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_MONLOC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities
的用法示例。
在下文中一共展示了OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_MONLOC方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertWQX_IMPORT_TEMP_MONLOC_New
public static int InsertWQX_IMPORT_TEMP_MONLOC_New(string uSER_ID, string oRG_ID, Dictionary<string, string> colVals)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
//get import config rules
List<ConfigInfoType> _allRules = Utils.GetAllColumnInfo("M");
T_WQX_IMPORT_TEMP_MONLOC a = new T_WQX_IMPORT_TEMP_MONLOC();
a.IMPORT_STATUS_CD = "P";
a.IMPORT_STATUS_DESC = "";
if (!string.IsNullOrEmpty(uSER_ID)) a.USER_ID = uSER_ID;
if (!string.IsNullOrEmpty(oRG_ID)) a.ORG_ID = oRG_ID;
//*************** PRE CUSTOM VALIDATION **********************************************
string _t = null;
_t = Utils.GetValueOrDefault(colVals, "TRIBAL_LAND_IND");
if (!string.IsNullOrEmpty(_t))
{
if (_t.ToUpper() == "TRUE") colVals["TRIBAL_LAND_IND"] = "Y";
if (_t.ToUpper() == "FALSE") colVals["TRIBAL_LAND_IND "] = "N";
}
//if there is a match of county value to reference data text (in case user is importing county text instead of code)
_t = Utils.GetValueOrDefault(colVals, "COUNTY_CODE");
if (!string.IsNullOrEmpty(_t))
{
T_WQX_REF_COUNTY c = db_Ref.GetT_WQX_REF_COUNTY_ByCountyNameAndState(Utils.GetValueOrDefault(colVals, "STATE_CODE"), _t);
if (c != null)
a.COUNTY_CODE = c.COUNTY_CODE;
else
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "COUNTY_CODE");
}
//********************** end custom validation ********************************************
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "MONLOC_ID");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "MONLOC_NAME");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "MONLOC_TYPE");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "MONLOC_DESC");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "HUC_EIGHT");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "HUC_TWELVE");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "TRIBAL_LAND_IND");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "TRIBAL_LAND_NAME");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "LATITUDE_MSR");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "LONGITUDE_MSR");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "SOURCE_MAP_SCALE");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "HORIZ_COLL_METHOD");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "HORIZ_REF_DATUM");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "VERT_MEASURE");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "VERT_MEASURE_UNIT");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "VERT_COLL_METHOD");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "VERT_REF_DATUM");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "COUNTRY_CODE");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "STATE_CODE");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "WELL_TYPE");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "AQUIFER_NAME");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "FORMATION_TYPE");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "WELLHOLE_DEPTH_MSR");
WQX_IMPORT_TEMP_MONLOC_GenVal(ref a, _allRules, colVals, "WELLHOLE_DEPTH_MSR_UNIT");
//*************** POST CUSTOM VALIDATION **********************************************
if (!string.IsNullOrEmpty(a.MONLOC_ID))
if (db_WQX.GetWQX_MONLOC_ByIDString(oRG_ID, a.MONLOC_ID) != null) { a.IMPORT_STATUS_CD = "F"; a.IMPORT_STATUS_DESC += "Monitoring Location ID already exists. "; }
decimal ii;
if (!string.IsNullOrEmpty(a.LATITUDE_MSR))
if (Decimal.TryParse(a.LATITUDE_MSR, out ii) == false) { a.IMPORT_STATUS_CD = "F"; a.IMPORT_STATUS_DESC += "Latitude is not decimal format. "; }
if (!string.IsNullOrEmpty(a.LONGITUDE_MSR))
if (Decimal.TryParse(a.LONGITUDE_MSR, out ii) == false) { a.IMPORT_STATUS_CD = "F"; a.IMPORT_STATUS_DESC += "Longitude is not decimal format. "; }
//*************** END CUSTOM VALIDATION **********************************************
ctx.AddToT_WQX_IMPORT_TEMP_MONLOC(a);
ctx.SaveChanges();
return a.TEMP_MONLOC_IDX;
}
catch (Exception ex)
{
return 0;
}
}
}
示例2: InsertOrUpdateWQX_IMPORT_TEMP_MONLOC
//.........这里部分代码省略.........
}
if (!string.IsNullOrEmpty(vERT_MEASURE_UNIT))
{
a.VERT_MEASURE_UNIT = vERT_MEASURE_UNIT.Trim().SubStringPlus(0, 12);
if (db_Ref.GetT_WQX_REF_DATA_ByKey("MeasureUnit", vERT_MEASURE_UNIT.Trim()) == false) { sTATUS_CD = "F"; sTATUS_DESC += "Vertical Measure Unit not valid. "; }
}
if (!string.IsNullOrEmpty(vERT_COLL_METHOD))
{
a.VERT_COLL_METHOD = vERT_COLL_METHOD.Trim().SubStringPlus(0, 50);
if (db_Ref.GetT_WQX_REF_DATA_ByKey("VerticalCollectionMethod", vERT_COLL_METHOD.Trim()) == false) { sTATUS_CD = "F"; sTATUS_DESC += "Vertical Collection Method not acceptable. "; }
}
if (!string.IsNullOrEmpty(vERT_REF_DATUM))
{
a.VERT_REF_DATUM = vERT_REF_DATUM.Trim().SubStringPlus(0, 6);
if (db_Ref.GetT_WQX_REF_DATA_ByKey("VerticalCoordinateReferenceSystemDatum", vERT_REF_DATUM.Trim()) == false) { sTATUS_CD = "F"; sTATUS_DESC += "Vertical Collection Datum not acceptable. "; }
}
if (!string.IsNullOrEmpty(cOUNTRY_CODE))
{
//if there is a match of country NAME value to reference data text (in case user is importing country name instead of code)
T_WQX_REF_DATA rd = db_Ref.GetT_WQX_REF_DATA_ByTextGetRow("Country", cOUNTRY_CODE);
if (rd != null)
a.COUNTRY_CODE = rd.VALUE.SubStringPlus(0, 2);
else
{
a.COUNTRY_CODE = cOUNTRY_CODE.SubStringPlus(0, 2);
if (cOUNTRY_CODE.Length > 2) { sTATUS_CD = "F"; sTATUS_DESC += "Country Code length exceeded. "; }
}
}
if (!string.IsNullOrEmpty(sTATE_CODE))
{
//if there is a match of state value to reference data text (in case user is importing state name instead of code)
T_WQX_REF_DATA rd = db_Ref.GetT_WQX_REF_DATA_ByTextGetRow("State", sTATE_CODE);
if (rd != null)
a.STATE_CODE = rd.VALUE;
else
{
a.STATE_CODE = sTATE_CODE.SubStringPlus(0, 2);
if (sTATE_CODE.Length > 2) { sTATUS_CD = "F"; sTATUS_DESC += "State Code length exceeded. "; }
}
}
if (!string.IsNullOrEmpty(cOUNTY_CODE))
{
//if there is a match of county value to reference data text (in case user is importing county text instead of code)
T_WQX_REF_COUNTY c = db_Ref.GetT_WQX_REF_COUNTY_ByCountyNameAndState(sTATE_CODE, cOUNTY_CODE);
if (c != null)
a.COUNTY_CODE = c.COUNTY_CODE;
else
{
a.COUNTY_CODE = cOUNTY_CODE.SubStringPlus(0, 3);
if (cOUNTY_CODE.Length > 3) { sTATUS_CD = "F"; sTATUS_DESC += "County Code length exceeded. "; }
}
}
if (!string.IsNullOrEmpty(wELL_TYPE))
{
a.WELL_TYPE = wELL_TYPE.Trim().SubStringPlus(0, 255);
}
if (!string.IsNullOrEmpty(aQUIFER_NAME))
{
a.AQUIFER_NAME = aQUIFER_NAME.Trim().SubStringPlus(0, 120);
}
if (!string.IsNullOrEmpty(fORMATION_TYPE))
{
a.FORMATION_TYPE = fORMATION_TYPE.Trim().SubStringPlus(0, 50);
}
if (!string.IsNullOrEmpty(wELLHOLE_DEPTH_MSR))
{
a.WELLHOLE_DEPTH_MSR = wELLHOLE_DEPTH_MSR.Trim().SubStringPlus(0, 12);
}
if (!string.IsNullOrEmpty(wELLHOLE_DEPTH_MSR_UNIT))
{
a.WELLHOLE_DEPTH_MSR_UNIT = wELLHOLE_DEPTH_MSR_UNIT.Trim().SubStringPlus(0, 12);
}
if (sTATUS_CD != null) a.IMPORT_STATUS_CD = sTATUS_CD;
if (sTATUS_DESC != null) a.IMPORT_STATUS_DESC = sTATUS_DESC.SubStringPlus(0, 100);
if (insInd) //insert case
ctx.AddToT_WQX_IMPORT_TEMP_MONLOC(a);
ctx.SaveChanges();
return a.TEMP_MONLOC_IDX;
}
catch (Exception ex)
{
return 0;
}
}
}