本文整理汇总了C#中DAL.SubmitChanges方法的典型用法代码示例。如果您正苦于以下问题:C# DAL.SubmitChanges方法的具体用法?C# DAL.SubmitChanges怎么用?C# DAL.SubmitChanges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAL
的用法示例。
在下文中一共展示了DAL.SubmitChanges方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
internal static void Delete(DAL.CustomersDataContext dc, ItemPricing itemPricing)
{
DAL.ItemPricing dalItemPricing = findRecord(dc, itemPricing.Id);
dalItemPricing.Deleted = true;
dc.SubmitChanges();
}
示例2: SaveDependent
internal void SaveDependent(DAL.CustomersDataContext dc, DAL.Item dalItem)
{
DAL.ItemPricing dalItemPricing = null;
if (this.Id == 0)
{
dalItemPricing = new DAL.ItemPricing();
map(this, dalItemPricing);
dalItemPricing.Item = dalItem;
this.ItemId = dalItem.Id;
dc.ItemPricings.InsertOnSubmit(dalItemPricing);
}
else
{
dalItemPricing = findRecord(dc, this.Id);
map(this, dalItemPricing);
}
dc.SubmitChanges();
this.Id = dalItemPricing.Id;
}
示例3: SaveDependent
internal void SaveDependent(DAL.CustomersDataContext dc, DAL.Customer c)
{
DAL.Login dalLogin = null;
if (this.Id == 0)
{
dalLogin = new CustomerManagement.DAL.Login();
map(this, dalLogin);
dalLogin.Customer = c;
this.CustomerId = c.Id; // handles the case where the whole graph is saved with one Save() call
dc.Logins.InsertOnSubmit(dalLogin);
}
else
{
dalLogin = dc.Logins.Where(record => record.Id == this.Id).Single();
map(this, dalLogin);
}
dc.SubmitChanges();
this.Id = dalLogin.Id;
}
示例4: Delete
internal static void Delete(DAL.CustomersDataContext dc, Login item)
{
DAL.Login dalLogin = dc.Logins.Where(l => l.Id == item.Id).Where(l => !l.Deleted).Single();
dalLogin.Deleted = true;
dc.SubmitChanges();
}
示例5: Delete
internal static void Delete(DAL.CustomersDataContext dc, Phone item)
{
DAL.Phone dalPhone = dc.Phones.Where(p => p.Id == item.Id).Where(p => !p.Deleted).Single();
dalPhone.Deleted = true;
dc.SubmitChanges();
}
示例6: SaveDependent
internal void SaveDependent(DAL.CustomersDataContext dc, DAL.Customer c, int actionPerformerId)
{
DAL.Address dalAddress = null;
if (this.Id == 0)
{
dalAddress = new CustomerManagement.DAL.Address();
map(dc, this, dalAddress, actionPerformerId);
dalAddress.Customer = c;
this.CustomerId = c.Id; // handles the case where the whole graph is saved with one Save() call
dc.Addresses.InsertOnSubmit(dalAddress);
}
else
{
dalAddress = dc.Addresses.Where(record => record.Id == this.Id).Single();
map(dc, this, dalAddress, actionPerformerId);
}
dc.SubmitChanges();
this.Id = dalAddress.Id;
}
示例7: Delete
internal static void Delete(DAL.CustomersDataContext dc, Address item)
{
DAL.Address dalAddress = dc.Addresses.Where(a => a.Id == item.Id).Where(a => !a.Deleted).Single();
dalAddress.Deleted = true;
dc.SubmitChanges();
}
示例8: SaveDependent
internal void SaveDependent(DAL.CustomersDataContext dc)
{
DAL.PaymentType dalPaymentType = null;
if (this.Id == 0)
{
dalPaymentType = new DAL.PaymentType();
map(dc, this, dalPaymentType);
dc.PaymentTypes.InsertOnSubmit(dalPaymentType);
}
else
{
dalPaymentType = findRecord(dc, this.Id);
map(dc, this, dalPaymentType);
}
dc.SubmitChanges();
this.Id = dalPaymentType.Id;
}
示例9: Delete
internal static void Delete(DAL.CustomersDataContext dc, PaymentTransaction item)
{
DAL.PaymentTransaction dalPaymentTransaction = findRecord(dc, item.Id);
dalPaymentTransaction.Deleted = true;
dc.SubmitChanges();
PaymentType.Delete(dc, item.PaymentType);
PaymentStatusCode.Delete(dc, item.PaymentStatusCode);
}