Esempio n. 1
0
        public IHttpActionResult Put(WaitingParty party)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Not a valid model"));
            }

            using (var ctx = new WaitingPartyModel())
            {
                var existingParty = ctx.WaitingParties.Where(s => s.PartyId == party.PartyId)
                                    .FirstOrDefault <WaitingParty>();

                if (existingParty != null)
                {
                    existingParty.PriorityLvl = party.PriorityLvl;
                    ctx.SaveChanges();
                }
                else
                {
                    return(NotFound());
                }
            }

            return(Ok());
        }
Esempio n. 2
0
        private void AssignPartyAsRequeued(GatewayInternalService.GatewayInternalServiceClient gatewayClient,
                                           WaitingParty party)
        {
            var assignRequest = new AssignDeploymentsRequest();

            assignRequest.Assignments.Add(new Assignment
            {
                Result = Assignment.Types.Result.Requeued,
                Party  = party.Party
            });
            gatewayClient.AssignDeployments(assignRequest);
        }
        public void CheckForWaitingParty()
        {
            List <WaitingParty> list = library.GetWaitingParties();

            if (list == null)
            {
                return;
            }

            WaitingParty party = null;

            foreach (WaitingParty wp in list)
            {
                if (wp.MobileUserId == mUserId)
                {
                    party = wp;
                }
            }
            if (party != null)
            {
                Restaurant restaurant = library.GetRestaurant(party.RestaurantID);
                if (restaurant != null)
                {
                    mSelection.Visibility    = ViewStates.Visible;
                    mLocationName.Visibility = ViewStates.Visible;
                    mInfo.Visibility         = ViewStates.Visible;
                    mLocationName.Text       = restaurant.Name;
                    mInfo.Text        = restaurant.Address;
                    mSelection.Click += delegate
                    {
                        mBuilder = new Android.Support.V7.App.AlertDialog.Builder(this);
                        mBuilder.SetTitle("Get InLine");
                        LayoutInflater      inflater = this.LayoutInflater;
                        CheckInCheckOutItem item     = new CheckInCheckOutItem(mContext, mBuilder.Context, null);
                        item.ID      = party.PartyId;
                        item.Address = restaurant.Address;
                        mBuilder.SetView(item);
                        mBuilder.SetCancelable(true);
                        mBuilder.SetNegativeButton("Exit", (s, e) => { mAlertDialog.Dismiss(); });

                        mAlertDialog = mBuilder.Create();
                        mAlertDialog.Show();
                    };
                }
            }
            DateTime date   = DateTime.Now;
            string   format = "ddd, dd MMM";

            txtDate.Text = date.ToString(format);
        }
Esempio n. 4
0
 public IHttpActionResult Post(WaitingParty party)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest("Invalid data."));
     }
     using (var ctx = new WaitingPartyModel())
     {
         ctx.WaitingParties.Add(new WaitingParty()
         {
             PartyId      = party.PartyId,
             RestaurantID = party.RestaurantID,
             NoOfGuests   = party.NoOfGuests,
             AddTime      = party.AddTime,
             PriorityLvl  = party.PriorityLvl,
             FullName     = party.FullName,
             MobileUserId = party.MobileUserId
         });
         ctx.SaveChanges();
     }
     return(Ok());
 }