本文整理汇总了C#中OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities.AddToT_WQX_BIO_HABITAT_INDEX方法的典型用法代码示例。如果您正苦于以下问题:C# OpenEnvironmentEntities.AddToT_WQX_BIO_HABITAT_INDEX方法的具体用法?C# OpenEnvironmentEntities.AddToT_WQX_BIO_HABITAT_INDEX怎么用?C# OpenEnvironmentEntities.AddToT_WQX_BIO_HABITAT_INDEX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities
的用法示例。
在下文中一共展示了OpenEnvironmentEntities.AddToT_WQX_BIO_HABITAT_INDEX方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertOrUpdateWQX_BIO_HABITAT_INDEX
// *************************** BIO INDICES******************************
// *********************************************************************
public static int InsertOrUpdateWQX_BIO_HABITAT_INDEX(global::System.Int32? bIO_HABITAT_INDEX_IDX, global::System.String oRG_ID, global::System.Int32? mONLOC_IDX,
global::System.String iNDEX_ID, global::System.String iNDEX_TYPE_ID, global::System.String iNDEX_TYPE_ID_CONTEXT, global::System.String INDEX_TYPE_NAME,
global::System.String rESOURCE_TITLE, global::System.String rESOURCE_CREATOR, global::System.String rESOURCE_SUBJECT, global::System.String rESOURCE_PUBLISHER,
global::System.DateTime? rESOURCE_DATE, global::System.String rESOURCE_ID, global::System.String iNDEX_TYPE_SCALE, global::System.String iNDEX_SCORE, global::System.String iNDEX_QUAL_CD,
global::System.String iNDEX_COMMENT, global::System.DateTime? iNDEX_CALC_DATE, Boolean? wQX_IND, global::System.String wQX_SUBMIT_STATUS, DateTime? WQX_UPDATE_DT, Boolean? aCT_IND, String cREATE_USER = "system")
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
Boolean insInd = false;
try
{
T_WQX_BIO_HABITAT_INDEX a = new T_WQX_BIO_HABITAT_INDEX();
if (bIO_HABITAT_INDEX_IDX != null)
a = (from c in ctx.T_WQX_BIO_HABITAT_INDEX
where c.BIO_HABITAT_INDEX_IDX == bIO_HABITAT_INDEX_IDX
select c).FirstOrDefault();
if (bIO_HABITAT_INDEX_IDX == null) //insert case
{
a = new T_WQX_BIO_HABITAT_INDEX();
insInd = true;
}
if (oRG_ID != null) a.ORG_ID = oRG_ID;
if (mONLOC_IDX != null) a.MONLOC_IDX = mONLOC_IDX;
if (iNDEX_ID != null) a.INDEX_ID = iNDEX_ID;
if (iNDEX_TYPE_ID != null) a.INDEX_TYPE_ID = iNDEX_TYPE_ID;
if (iNDEX_TYPE_ID_CONTEXT != null) a.INDEX_TYPE_ID_CONTEXT = iNDEX_TYPE_ID_CONTEXT;
if (INDEX_TYPE_NAME != null) a.INDEX_TYPE_NAME = INDEX_TYPE_NAME;
if (rESOURCE_TITLE != null) a.RESOURCE_TITLE = rESOURCE_TITLE;
if (rESOURCE_CREATOR != null) a.RESOURCE_CREATOR = rESOURCE_CREATOR;
if (rESOURCE_SUBJECT != null) a.RESOURCE_SUBJECT = rESOURCE_SUBJECT;
if (rESOURCE_PUBLISHER != null) a.RESOURCE_PUBLISHER = rESOURCE_PUBLISHER;
if (rESOURCE_DATE != null) a.RESOURCE_DATE = (DateTime)rESOURCE_DATE;
if (rESOURCE_ID != null) a.RESOURCE_ID = rESOURCE_ID;
if (iNDEX_TYPE_SCALE != null) a.INDEX_TYPE_SCALE = iNDEX_TYPE_SCALE;
if (iNDEX_SCORE != null) a.INDEX_SCORE = iNDEX_SCORE;
if (iNDEX_QUAL_CD != null) a.INDEX_QUAL_CD = iNDEX_QUAL_CD;
if (iNDEX_COMMENT != null) a.INDEX_COMMENT = iNDEX_COMMENT;
if (iNDEX_CALC_DATE != null) a.INDEX_CALC_DATE = iNDEX_CALC_DATE;
if (wQX_SUBMIT_STATUS != null) a.WQX_SUBMIT_STATUS = wQX_SUBMIT_STATUS;
if (aCT_IND != null) a.ACT_IND = aCT_IND;
if (wQX_IND != null) a.WQX_IND = wQX_IND;
if (insInd) //insert case
{
a.CREATE_USERID = cREATE_USER.ToUpper();
a.CREATE_DT = System.DateTime.Now;
ctx.AddToT_WQX_BIO_HABITAT_INDEX(a);
}
else
{
a.UPDATE_USERID = cREATE_USER.ToUpper();
a.UPDATE_DT = System.DateTime.Now;
}
ctx.SaveChanges();
return a.BIO_HABITAT_INDEX_IDX;
}
catch (Exception ex)
{
return 0;
}
}
}