예제 #1
0
        public bool Add()
        {
            if (this.Valid())
            {
                this.Id = General.UniqueString(this.Id);

                using (WMContext context = new WMContext())
                {
                    OrderGoods model = new OrderGoods {
                        Id      = this.Id,
                        OrderId = this.OrderId,
                        GoodId  = this.GoodId,
                        Price   = this.Price,
                        Count   = this.Count
                    };

                    context.OrderGoods.Add(model);
                    context.SaveChanges();
                }

                return(true);
            }

            return(false);
        }
예제 #2
0
        public bool Add()
        {
            if (this.Valid())
            {
                this.Id = General.UniqueString(this.Id);

                using (WMContext context = new WMContext())
                {
                    OrderGoods model = new OrderGoods {
                        Id = this.Id,
                        OrderId = this.OrderId,
                        GoodId = this.GoodId,
                        Price = this.Price,
                        Count = this.Count
                    };

                    context.OrderGoods.Add(model);
                    context.SaveChanges();
                }

                return true;
            }

            return false;
        }