public Pricing Edit(Pricing pricing) { pricing.ModifiedOn = DateTime.Now; Pricing dbPricing = Single(pricing.ID); // get the database columns which need to be updated var databaseMembers = db.Mapping.MappingSource.GetModel(typeof(BizzyQuoteDataContext)).GetMetaType(typeof(Pricing)).DataMembers .Where(d => d.IsAssociation == false && d.IsDbGenerated == false && d.IsPersistent == true); // reflect to get instances of the entity preoprties var editProperties = from p in dbPricing.GetType().GetProperties() join m in databaseMembers on p.Name equals m.Name select p; // copy the values PropertyInfo[] editProps = editProperties.ToArray(); foreach (PropertyInfo propertyInfo in editProps) { propertyInfo.SetValue(dbPricing, propertyInfo.GetValue(pricing, null), null); } db.SubmitChanges(); return dbPricing; }
public Pricing Create(Pricing pricing) { pricing.CreatedOn = DateTime.Now; pricing.ModifiedOn = DateTime.Now; db.Pricings.InsertOnSubmit(pricing); db.SubmitChanges(); return pricing; }
partial void DeletePricing(Pricing instance);
partial void UpdatePricing(Pricing instance);
partial void InsertPricing(Pricing instance);
private void detach_Pricings(Pricing entity) { this.SendPropertyChanging(); entity.Supplier = null; }
private void attach_Pricings(Pricing entity) { this.SendPropertyChanging(); entity.Supplier = this; }
private void detach_Pricings(Pricing entity) { this.SendPropertyChanging(); entity.Material = null; }
private void attach_Pricings(Pricing entity) { this.SendPropertyChanging(); entity.Material = this; }
private void detach_Pricings(Pricing entity) { this.SendPropertyChanging(); entity.Company = null; }
private void attach_Pricings(Pricing entity) { this.SendPropertyChanging(); entity.Company = this; }