Exemplo n.º 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;
        }
Exemplo n.º 2
0
        public Pricing Create(Pricing pricing)
        {
            pricing.CreatedOn = DateTime.Now;
            pricing.ModifiedOn = DateTime.Now;

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