internal static void Delete(DAL.CustomersDataContext dc, ItemPricing itemPricing) { DAL.ItemPricing dalItemPricing = findRecord(dc, itemPricing.Id); dalItemPricing.Deleted = true; dc.SubmitChanges(); }
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; }
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; }
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(); }
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(); }
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; }
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(); }
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; }
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); }