Esempio n. 1
0
        public static Wish GetWishByPublishId(Guid id)
        {
            Wish wish = null;
            WishDBDataContext dataContext = new WishDBDataContext();

            wish = (from dbWish in dataContext.Wishes
                    where dbWish.PublicId.Equals(id)
                    select dbWish).FirstOrDefault();

            return(wish);
        }
Esempio n. 2
0
        public Order CreateForWish(Guid wishId)
        {
            Order newOrder = null;
            Wish  wish     = WishAccess.GetWishByPublishId(wishId);

            try
            {
                newOrder = new Order {
                    Status = "InProgress", WishId = wish.Id, PublicId = Guid.NewGuid().ToString()
                };
                dataContext.Orders.InsertOnSubmit(newOrder);
                dataContext.SubmitChanges();
            }
            catch { }

            return(newOrder);
        }
Esempio n. 3
0
 public Wish InsertWish(string name, string code, float cost, string currency, string imageUrl)
 {
     Wish wish = null;
     try
     {
         wish = new Wish
         {
             Name = name,
             Code = code,
             Cost = cost,
             Currency = currency,
             ImageURL = imageUrl,
             UserId = userId,
             IsCompleted = false,
             PublicId = Guid.NewGuid().ToString()
         };
         dataContext.Wishes.InsertOnSubmit(wish);
         dataContext.SubmitChanges();
     }
     catch  {}
     return wish;
 }
Esempio n. 4
0
        public Wish InsertWish(string name, string code, float cost, string currency, string imageUrl)
        {
            Wish wish = null;

            try
            {
                wish = new Wish
                {
                    Name        = name,
                    Code        = code,
                    Cost        = cost,
                    Currency    = currency,
                    ImageURL    = imageUrl,
                    UserId      = userId,
                    IsCompleted = false,
                    PublicId    = Guid.NewGuid().ToString()
                };
                dataContext.Wishes.InsertOnSubmit(wish);
                dataContext.SubmitChanges();
            }
            catch  {}
            return(wish);
        }
 partial void DeleteWish(Wish instance);
 partial void UpdateWish(Wish instance);
 partial void InsertWish(Wish instance);
Esempio n. 8
0
 partial void DeleteWish(Wish instance);
Esempio n. 9
0
 partial void UpdateWish(Wish instance);
Esempio n. 10
0
 partial void InsertWish(Wish instance);