本文整理汇总了C#中OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities.SaveChanges方法的典型用法代码示例。如果您正苦于以下问题:C# OpenEnvironmentEntities.SaveChanges方法的具体用法?C# OpenEnvironmentEntities.SaveChanges怎么用?C# OpenEnvironmentEntities.SaveChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenEnvironment.App_Logic.DataAccessLayer.OpenEnvironmentEntities
的用法示例。
在下文中一共展示了OpenEnvironmentEntities.SaveChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateT_OE_USERS
//*****************USERS **********************************
public static int CreateT_OE_USERS(global::System.String uSER_ID, global::System.String pWD_HASH, global::System.String pWD_SALT, global::System.String fNAME, global::System.String lNAME, global::System.String eMAIL, global::System.Boolean aCT_IND, global::System.Boolean iNITAL_PWD_FLAG, global::System.DateTime? lASTLOGIN_DT, global::System.String pHONE, global::System.String pHONE_EXT, global::System.String cREATE_USER)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
T_OE_USERS u = new T_OE_USERS();
u.USER_ID = uSER_ID;
u.PWD_HASH = pWD_HASH;
u.PWD_SALT = pWD_SALT;
u.FNAME = fNAME;
u.LNAME = lNAME;
u.EMAIL = eMAIL;
u.ACT_IND = aCT_IND;
u.INITAL_PWD_FLAG = iNITAL_PWD_FLAG;
u.EFFECTIVE_DT = System.DateTime.Now;
u.LASTLOGIN_DT = lASTLOGIN_DT;
u.PHONE = pHONE;
u.PHONE_EXT = pHONE_EXT;
u.CREATE_DT = System.DateTime.Now;
u.CREATE_USERID = cREATE_USER;
ctx.AddToT_OE_USERS(u);
ctx.SaveChanges();
return u.USER_IDX;
}
catch (Exception ex)
{
return 0;
}
}
}
示例2: DeleteT_OE_ColumnConfig
public static int DeleteT_OE_ColumnConfig(int columnConfig_IDX)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
T_OE_COLUMNCONFIG r = new T_OE_COLUMNCONFIG();
r = (from c in ctx.T_OE_COLUMNCONFIG where c.COLUMNCONFIG_IDX == columnConfig_IDX select c).FirstOrDefault();
ctx.DeleteObject(r);
ctx.SaveChanges();
return 1;
}
catch
{
return 0;
}
}
}
示例3: DeleteT_WQX_IMPORT_LOG
public static int DeleteT_WQX_IMPORT_LOG(int iMPORT_ID)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
T_WQX_IMPORT_LOG r = new T_WQX_IMPORT_LOG();
r = (from c in ctx.T_WQX_IMPORT_LOG
where c.IMPORT_ID == iMPORT_ID select c).FirstOrDefault();
ctx.DeleteObject(r);
ctx.SaveChanges();
return 1;
}
catch
{
return 0;
}
}
}
示例4: DeleteT_ATTAINS_ASSESS
public static int DeleteT_ATTAINS_ASSESS(int aSSESS_IDX)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
T_ATTAINS_ASSESS r = (from c in ctx.T_ATTAINS_ASSESS
where c.ATTAINS_ASSESS_IDX == aSSESS_IDX
select c).FirstOrDefault();
ctx.DeleteObject(r);
ctx.SaveChanges();
return 1;
}
catch
{
return 0;
}
}
}
示例5: DeleteT_WQX_REF_TAXA_ORG
public static int DeleteT_WQX_REF_TAXA_ORG(string orgName, string charName)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
T_WQX_REF_TAXA_ORG r = new T_WQX_REF_TAXA_ORG();
r = (from c in ctx.T_WQX_REF_TAXA_ORG
where c.ORG_ID == orgName
&& c.BIO_SUBJECT_TAXONOMY == charName
select c).FirstOrDefault();
ctx.DeleteObject(r);
ctx.SaveChanges();
return 1;
}
catch
{
return 0;
}
}
}
示例6: CreateT_VCCB_USER_ROLE
public static int CreateT_VCCB_USER_ROLE(global::System.Int32 rOLE_IDX, global::System.Int32 uSER_IDX, global::System.String cREATE_USER = "system")
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
T_OE_USER_ROLES ur = new T_OE_USER_ROLES();
ur.ROLE_IDX = rOLE_IDX;
ur.USER_IDX = uSER_IDX;
ur.CREATE_DT = System.DateTime.Now;
ur.CREATE_USERID = cREATE_USER;
ctx.AddToT_OE_USER_ROLES(ur);
ctx.SaveChanges();
return 1;
}
catch (Exception ex)
{
return 0;
}
}
}
示例7: CreateT_OE_ROLES
//*****************ROLES **********************************
public static int CreateT_OE_ROLES(global::System.String rOLE_NAME, global::System.String rOLE_DESC, global::System.String cREATE_USER = "system")
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
T_OE_ROLES r = new T_OE_ROLES();
r.ROLE_NAME = rOLE_NAME;
r.ROLE_DESC = rOLE_DESC;
r.CREATE_DT = System.DateTime.Now;
r.CREATE_USERID = cREATE_USER;
ctx.AddToT_OE_ROLES(r);
ctx.SaveChanges();
return 1;
}
catch (Exception ex)
{
return 0;
}
}
}
示例8: UpdateT_WQX_REF_DATAByIDX
public static int UpdateT_WQX_REF_DATAByIDX(global::System.Int32 IDX, global::System.String vALUE, global::System.String tEXT, Boolean ActInd)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
T_WQX_REF_DATA a = new T_WQX_REF_DATA();
a = (from c in ctx.T_WQX_REF_DATA
where c.REF_DATA_IDX == IDX
select c).FirstOrDefault();
if (vALUE != null) a.VALUE = vALUE;
if (tEXT != null) a.TEXT = Utils.SubStringPlus(tEXT, 0, 200);
a.UPDATE_DT = System.DateTime.Now;
a.ACT_IND = ActInd;
ctx.SaveChanges();
return 1;
}
catch (Exception ex)
{
return 0;
}
}
}
示例9: UpdateWQX_IMPORT_LOG_MarkPendingSampImportAsComplete
public static int UpdateWQX_IMPORT_LOG_MarkPendingSampImportAsComplete(string oRG_ID)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
T_WQX_IMPORT_LOG t = new T_WQX_IMPORT_LOG();
t = (from c in ctx.T_WQX_IMPORT_LOG
where c.IMPORT_PROGRESS == "P"
&& c.TYPE_CD == "Sample"
select c).FirstOrDefault();
t.IMPORT_STATUS = "Success";
t.IMPORT_PROGRESS = "100";
t.IMPORT_PROGRESS_MSG = "Import complete.";
ctx.SaveChanges();
return t.IMPORT_ID;
}
catch
{
return 0;
}
}
}
示例10: InsertUpdateWQX_TRANSACTION_LOG
//*********************** WQX TRANSACTION LOG*******************************
public static int InsertUpdateWQX_TRANSACTION_LOG(int? lOG_ID, string tABLE_CD, int tABLE_IDX, string sUBMIT_TYPE, byte[] rESPONSE_FILE,
string rESPONSE_TXT, string cDX_SUBMIT_TRANS_ID, string cDX_SUBMIT_STATUS, string oRG_ID)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
//try
//{
T_WQX_TRANSACTION_LOG t = new T_WQX_TRANSACTION_LOG();
if (lOG_ID != null)
t = (from c in ctx.T_WQX_TRANSACTION_LOG
where c.LOG_ID == lOG_ID
select c).First();
if (lOG_ID == null)
t = new T_WQX_TRANSACTION_LOG();
if (tABLE_CD != null) t.TABLE_CD = tABLE_CD;
t.TABLE_IDX = tABLE_IDX;
if (sUBMIT_TYPE != null) t.SUBMIT_TYPE = sUBMIT_TYPE;
if (rESPONSE_FILE != null) t.RESPONSE_FILE = rESPONSE_FILE;
if (rESPONSE_TXT != null) t.RESPONSE_TXT = rESPONSE_TXT;
if (cDX_SUBMIT_TRANS_ID != null) t.CDX_SUBMIT_TRANSID = cDX_SUBMIT_TRANS_ID;
if (cDX_SUBMIT_STATUS != null) t.CDX_SUBMIT_STATUS = cDX_SUBMIT_STATUS;
if (oRG_ID != null) t.ORG_ID = oRG_ID;
if (lOG_ID == null) //insert case
{
t.SUBMIT_DT = System.DateTime.Now;
ctx.AddToT_WQX_TRANSACTION_LOG(t);
}
ctx.SaveChanges();
return t.LOG_ID;
//}
//catch
//{
// return 0;
//}
}
}
示例11: UpdateT_OE_APP_TASKS
public static int UpdateT_OE_APP_TASKS(string tASK_NAME, string tASK_STATUS, int? tASK_FREQ_MS, string mODIFY_USERID)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
T_OE_APP_TASKS t = new T_OE_APP_TASKS();
t = (from c in ctx.T_OE_APP_TASKS
where c.TASK_NAME == tASK_NAME
select c).First();
if (tASK_STATUS != null) t.TASK_STATUS = tASK_STATUS;
if (tASK_FREQ_MS != null) t.TASK_FREQ_MS = (int)tASK_FREQ_MS;
if (mODIFY_USERID != null) t.MODIFY_USERID = mODIFY_USERID;
t.MODIFY_DT = System.DateTime.Now;
ctx.SaveChanges();
return t.TASK_IDX;
}
catch
{
return 0;
}
}
}
示例12: InsertOrUpdateT_WQX_REF_CHAR_ORG
public static int InsertOrUpdateT_WQX_REF_CHAR_ORG(global::System.String cHAR_NAME, global::System.String oRG_NAME, global::System.String cREATE_USER_ID,
string dEFAULT_DETECT_LIMIT, string dEFAULT_UNIT, int? dEFAULT_ANAL_METHOD_IDX, string dEFAULT_SAMP_FRACTION, string dEFAULT_RESULT_STATUS, string dEFAULT_RESULT_VALUE_TYPE)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
Boolean insInd = true;
T_WQX_REF_CHAR_ORG a = new T_WQX_REF_CHAR_ORG();
if (ctx.T_WQX_REF_CHAR_ORG.Any(o => o.CHAR_NAME == cHAR_NAME && o.ORG_ID == oRG_NAME))
{
//update case
a = (from c in ctx.T_WQX_REF_CHAR_ORG
where c.CHAR_NAME == cHAR_NAME
&& c.ORG_ID == oRG_NAME
select c).FirstOrDefault();
insInd = false;
}
a.CHAR_NAME = cHAR_NAME;
a.ORG_ID = oRG_NAME;
if (dEFAULT_DETECT_LIMIT != null) a.DEFAULT_DETECT_LIMIT = dEFAULT_DETECT_LIMIT;
if (dEFAULT_UNIT != null) a.DEFAULT_UNIT = dEFAULT_UNIT;
if (dEFAULT_ANAL_METHOD_IDX != null) a.DEFAULT_ANAL_METHOD_IDX = dEFAULT_ANAL_METHOD_IDX;
if (dEFAULT_SAMP_FRACTION != null) a.DEFAULT_SAMP_FRACTION = dEFAULT_SAMP_FRACTION;
if (dEFAULT_RESULT_STATUS != null) a.DEFAULT_RESULT_STATUS = dEFAULT_RESULT_STATUS;
if (dEFAULT_RESULT_VALUE_TYPE != null) a.DEFAULT_RESULT_VALUE_TYPE = dEFAULT_RESULT_VALUE_TYPE;
if (insInd) //insert case
{
a.CREATE_DT = System.DateTime.Now;
a.CREATE_USERID = cREATE_USER_ID;
ctx.AddToT_WQX_REF_CHAR_ORG(a);
}
ctx.SaveChanges();
return 1;
}
catch (Exception ex)
{
return 0;
}
}
}
示例13: DeleteT_ATTAINS_REPORT
public static int DeleteT_ATTAINS_REPORT(int aTTAINS_REPORT_IDX)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
T_ATTAINS_REPORT r = (from c in ctx.T_ATTAINS_REPORT
where c.ATTAINS_REPORT_IDX == aTTAINS_REPORT_IDX
select c).FirstOrDefault();
if (r.ATTAINS_SUBMIT_STATUS == "Y" || r.ATTAINS_SUBMIT_STATUS == "U")
return -1;
ctx.DeleteObject(r);
ctx.SaveChanges();
return 1;
}
catch
{
return 0;
}
}
}
示例14: InsertOrUpdateT_WQX_REF_DATA
//******************REF DATA****************************************
public static int InsertOrUpdateT_WQX_REF_DATA(global::System.String tABLE, global::System.String vALUE, global::System.String tEXT, global::System.Boolean? UsedInd)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
Boolean insInd = true;
T_WQX_REF_DATA a = new T_WQX_REF_DATA();
if (ctx.T_WQX_REF_DATA.Any(o => o.VALUE == vALUE && o.TABLE == tABLE))
{
//update case
a = (from c in ctx.T_WQX_REF_DATA
where c.VALUE == vALUE
&& c.TABLE == tABLE
select c).FirstOrDefault();
insInd = false;
}
a.TABLE = tABLE;
a.VALUE = vALUE;
a.TEXT = Utils.SubStringPlus(tEXT, 0,200);
if (UsedInd != null) a.USED_IND = UsedInd;
a.UPDATE_DT = System.DateTime.Now;
a.ACT_IND = true;
if (insInd) //insert case
{
if (UsedInd == null) a.USED_IND = true;
ctx.AddToT_WQX_REF_DATA(a);
}
ctx.SaveChanges();
return 1;
}
catch (Exception ex)
{
return 0;
}
}
}
示例15: InsertOrUpdateT_WQX_REF_ANAL_METHOD
public static int InsertOrUpdateT_WQX_REF_ANAL_METHOD(global::System.Int32? aNALYTIC_METHOD_IDX, global::System.String aNALYTIC_METHOD_ID, string aNALYTIC_METHOD_CTX,
string aNALYTIC_METHOD_NAME, string aNALYTIC_METHOD_DESC, bool aCT_IND)
{
using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
{
try
{
Boolean insInd = true;
T_WQX_REF_ANAL_METHOD a = new T_WQX_REF_ANAL_METHOD();
if (ctx.T_WQX_REF_ANAL_METHOD.Any(o => o.ANALYTIC_METHOD_IDX == aNALYTIC_METHOD_IDX))
{
//update case
a = (from c in ctx.T_WQX_REF_ANAL_METHOD
where c.ANALYTIC_METHOD_IDX == aNALYTIC_METHOD_IDX
select c).FirstOrDefault();
insInd = false;
}
else
{
if (ctx.T_WQX_REF_ANAL_METHOD.Any(o => o.ANALYTIC_METHOD_ID == aNALYTIC_METHOD_ID && o.ANALYTIC_METHOD_CTX == aNALYTIC_METHOD_CTX))
{
//update case
a = (from c in ctx.T_WQX_REF_ANAL_METHOD
where c.ANALYTIC_METHOD_ID == aNALYTIC_METHOD_ID
&& c.ANALYTIC_METHOD_CTX == aNALYTIC_METHOD_CTX
select c).FirstOrDefault();
insInd = false;
}
}
if (aNALYTIC_METHOD_ID != null) a.ANALYTIC_METHOD_ID = aNALYTIC_METHOD_ID;
if (aNALYTIC_METHOD_CTX != null) a.ANALYTIC_METHOD_CTX = aNALYTIC_METHOD_CTX;
if (aNALYTIC_METHOD_NAME != null) a.ANALYTIC_METHOD_NAME = aNALYTIC_METHOD_NAME;
if (aNALYTIC_METHOD_DESC != null) a.ANALYTIC_METHOD_DESC = aNALYTIC_METHOD_DESC;
if (aCT_IND != null) a.ACT_IND = aCT_IND;
a.UPDATE_DT = System.DateTime.Now;
if (insInd) //insert case
ctx.AddToT_WQX_REF_ANAL_METHOD(a);
ctx.SaveChanges();
return a.ANALYTIC_METHOD_IDX;
}
catch (Exception ex)
{
return 0;
}
}
}