本文整理汇总了C#中DAL.SycousCon.SaveChanges方法的典型用法代码示例。如果您正苦于以下问题:C# SycousCon.SaveChanges方法的具体用法?C# SycousCon.SaveChanges怎么用?C# SycousCon.SaveChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAL.SycousCon
的用法示例。
在下文中一共展示了SycousCon.SaveChanges方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateUnOccupiedProperty
public static Boolean CreateUnOccupiedProperty(UnOccupiedProperty UnOccupied)
{
Boolean flag = false;
if (!(IsExistingUnOccupiedProperty(UnOccupied)))
{
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
context.UnOccupiedProperties.AddObject(UnOccupied);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}//
}// using
}//if
return flag;
}
示例2: CreateDataLoggerMapping
public static Boolean CreateDataLoggerMapping(SiteInLogger logger)
{
Boolean flag = false;
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
context.SiteInLoggers.AddObject(logger);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}//
}// using
return flag;
}
示例3: CreatePeerConsumerAverages
public static Boolean CreatePeerConsumerAverages(PeerNConsumerAverage Peer)
{
Boolean flag = false;
if (!(IsExistingPeerNConsumerAverage(Peer)))
{
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
context.PeerNConsumerAverages.AddObject(Peer);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}//
}// using
}//if
return flag;
}
示例4: UpdateExistResetPassword
public static bool UpdateExistResetPassword(ResetPwd Pwd)
{
Boolean flag = true;
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
var ResetToUpdate = context.ResetPwds.Where(c => c.UserID == Pwd.UserID && c.Active == false);
foreach (ResetPwd p in ResetToUpdate)
{
p.Active = true;
p.ModifyBy = Pwd.CreateBy;
p.ModifyDate = DateTime.Now;
}
context.SaveChanges();
context.AcceptAllChanges();
scope.Complete();
context.Dispose();
flag = true;
}
catch (Exception ex)
{
flag = false;
context.Dispose();
throw;
}
}
}
return flag;
}
示例5: CreateSiteCreditControl
public static Boolean CreateSiteCreditControl(SiteCreditControl site)
{
Boolean flag = false;
if (!(IsExistingSiteCreditControl(site)))
{
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
context.SiteCreditControls.AddObject(site);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}//
}// using
}//if
return flag;
}
示例6: DeletedDirectDebit
public static Boolean DeletedDirectDebit(DirectDebit debit)
{
using (TransactionScope scope = new TransactionScope())
{
Boolean bol = false;
using (var context = new SycousCon())
{
try
{
var Update = context.DirectDebits.Where(c => c.ID == debit.ID&& c.IsDeleted==0&&c.IsApproved==0);
foreach (DirectDebit p in Update)
{
p.IsDeleted = 2;
p.ModifyBy = debit.ModifyBy;
p.ModifyDate = DateTime.Now;
}//
context.SaveChanges();
context.AcceptAllChanges();
scope.Complete();
context.Dispose();
bol = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}// using
return bol;
} //trans
}
示例7: CreateDirectDebitTLetteremplate
public static Boolean CreateDirectDebitTLetteremplate(DirectDebitLetterTemplate directDebit)
{
Boolean flag = false;
if (!(IsExistingDirectDebitTemplate(directDebit)))
{
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
context.DirectDebitLetterTemplates.AddObject(directDebit);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}
}
}
return flag;
}
示例8: CreateDepartment
public static Boolean CreateDepartment(Department deptartment)
{
Boolean flag = false;
using (TransactionScope scope = new TransactionScope())
{
if (!(IsExistingDeptarmentCode(deptartment.DeptCode)))
{
using (var context = new SycousCon())
{
try
{
context.Departments.AddObject(deptartment);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}
}
}
return flag;
}
示例9: CreateResetPassword
public static Boolean CreateResetPassword(ResetPwd Pwd)
{
Boolean flag = false;
if (UpdateExistResetPassword(Pwd))
{
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
context.ResetPwds.AddObject(Pwd);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}
}
}
return flag;
}
示例10: CreatePropertyBandInTariff
public static Boolean CreatePropertyBandInTariff(PropertyBandInTariff tariff)
{
Boolean flag = false;
if ((IsExistingPropertyBandInTariff(tariff)))
{
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
context.PropertyBandInTariffs.AddObject(tariff);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}
}
}
return flag;
}
示例11: AddTariffProperty
public static Boolean AddTariffProperty(List<DAL.TariffInProperty> tariff)
{
Boolean flag = false;
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
foreach (DAL.TariffInProperty item in tariff)
{
context.TariffInProperties.AddObject(item);
}
context.SaveChanges();
context.AcceptAllChanges();
scope.Complete();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}// using
return flag;
}// trans
}
示例12: CreateTemperatureDifference
public static Boolean CreateTemperatureDifference(TemperatureDifference Temperature)
{
Boolean flag = false;
if (!(IsExistingTemperatureDifference(Temperature)))
{
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
context.TemperatureDifferences.AddObject(Temperature);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}//
}// using
}//if
return flag;
}
示例13: CreateEnergy
public static Boolean CreateEnergy(Energy energy)
{
Boolean flag = false;
if (!(IsExistingEnergy(energy)))
{
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
context.Energies.AddObject(energy);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}//
}// using
}//if
return flag;
}
示例14: CreateDirectDebit
public static Boolean CreateDirectDebit(DirectDebit mdirectdebit)
{
Boolean flag = false;
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
context.DirectDebits.AddObject(mdirectdebit);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}
}
return flag;
}
示例15: CreateUnit
public static Boolean CreateUnit(UnitMaster unit)
{
Boolean flag = false;
if (!(IsExistingUnit(unit)))
{
using (TransactionScope scope = new TransactionScope())
{
using (var context = new SycousCon())
{
try
{
context.UnitMasters.AddObject(unit);
context.SaveChanges();
scope.Complete();
context.AcceptAllChanges();
flag = true;
}
catch (Exception ex)
{
context.Dispose();
throw;
}
}
}
}
return flag;
}