本文整理汇总了C#中OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities.AddToT_WQX_ORGANIZATION方法的典型用法代码示例。如果您正苦于以下问题:C# OpenEnvironmentEntities.AddToT_WQX_ORGANIZATION方法的具体用法?C# OpenEnvironmentEntities.AddToT_WQX_ORGANIZATION怎么用?C# OpenEnvironmentEntities.AddToT_WQX_ORGANIZATION使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities
的用法示例。
在下文中一共展示了OpenEnvironmentEntities.AddToT_WQX_ORGANIZATION方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertOrUpdateT_WQX_ORGANIZATION
public static int InsertOrUpdateT_WQX_ORGANIZATION(string oRG_ID, string oRG_NAME, string oRG_DESC, string tRIBAL_CODE, string eLECTRONIC_ADDRESS,
string eLECTRONICADDRESSTYPE, string tELEPHONE_NUM, string tELEPHONE_NUM_TYPE, string TELEPHONE_EXT, string cDX_SUBMITTER_ID,
string cDX_SUBMITTER_PWD, bool? cDX_SUBMIT_IND, string dEFAULT_TIMEZONE, string cREATE_USER = "system", string mAIL_ADDRESS = null,
string mAIL_ADD_CITY = null, string mAIL_ADD_STATE = null, string mAIL_ADD_ZIP = null)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
Boolean insInd = false;
try
{
T_WQX_ORGANIZATION a = new T_WQX_ORGANIZATION();
if (oRG_ID != null)
a = (from c in ctx.T_WQX_ORGANIZATION
where c.ORG_ID == oRG_ID
select c).FirstOrDefault();
if (a == null) //insert case
{
a = new T_WQX_ORGANIZATION();
insInd = true;
a.ORG_ID = oRG_ID;
}
if (oRG_NAME != null) a.ORG_FORMAL_NAME = oRG_NAME;
if (oRG_DESC != null) a.ORG_DESC = oRG_DESC;
if (tRIBAL_CODE != null) a.TRIBAL_CODE = tRIBAL_CODE;
if (eLECTRONIC_ADDRESS != null) a.ELECTRONICADDRESS = eLECTRONIC_ADDRESS;
if (eLECTRONICADDRESSTYPE != null) a.ELECTRONICADDRESSTYPE = eLECTRONICADDRESSTYPE;
if (tELEPHONE_NUM != null) a.TELEPHONE_NUM = tELEPHONE_NUM;
if (tELEPHONE_NUM_TYPE != null) a.TELEPHONE_NUM_TYPE = tELEPHONE_NUM_TYPE;
if (TELEPHONE_EXT != null) a.TELEPHONE_EXT = TELEPHONE_EXT;
if (dEFAULT_TIMEZONE != null) a.DEFAULT_TIMEZONE = dEFAULT_TIMEZONE;
if (cDX_SUBMITTER_ID != null) a.CDX_SUBMITTER_ID = cDX_SUBMITTER_ID;
if (cDX_SUBMIT_IND != null) a.CDX_SUBMIT_IND = cDX_SUBMIT_IND;
if (cDX_SUBMITTER_PWD != null && cDX_SUBMITTER_PWD != "--------")
{
//encrypt CDX submitter password for increased security
string encryptOauth = new SimpleAES().Encrypt(cDX_SUBMITTER_PWD);
encryptOauth = System.Web.HttpUtility.UrlEncode(encryptOauth);
a.CDX_SUBMITTER_PWD_HASH = encryptOauth;
}
if (dEFAULT_TIMEZONE != null) a.DEFAULT_TIMEZONE = dEFAULT_TIMEZONE;
if (mAIL_ADDRESS != null) a.MAILING_ADDRESS = mAIL_ADDRESS;
if (mAIL_ADD_CITY != null) a.MAILING_ADD_CITY = mAIL_ADD_CITY;
if (mAIL_ADD_STATE != null) a.MAILING_ADD_STATE = mAIL_ADD_STATE;
if (mAIL_ADD_ZIP != null) a.MAILING_ADD_ZIP = mAIL_ADD_ZIP;
if (insInd) //insert case
{
a.CREATE_USERID = cREATE_USER.ToUpper();
a.CREATE_DT = System.DateTime.Now;
ctx.AddToT_WQX_ORGANIZATION(a);
}
else
{
a.UPDATE_USERID = cREATE_USER.ToUpper();
a.UPDATE_DT = System.DateTime.Now;
}
ctx.SaveChanges();
return 1;
}
catch (Exception ex)
{
return 0;
}
}
}