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); }
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); }
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; }
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);