Esempio n. 1
0
        /// <summary>
        /// Updates a request
        /// </summary>
        /// <param name="guestRequest"></param>
        public void Update_Guest_Request(GuestRequest guestRequest)
        {
            List <GuestRequest> list = Dal.Get_Guest_Request_List();

            var request = (from gr in list
                           where gr.ID == guestRequest.ID && (gr.Status == Guest_Request_Status.Closed_on_Website || gr.Status == Guest_Request_Status.Expired)
                           select gr).FirstOrDefault();


            if (request != null)
            {
                throw new CantUpdateException("The request is already closed!  From BL");
            }
            try
            {
                guestRequest.GuestRequestKey = list.Find(o => o.ID == guestRequest.ID).GuestRequestKey;
                Dal.Update_Guest_Request(guestRequest.Clone());
            }
            catch (RequestNotFoundException ex)
            {
                throw new RequestNotFoundException(ex.Message);
            }
            return;
        }