Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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;
 }
Exemplo 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);
        }
Exemplo n.º 5
0
 partial void DeleteWish(Wish instance);
Exemplo n.º 6
0
 partial void UpdateWish(Wish instance);
Exemplo n.º 7
0
 partial void InsertWish(Wish instance);
Exemplo n.º 8
0
 partial void DeleteWish(Wish instance);
Exemplo n.º 9
0
 partial void UpdateWish(Wish instance);
Exemplo n.º 10
0
 partial void InsertWish(Wish instance);