Example #1
0
        public bool SetStatusByOrderId(Guid id, string status)
        {
            bool isSuccess = false;

            string orderId = id.ToString();
            var    order   = (from dbOrder in dataContext.Orders
                              where dbOrder.PublicId.Equals(orderId)
                              select dbOrder).FirstOrDefault();

            if (order != null)
            {
                try
                {
                    order.Status = status;
                    dataContext.SubmitChanges();
                    isSuccess = true;
                }
                catch { }
            }
            return(isSuccess);
        }
Example #2
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);
        }