本文整理汇总了C#中OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_PROJECT方法的典型用法代码示例。如果您正苦于以下问题:C# OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_PROJECT方法的具体用法?C# OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_PROJECT怎么用?C# OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_PROJECT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities
的用法示例。
在下文中一共展示了OpenEnvironmentEntities.AddToT_WQX_IMPORT_TEMP_PROJECT方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertOrUpdateWQX_IMPORT_TEMP_PROJECT
// *************************** IMPORT: PROJECT ******************************
// *****************************************************************************
public static int InsertOrUpdateWQX_IMPORT_TEMP_PROJECT(global::System.Int32? tEMP_PROJECT_IDX, string uSER_ID, global::System.Int32? pROJECT_IDX, global::System.String oRG_ID,
global::System.String pROJECT_ID, global::System.String pROJECT_NAME, global::System.String pROJECT_DESC, global::System.String sAMP_DESIGN_TYPE_CD,
global::System.Boolean? qAPP_APPROVAL_IND, global::System.String qAPP_APPROVAL_AGENCY, string sTATUS_CD, string sTATUS_DESC)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
Boolean insInd = false;
try
{
T_WQX_IMPORT_TEMP_PROJECT a = new T_WQX_IMPORT_TEMP_PROJECT();
if (tEMP_PROJECT_IDX != null)
a = (from c in ctx.T_WQX_IMPORT_TEMP_PROJECT
where c.TEMP_PROJECT_IDX == tEMP_PROJECT_IDX
select c).FirstOrDefault();
else
insInd = true;
if (uSER_ID != null)
{
a.USER_ID = uSER_ID;
if (uSER_ID.Length > 25) { sTATUS_CD = "F"; sTATUS_DESC += "User ID length exceeded. "; }
}
if (pROJECT_IDX != null) a.PROJECT_IDX = pROJECT_IDX;
if (oRG_ID != null) a.ORG_ID = oRG_ID;
if (pROJECT_ID != null)
{
a.PROJECT_ID = pROJECT_ID.SubStringPlus(0, 35).Trim();
if (pROJECT_ID.Length > 35) { sTATUS_CD = "F"; sTATUS_DESC += "Project ID length exceeded. "; }
T_WQX_PROJECT ptemp = db_WQX.GetWQX_PROJECT_ByIDString(pROJECT_ID, oRG_ID);
if (ptemp != null) { sTATUS_CD = "F"; sTATUS_DESC += "Project ID already exists. "; }
}
if (!string.IsNullOrEmpty(pROJECT_NAME))
{
a.PROJECT_NAME = pROJECT_NAME.SubStringPlus(0, 120).Trim();
if (pROJECT_NAME.Length > 120) { sTATUS_CD = "F"; sTATUS_DESC += "Project Name length exceeded. "; }
}
if (!string.IsNullOrEmpty(pROJECT_DESC))
{
a.PROJECT_DESC = pROJECT_DESC.SubStringPlus(0, 1999);
if (pROJECT_DESC.Length > 1999) { sTATUS_CD = "F"; sTATUS_DESC += "Project Description length exceeded. "; }
}
if (!string.IsNullOrEmpty(sAMP_DESIGN_TYPE_CD))
{
a.SAMP_DESIGN_TYPE_CD = sAMP_DESIGN_TYPE_CD.Trim().SubStringPlus(0, 20);
if (sAMP_DESIGN_TYPE_CD.Length > 20) { sTATUS_CD = "F"; sTATUS_DESC += "Sample Design Type Code length exceeded. "; }
}
if (qAPP_APPROVAL_IND != null)
{
a.QAPP_APPROVAL_IND = qAPP_APPROVAL_IND;
}
if (!string.IsNullOrEmpty(qAPP_APPROVAL_AGENCY))
{
a.QAPP_APPROVAL_AGENCY = qAPP_APPROVAL_AGENCY.SubStringPlus(0, 50);
if (qAPP_APPROVAL_AGENCY.Length > 50) { sTATUS_CD = "F"; sTATUS_DESC += "QAPP Approval Agency length exceeded. "; }
}
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_PROJECT(a);
ctx.SaveChanges();
return a.TEMP_PROJECT_IDX;
}
catch (Exception ex)
{
sTATUS_CD = "F";
sTATUS_DESC += "Unspecified error. ";
return 0;
}
}
}