コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the
 /// ActionModelReservationActionNotAllowedReservationActionReason
 /// class.
 /// </summary>
 /// <param name="action">Possible values include: 'CheckIn',
 /// 'CheckOut', 'Cancel', 'Amend', 'AmendTimeSlices', 'AmendArrival',
 /// 'AmendDeparture', 'NoShow', 'AssignUnit', 'UnassignUnit'</param>
 public ActionModelReservationActionNotAllowedReservationActionReason(ReservationAction action, bool isAllowed, IList <ActionReasonModelNotAllowedReservationActionReason> reasons = default(IList <ActionReasonModelNotAllowedReservationActionReason>))
 {
     Action    = action;
     IsAllowed = isAllowed;
     Reasons   = reasons;
     CustomInit();
 }
コード例 #2
0
 public ActionResult HistoryReservation()
 {
     if ((string)Session["role"] == "Manager")
     {
         ViewBag.Reservation = ReservationAction.All_Reservation();
         return(View());
     }
     return(Redirect("~/Home/HomePage"));
 }
コード例 #3
0
 public ActionResult List_Reservation()
 {
     if (Session["id"] != null)
     {
         ViewBag.Table = ReservationAction.Get_All_Reservation();
         ReservationAction.Auto_Cancel();
         return(View());
     }
     return(Redirect("~/Home/HomePage"));
 }
コード例 #4
0
        public ActionResult Book_Table(int ID_Table)
        {
            ReservationAction.Auto_Cancel();
            string phone = (string)Session["member_id"];

            if (MemberShipAction.Find_MemberShip_By_Phone(phone).score >= 10)
            {
                ReservationAction.Create_Reservation(phone, ID_Table);
                TableAction.Delete_Table(ID_Table);
                return(Redirect("~/Home/HomePage"));
            }


            return(View());
        }
コード例 #5
0
 public ActionResult MemberInformation()
 {
     if (Session["name"] != null)
     {
         var id = (string)Session["member_id"];
         ViewBag.Customer    = MemberShipAction.Find_MemberShip_By_Phone(id);
         ViewBag.Reservation = ReservationAction.Get_Reservation_By_Phone(id);
         ViewBag.History     = ReservationAction.Get_History_Reservation(id);
         return(View());
     }
     else
     {
         return(Redirect("~/Home/HomePage"));
     }
 }
コード例 #6
0
 public ActionResult Cancel_By_Customer(int ID_Reservation)
 {
     ReservationAction.Auto_Cancel();
     using (var db = new DBConnection())
     {
         var reservation = db.DbReservation.Find(ID_Reservation);
         if (reservation.cancel == false && reservation.checkin == false)
         {
             ReservationAction.Cancel_Reservation((string)Session["member_id"], ID_Reservation);
         }
         else
         {
             if (reservation.seats == 5)
             {
                 MemberShipAction.Decreate_Score((string)Session["member_id"], 10);
             }
             if (reservation.seats == 10)
             {
                 MemberShipAction.Decreate_Score((string)Session["member_id"], 15);
             }
         }
         return(Redirect("~/Account/MemberInformation"));
     }
 }
コード例 #7
0
        internal static string ToSerializedValue(this ReservationAction value)
        {
            switch (value)
            {
            case ReservationAction.CheckIn:
                return("CheckIn");

            case ReservationAction.CheckOut:
                return("CheckOut");

            case ReservationAction.Cancel:
                return("Cancel");

            case ReservationAction.Amend:
                return("Amend");

            case ReservationAction.AmendTimeSlices:
                return("AmendTimeSlices");

            case ReservationAction.AmendArrival:
                return("AmendArrival");

            case ReservationAction.AmendDeparture:
                return("AmendDeparture");

            case ReservationAction.NoShow:
                return("NoShow");

            case ReservationAction.AssignUnit:
                return("AssignUnit");

            case ReservationAction.UnassignUnit:
                return("UnassignUnit");
            }
            return(null);
        }
コード例 #8
0
 public ActionResult Checkin_Table(string Customer_Phone, int ID)
 {
     ReservationAction.Checkin_Reservation(Customer_Phone, ID);
     ReservationAction.Auto_Cancel();
     return(Redirect("~/MemberShip/List_Reservation"));
 }
コード例 #9
0
 public async Task <bool> Post([FromBody] ReservationRequest value)
 {
     return(await ReservationAction.Reserve(value));
 }