Пример #1
0
        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;
        }
Пример #2
0
        public Pricing Create(Pricing pricing)
        {
            pricing.CreatedOn = DateTime.Now;
            pricing.ModifiedOn = DateTime.Now;

            db.Pricings.InsertOnSubmit(pricing);
            db.SubmitChanges();
            return pricing;
        }
Пример #3
0
 partial void DeletePricing(Pricing instance);
Пример #4
0
 partial void UpdatePricing(Pricing instance);
Пример #5
0
 partial void InsertPricing(Pricing instance);
Пример #6
0
		private void detach_Pricings(Pricing entity)
		{
			this.SendPropertyChanging();
			entity.Supplier = null;
		}
Пример #7
0
		private void attach_Pricings(Pricing entity)
		{
			this.SendPropertyChanging();
			entity.Supplier = this;
		}
Пример #8
0
		private void detach_Pricings(Pricing entity)
		{
			this.SendPropertyChanging();
			entity.Material = null;
		}
Пример #9
0
		private void attach_Pricings(Pricing entity)
		{
			this.SendPropertyChanging();
			entity.Material = this;
		}
Пример #10
0
		private void detach_Pricings(Pricing entity)
		{
			this.SendPropertyChanging();
			entity.Company = null;
		}
Пример #11
0
		private void attach_Pricings(Pricing entity)
		{
			this.SendPropertyChanging();
			entity.Company = this;
		}