本文整理汇总了C#中OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities.AddToT_WQX_REF_TAXA_ORG方法的典型用法代码示例。如果您正苦于以下问题:C# OpenEnvironmentEntities.AddToT_WQX_REF_TAXA_ORG方法的具体用法?C# OpenEnvironmentEntities.AddToT_WQX_REF_TAXA_ORG怎么用?C# OpenEnvironmentEntities.AddToT_WQX_REF_TAXA_ORG使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities
的用法示例。
在下文中一共展示了OpenEnvironmentEntities.AddToT_WQX_REF_TAXA_ORG方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertOrUpdateT_WQX_REF_TAXA_ORG
public static int InsertOrUpdateT_WQX_REF_TAXA_ORG(global::System.String bIO_SUBJECT_TAXAONOMY, global::System.String oRG_NAME, global::System.String cREATE_USER_ID)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
Boolean insInd = true;
T_WQX_REF_TAXA_ORG a = new T_WQX_REF_TAXA_ORG();
if (ctx.T_WQX_REF_TAXA_ORG.Any(o => o.BIO_SUBJECT_TAXONOMY == bIO_SUBJECT_TAXAONOMY && o.ORG_ID == oRG_NAME))
{
//update case
a = (from c in ctx.T_WQX_REF_TAXA_ORG
where c.BIO_SUBJECT_TAXONOMY == bIO_SUBJECT_TAXAONOMY
&& c.ORG_ID == oRG_NAME
select c).FirstOrDefault();
insInd = false;
}
a.BIO_SUBJECT_TAXONOMY = bIO_SUBJECT_TAXAONOMY;
a.ORG_ID = oRG_NAME;
if (insInd) //insert case
{
a.CREATE_DT = System.DateTime.Now;
a.CREATE_USERID = cREATE_USER_ID;
ctx.AddToT_WQX_REF_TAXA_ORG(a);
}
ctx.SaveChanges();
return 1;
}
catch (Exception ex)
{
return 0;
}
}
}