Beispiel #1
0
    public GetBookedRoomsByBranchResponse GetBookedRoomsByBranch(GetBookedRoomsByBranchRequest GetBookedRoomsByBranchRequest)
    {
        GetBookedRoomsByBranchRequest1 inValue = new GetBookedRoomsByBranchRequest1();

        inValue.GetBookedRoomsByBranchRequest = GetBookedRoomsByBranchRequest;
        GetBookedRoomsByBranchResponse1 retVal = ((DannCarltonService)(this)).GetBookedRoomsByBranch(inValue);

        return(retVal.GetBookedRoomsByBranchResponse);
    }
Beispiel #2
0
        GetBookedRoomsByBranchResponse IDannCarltonService.GetBookedRoomsByBranch(GetBookedRoomsByBranchRequest getBookedRoomsByBranchRequest)
        {
            GetBookedRoomsByBranchResponse getBookedRoomsByBranchResponse = new GetBookedRoomsByBranchResponse();

            getBookedRoomsByBranchResponse.Status = new Status();

            try
            {
                IDannCarltonServiceBusiness iDannCarlonSBusiness;

                iDannCarlonSBusiness           = new DannCarltonServiceBusiness();
                getBookedRoomsByBranchResponse = iDannCarlonSBusiness.BookedRoomsByBranchResponse(getBookedRoomsByBranchRequest);
            }
            catch (Exception ex)
            {
                getBookedRoomsByBranchResponse.Status.ErrorCode        = "01";
                getBookedRoomsByBranchResponse.Status.ErrorDescription = "Error en el Servicio";
                Common.CreateTrace.WriteLog(Common.CreateTrace.LogLevel.Error, "ERROR EN EL SERVICIO DannCarltonService: GetBookedRoomsByBranch" + ex.Message);
                throw ex;
            }

            return(getBookedRoomsByBranchResponse);
        }
Beispiel #3
0
 public GetBookedRoomsByBranchRequest1(GetBookedRoomsByBranchRequest GetBookedRoomsByBranchRequest)
 {
     this.GetBookedRoomsByBranchRequest = GetBookedRoomsByBranchRequest;
 }
Beispiel #4
0
    public System.Threading.Tasks.Task <GetBookedRoomsByBranchResponse1> GetBookedRoomsByBranchAsync(GetBookedRoomsByBranchRequest GetBookedRoomsByBranchRequest)
    {
        GetBookedRoomsByBranchRequest1 inValue = new GetBookedRoomsByBranchRequest1();

        inValue.GetBookedRoomsByBranchRequest = GetBookedRoomsByBranchRequest;
        return(((DannCarltonService)(this)).GetBookedRoomsByBranchAsync(inValue));
    }
Beispiel #5
0
        GetBookedRoomsByBranchResponse IDannCarltonServiceBusiness.BookedRoomsByBranchResponse(GetBookedRoomsByBranchRequest getBookedRoomsByBranchRequest)
        {
            GetBookedRoomsByBranchResponse getBookedRoomsByBranchResponse = new GetBookedRoomsByBranchResponse();

            getBookedRoomsByBranchResponse.Status = new Status();
            List <GetBookedRoomsByBranchResult> lstgetBookedRoomsByBranchResults = new List <GetBookedRoomsByBranchResult>();

            try
            {
                ReservationsDTO reservationsDTO = new ReservationsDTO();

                if (getBookedRoomsByBranchRequest != null)
                {
                    if (getBookedRoomsByBranchRequest.BranchCode != null && getBookedRoomsByBranchRequest.BranchCode.Trim().Length > 0)
                    {
                        reservationsDTO.BranchCode = getBookedRoomsByBranchRequest.BranchCode;
                    }
                    else
                    {
                        throw new Exception("Branch Code Obligatorio");
                    }

                    if (getBookedRoomsByBranchRequest.RoomNumber != null && getBookedRoomsByBranchRequest.RoomNumber.Trim().Length > 0)
                    {
                        reservationsDTO.RoomNumber = getBookedRoomsByBranchRequest.RoomNumber;
                    }
                    else
                    {
                        throw new Exception("Room Number Obligatorio");
                    }
                    if (getBookedRoomsByBranchRequest.CheckIn != null && getBookedRoomsByBranchRequest.CheckIn != new DateTime())
                    {
                        reservationsDTO.CheckIn = getBookedRoomsByBranchRequest.CheckIn;
                    }
                    else
                    {
                        throw new Exception("Check In Obligatorio");
                    }
                    if (getBookedRoomsByBranchRequest.CheckOut != null && getBookedRoomsByBranchRequest.CheckOut != new DateTime())
                    {
                        reservationsDTO.CheckOut = getBookedRoomsByBranchRequest.CheckOut;
                    }
                    else
                    {
                        throw new Exception("Check Out Obligatorio");
                    }

                    ReservationsDAL        reservationsDAL = new ReservationsDAL();
                    List <ReservationsDTO> lstreservationsDTOs;

                    lstreservationsDTOs = reservationsDAL.ObtenerReservas(reservationsDTO);

                    if (lstreservationsDTOs != null)
                    {
                        getBookedRoomsByBranchResponse.Status.ErrorDescription = "0";

                        if (lstreservationsDTOs.Count > 0)
                        {
                            foreach (ReservationsDTO FEreservationsDTO in lstreservationsDTOs)
                            {
                                GetBookedRoomsByBranchResult getBookedRoomsByBranchResult;
                                getBookedRoomsByBranchResult = new GetBookedRoomsByBranchResult
                                {
                                    BranchName  = FEreservationsDTO.BranchName,
                                    Beds        = FEreservationsDTO.Beds,
                                    BookDate    = FEreservationsDTO.BookDate,
                                    BranchCode  = FEreservationsDTO.BranchCode,
                                    Description = FEreservationsDTO.Description,
                                    Discount    = FEreservationsDTO.Discount,
                                    Number      = FEreservationsDTO.Number,
                                    Price       = FEreservationsDTO.Price,
                                    RoomName    = FEreservationsDTO.RoomName,
                                    Vat         = FEreservationsDTO.Vat
                                };

                                lstgetBookedRoomsByBranchResults.Add(getBookedRoomsByBranchResult);
                            }

                            getBookedRoomsByBranchResponse.Status.ErrorCode             = "0";
                            getBookedRoomsByBranchResponse.Status.ErrorDescription      = "Proceso Satisfactorio";
                            getBookedRoomsByBranchResponse.GetBookedRoomsByBranchResult = lstgetBookedRoomsByBranchResults.ToArray();
                        }
                        else
                        {
                            getBookedRoomsByBranchResponse.Status.ErrorDescription = "No hay reservas disponibles con los parametros ingresados";
                        }
                    }
                    else
                    {
                        getBookedRoomsByBranchResponse.Status.ErrorCode        = "01";
                        getBookedRoomsByBranchResponse.Status.ErrorDescription = "Error en la ejecución del servicio";
                    }
                }
                else
                {
                    throw new Exception("Parametros de entrada vacios");
                }
            }
            catch (Exception exc)
            {
                Exception le_e;

                le_e = exc.InnerException != null ? exc.InnerException : exc;
                getBookedRoomsByBranchResponse.Status.ErrorCode        = "01";
                getBookedRoomsByBranchResponse.Status.ErrorDescription = exc.InnerException != null ? "Error en la ejecucion del servicio" : exc.Message;
                Common.CreateTrace.WriteLog(Common.CreateTrace.LogLevel.Error, "ERROR EN LA CAPA DE NEGOCIO DannCarltonService:GetBookedRoomsByBranch");
                Common.CreateTrace.WriteLog(Common.CreateTrace.LogLevel.Error, " :: " + le_e.Message);
                throw le_e;
            }

            return(getBookedRoomsByBranchResponse);
        }