本文整理汇总了C#中SIOTSDB_HHZXDataContext.SubmitChanges方法的典型用法代码示例。如果您正苦于以下问题:C# SIOTSDB_HHZXDataContext.SubmitChanges方法的具体用法?C# SIOTSDB_HHZXDataContext.SubmitChanges怎么用?C# SIOTSDB_HHZXDataContext.SubmitChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIOTSDB_HHZXDataContext
的用法示例。
在下文中一共展示了SIOTSDB_HHZXDataContext.SubmitChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteRecord
public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
{
Sys_FunctionMaster_fum_Info info = null;
try
{
info = KeyObject as Sys_FunctionMaster_fum_Info;
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
Sys_FunctionMaster_fum fum = db.Sys_FunctionMaster_fum.Single<Sys_FunctionMaster_fum>(i => i.fum_iRecordID == info.fum_iRecordID);
//for (int i = 0; i < fum.Sys_FormPurview_frps.Count; i++)
//{
// Sys_FormPurview_frp sta = fum.Sys_FormPurview_frps[i];
// db.Sys_FormPurview_frps.DeleteOnSubmit(sta);
//}
db.Sys_FunctionMaster_fum.DeleteOnSubmit(fum);
db.SubmitChanges();
return true;
}
}
catch (Exception Ex)
{
throw Ex;
}
}
示例2: DeleteRecord
public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
{
ReturnValueInfo rvInfo = new ReturnValueInfo();
DepartmentMaster_dpm_Info searchInfo = KeyObject as DepartmentMaster_dpm_Info;
if (searchInfo == null)
{
rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
rvInfo.isError = true;
return rvInfo;
}
try
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
List<DepartmentMaster_dpm> listDept = db.DepartmentMaster_dpm.Where(x => x.dpm_RecordID == searchInfo.dpm_RecordID).ToList();
if (listDept != null)
{
db.DepartmentMaster_dpm.DeleteAllOnSubmit(listDept);
db.SubmitChanges();
rvInfo.boolValue = true;
}
}
}
catch (Exception ex)
{
rvInfo.messageText = ex.Message;
rvInfo.isError = true;
}
return rvInfo;
}
示例3: DeleteRecord
public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
{
ReturnValueInfo returnInfo = new ReturnValueInfo(false);
PaymentUDMealState_pms_Info deleteInfo = KeyObject as PaymentUDMealState_pms_Info;
if (deleteInfo != null)
{
try
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
PaymentUDMealState_pms deleteData = db.PaymentUDMealState_pms.FirstOrDefault(t => t.pms_cRecordID == deleteInfo.pms_cRecordID);
if (deleteData != null)
{
db.PaymentUDMealState_pms.DeleteOnSubmit(deleteData);
db.SubmitChanges();
returnInfo.boolValue = true;
}
}
}
catch (Exception Ex)
{
returnInfo.messageText = Ex.Message;
}
}
return returnInfo;
}
示例4: DeleteRecord
public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
{
Sys_RoleMaster_rlm_Info info = null;
try
{
info = KeyObject as Sys_RoleMaster_rlm_Info;
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
Sys_RoleMaster_rlm rlm = db.Sys_RoleMaster_rlm.Single<Sys_RoleMaster_rlm>(i => i.rlm_iRecordID == info.rlm_iRecordID);
for (int i = 0; i < rlm.Sys_UserRoles_usr.Count; i++)
{
Sys_UserRoles_usr sta = rlm.Sys_UserRoles_usr[i];
db.Sys_UserRoles_usr.DeleteOnSubmit(sta);
}
db.Sys_RoleMaster_rlm.DeleteOnSubmit(rlm);
db.SubmitChanges();
return true;
}
}
catch (Exception Ex)
{
throw Ex;
}
}
示例5: BatchDeleteRecords
public ReturnValueInfo BatchDeleteRecords(PaymentUDGeneralSetting_pus_Info searchInfo)
{
ReturnValueInfo rvInfo = new ReturnValueInfo();
try
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
List<PaymentUDGeneralSetting_pus> searchData = db.PaymentUDGeneralSetting_pus.Where(x => 1 == 1).ToList();
PaymentUDGeneralSetting_pus_Info query = searchInfo as PaymentUDGeneralSetting_pus_Info;
if (query != null)
{
if (query.pus_cCardUserID != null)
{
searchData = searchData.Where(t => t.pus_cCardUserID == query.pus_cCardUserID).ToList();
}
if (query.pus_cClassID != null)
{
searchData = searchData.Where(t => t.pus_cClassID == query.pus_cClassID).ToList();
}
if (query.pus_cGradeID != null)
{
searchData = searchData.Where(t => t.pus_cGradeID == query.pus_cGradeID).ToList();
}
if (query.pus_iWeek != null && query.pus_iWeek != -1)
{
searchData = searchData.Where(t => t.pus_iWeek == query.pus_iWeek).ToList();
}
}
else
{
rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
return rvInfo;
}
db.PaymentUDGeneralSetting_pus.DeleteAllOnSubmit(searchData);
db.SubmitChanges();
rvInfo.boolValue = true;
}
}
catch (Exception ex)
{
rvInfo.isError = true;
rvInfo.messageText = ex.Message;
}
return rvInfo;
}
示例6: SaveRecord
public bool SaveRecord(Sys_UserMaster_usm_Info infoObj)
{
try
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
LinqToSQLModel.Sys_UserMaster_usm newTab = Common.General.CopyObjectValue<Sys_UserMaster_usm_Info, LinqToSQLModel.Sys_UserMaster_usm>(infoObj);
db.Sys_UserMaster_usm.InsertOnSubmit(newTab);
db.SubmitChanges();
}
return true;
}
catch
{
throw;
}
}
示例7: DeleteRecord
public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
{
Sys_FormMaster_fom_Info info = null;
try
{
info = KeyObject as Sys_FormMaster_fom_Info;
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
Sys_FormMaster_fom frm = db.Sys_FormMaster_fom.Single<Sys_FormMaster_fom>(i => i.fom_iRecordID == info.fom_iRecordID);
for (int i = 0; i < frm.Sys_FormPurview_frp.Count; i++)
{
Sys_FormPurview_frp sta = frm.Sys_FormPurview_frp[i];
db.Sys_FormPurview_frp.DeleteOnSubmit(sta);
}
if (frm != null)
{
frm.fom_lVaild = false;
IEnumerable<Sys_FormMaster_fom> subMenu = from t in db.Sys_FormMaster_fom
where t.fom_iParentID == frm.fom_iRecordID
select t;
if (subMenu != null && subMenu.Count() > 0)
{
foreach (Sys_FormMaster_fom item in subMenu)
{
item.fom_lVaild = false;
}
}
}
//db.Sys_FormMaster_fom.DeleteOnSubmit(frm);
db.SubmitChanges();
return true;
}
}
catch (Exception Ex)
{
throw Ex;
}
}
示例8: DeleteRecord
public bool DeleteRecord(int id)
{
try
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
var ret_usm = from usm in db.Sys_UserMaster_usm where usm.usm_iRecordID == id select usm;
if (ret_usm.Count() > 0)
{
db.Sys_UserMaster_usm.DeleteAllOnSubmit(ret_usm);
db.SubmitChanges();
}
}
return true;
}
catch
{
throw;
}
}
示例9: DeleteRecord
public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
{
ReturnValueInfo rvInfo = new ReturnValueInfo();
try
{
MealBookingHistory_mbh_Info infoObject = KeyObject as MealBookingHistory_mbh_Info;
if (infoObject != null)
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
MealBookingHistory_mbh history = db.MealBookingHistory_mbh.Where(x => x.mbh_cRecordID == infoObject.mbh_cRecordID).FirstOrDefault();
if (history != null)
{
db.MealBookingHistory_mbh.DeleteOnSubmit(history);
db.SubmitChanges();
rvInfo.boolValue = true;
rvInfo.ValueObject = infoObject;
}
else
{
rvInfo.messageText = "GetEntity is null";
}
}
}
else
{
rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
}
}
catch (Exception ex)
{
rvInfo.isError = true;
rvInfo.messageText = ex.Message;
}
return rvInfo;
}
示例10: DeleteRecord
public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
{
ReturnValueInfo rvInfo = new ReturnValueInfo();
try
{
UserCardPair_ucp_Info infoObject = KeyObject as UserCardPair_ucp_Info;
if (infoObject != null)
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
UserCardPair_ucp pair = db.UserCardPair_ucp.Where(x => x.ucp_cRecordID == infoObject.ucp_cRecordID).FirstOrDefault();
if (pair != null)
{
pair.ucp_lIsActive = false;
db.SubmitChanges();
rvInfo.boolValue = true;
rvInfo.ValueObject = infoObject;
}
else
{
rvInfo.messageText = "GetEntity is null";
}
}
}
else
{
rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
}
}
catch (Exception ex)
{
rvInfo.isError = true;
rvInfo.messageText = ex.Message;
}
return rvInfo;
}
示例11: DeleteRecord
public ReturnValueInfo DeleteRecord(IModelObject KeyObject)
{
ReturnValueInfo rvInfo = new ReturnValueInfo();
try
{
CardUserAccountDetail_cuad_Info infoObject = KeyObject as CardUserAccountDetail_cuad_Info;
if (infoObject != null)
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
CardUserAccountDetail_cuad record = db.CardUserAccountDetail_cuad.Where(x => x.cuad_cRecordID == infoObject.cuad_cRecordID).FirstOrDefault();
if (record != null)
{
db.CardUserAccountDetail_cuad.DeleteOnSubmit(record);
db.SubmitChanges();
rvInfo.boolValue = true;
rvInfo.ValueObject = infoObject;
}
else
{
rvInfo.messageText = "GetEntity is null";
}
}
}
else
{
rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
}
}
catch (Exception ex)
{
rvInfo.isError = true;
rvInfo.messageText = ex.Message;
}
return rvInfo;
}
示例12: DeleteRecord
public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
{
bool isSuccess = false;
CodeMaster_cmt_Info info = new CodeMaster_cmt_Info();
info = KeyObject as CodeMaster_cmt_Info;
try
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
CodeMaster_cmt delTab = db.CodeMaster_cmt.SingleOrDefault(t => t.cmt_iRecordID == info.cmt_iRecordID);
if (delTab != null)
{
db.CodeMaster_cmt.DeleteOnSubmit(delTab);
db.SubmitChanges();
isSuccess = true;
}
}
}
catch (Exception Ex)
{
throw Ex;
}
return isSuccess;
}
示例13: UpdateRecord
public ReturnValueInfo UpdateRecord(CardUserAccount_cua_Info infoObject)
{
ReturnValueInfo rvInfo = new ReturnValueInfo();
try
{
if (infoObject != null)
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
CardUserAccount_cua record = db.CardUserAccount_cua.Where(x => x.cua_cRecordID == infoObject.cua_cRecordID).FirstOrDefault();
if (record != null)
{
record.cua_cCUSID = infoObject.cua_cCUSID;
record.cua_dLastSyncTime = infoObject.cua_dLastSyncTime;
record.cua_fCurrentBalance = infoObject.cua_fCurrentBalance;
record.cua_fOriginalBalance = infoObject.cua_fOriginalBalance;
record.cua_lIsActive = infoObject.cua_lIsActive;
record.cua_cAdd = infoObject.cua_cAdd;
record.cua_dAddDate = infoObject.cua_dAddDate;
db.SubmitChanges();
rvInfo.boolValue = true;
}
else
{
rvInfo.messageText = "GetEntity is null";
}
}
}
else
{
rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
}
}
catch (Exception ex)
{
rvInfo.isError = true;
rvInfo.messageText = ex.Message;
}
return rvInfo;
}
示例14: InsertRecord
public ReturnValueInfo InsertRecord(CardUserAccountDetail_cuad_Info infoObject)
{
ReturnValueInfo rvInfo = new ReturnValueInfo();
try
{
if (infoObject != null)
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
CardUserAccountDetail_cuad record = Common.General.CopyObjectValue<CardUserAccountDetail_cuad_Info, CardUserAccountDetail_cuad>(infoObject);
if (record != null)
{
db.CardUserAccountDetail_cuad.InsertOnSubmit(record);
db.SubmitChanges();
rvInfo.boolValue = true;
rvInfo.ValueObject = infoObject;
}
else
{
rvInfo.messageText = "TransEntity is null";
}
}
}
else
{
rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
}
}
catch (Exception ex)
{
rvInfo.isError = true;
rvInfo.messageText = ex.Message;
}
return rvInfo;
}
示例15: UpdateRecord
public ReturnValueInfo UpdateRecord(CardUserAccountDetail_cuad_Info infoObject)
{
ReturnValueInfo rvInfo = new ReturnValueInfo();
try
{
if (infoObject != null)
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
CardUserAccountDetail_cuad record = db.CardUserAccountDetail_cuad.Where(x => x.cuad_cRecordID == infoObject.cuad_cRecordID).FirstOrDefault();
if (record != null)
{
record.cuad_cCUAID = infoObject.cuad_cCUAID;
record.cuad_fFlowMoney = infoObject.cuad_fFlowMoney;
record.cuad_cFlowType = infoObject.cuad_cFlowType;
if (infoObject.cuad_cConsumeID != null)
{
record.cuad_cConsumeID = infoObject.cuad_cConsumeID.Value;
}
record.cuad_cOpt = infoObject.cuad_cOpt;
record.cuad_dOptTime = infoObject.cuad_dOptTime;
db.SubmitChanges();
rvInfo.boolValue = true;
}
else
{
rvInfo.messageText = "GetEntity is null";
}
}
}
else
{
rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
}
}
catch (Exception ex)
{
rvInfo.isError = true;
rvInfo.messageText = ex.Message;
}
return rvInfo;
}