public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Origin?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Destination?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DaysOfWeek?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerPallet?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerKilogram?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerCubicMeter?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityKG?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EffectiveFrom?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EffectiveTo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TypeOfGoods?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Revision?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (GUID?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ReservedCapacityLaden?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (State?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (BaseId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Frequency?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityM3?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityLaden?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ReservedCapacityKG?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ReservedCapacityM3?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FixedPrice?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OriginComments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DestinationComments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TruckPlate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (stringenum?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DeliveryDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Attribute?.GetHashCode() ?? 0);
            return(hashCode);
        }
Beispiel #2
0
 public Product(string name,TypeOfGoods _t, float _vol)
 {
     ID++;
     this.name = name;
     this.type = _t;
     if (_vol>0) this.volume = _vol;
 }
Beispiel #3
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Origin?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Destination?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DaysOfWeek?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerPallet?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerKilogram?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PricePerCubicMeter?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityKG?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EffectiveFrom?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EffectiveTo?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TypeOfGoods?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AvailableCapacityLaden?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CreatedOn?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Frequency?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (IsPrivate.GetHashCode());
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityLaden?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalAvailableCapacityM3?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AvailableCapacityKG?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AvailableCapacityM3?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FixedPrice?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TruckPlate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DeliveryDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ByRA.GetHashCode());
            return(hashCode);
        }
Beispiel #4
0
 public Product(string name, TypeOfGoods _t, float _vol)
 {
     ID++;
     this.name = name;
     this.type = _t;
     if (_vol > 0)
     {
         this.volume = _vol;
     }
 }
Beispiel #5
0
        public IHttpActionResult Get(int id)
        {
            var type = services.Get(id);

            if (type != null)
            {
                TypeOfGoods _type = mapper.Map <TypeOfGoods> (type);
                return(Ok(_type));
            }

            return(NotFound());
        }
Beispiel #6
0
 public void AddTypeGoodsClick(object obj)
 {
     if (Company != string.Empty)
     {
         using (var db = new MeiMeiContext())
         {
             var typeGoods = new TypeOfGoods
             {
                 TypeGoods = Company
             };
             db.TypeOfGoods.Add(typeGoods);
             db.SaveChanges();
         }
         OnPropertyChanged("TypeOfGoodsCollection");
     }
     else
     {
         MessageBox.Show(Properties.Resources.FirstFill_message);
     }
 }
Beispiel #7
0
        protected override void Seed(ShopContext context)
        {
            TypeOfGoods type1 = new TypeOfGoods()
            {
                Name           = "Programming tools",
                NeedPermission = false,
                AgeLimit       = 12,
            };
            Goods goods1 = new Goods()
            {
                Name         = "Scratch",
                Description  = "blablablablabla this is Scratch",
                Price        = 100.0,
                ListOfOrders = new List <ShopOrder>(),
                Type         = type1,
            };

            TypeOfGoods type2 = new TypeOfGoods()
            {
                Name           = "Weapon",
                NeedPermission = false,
                AgeLimit       = 12,
            };
            Goods goods2 = new Goods()
            {
                Name         = "Glock",
                Description  = "Weapons manufacturer headquartered in Deutsch-Wagram, Austria, named after its founder, Gaston Glock",
                Price        = 1200.50,
                ListOfOrders = new List <ShopOrder>(),
                Type         = type2,
            };

            ShopOrder orders1 = new ShopOrder()
            {
                DeliveryState = ShopOrderDeliveryState.In_Delivery,
                PaymentState  = ShopOrderPaymentState.Not_paid,
                Price         = 12300,
                Time          = DateTime.Now,
                ListOfGoods   = new List <Goods>(),
            };

            ShopOrder orders2 = new ShopOrder()
            {
                DeliveryState = ShopOrderDeliveryState.Awaiting_delivery,
                PaymentState  = ShopOrderPaymentState.Paid,
                Price         = 300,
                Time          = DateTime.Now,
                ListOfGoods   = new List <Goods>(),
            };

            orders1.ListOfGoods.Add(goods1);
            orders1.ListOfGoods.Add(goods2);
            orders2.ListOfGoods.Add(goods1);

            goods1.ListOfOrders.Add(orders1);
            goods1.ListOfOrders.Add(orders2);
            goods2.ListOfOrders.Add(orders1);

            context.Goods.Add(goods1);
            context.Goods.Add(goods2);
            context.ShopOrders.Add(orders1);
            context.ShopOrders.Add(orders2);
            context.TypeOfGoods.Add(type1);
            context.TypeOfGoods.Add(type2);

            context.SaveChanges();
        }