Exemple #1
0
        // fetch all from table into new List of class instances, filtered by any column
        // links:
        //  docLink: http://sql2x.org/documentationLink/db27658d-4d23-46d7-9970-7bbaef8634b0
        public List <CrudeBookingPassengerBaggageModel> FetchWithFilter(System.Guid bookingPassengerBaggageId, int itemCount, decimal weight, System.Guid userId, System.DateTime dateTime, string remarks)
        {
            var list = new List <CrudeBookingPassengerBaggageModel>();
            List <CrudeBookingPassengerBaggageData> dataList = CrudeBookingPassengerBaggageData.FetchWithFilter(bookingPassengerBaggageId, itemCount, weight, userId, dateTime, remarks);

            foreach (CrudeBookingPassengerBaggageData data in dataList)
            {
                var crudeBookingPassengerBaggageBusinessModel = new CrudeBookingPassengerBaggageModel();
                DataToModel(data, crudeBookingPassengerBaggageBusinessModel);
                list.Add(crudeBookingPassengerBaggageBusinessModel);
            }

            return(list);
        }
        // fetch all rows from table into new List of Contracts, filtered by any column
        // links:
        //  docLink: http://sql2x.org/documentationLink/ce01ef4a-5cd0-4e51-b211-9c0a15b791a0
        public List <CrudeBookingPassengerBaggageContract> FetchWithFilter(System.Guid bookingPassengerBaggageId, int itemCount, decimal weight, System.Guid userId, System.DateTime dateTime, string remarks)
        {
            var list = new List <CrudeBookingPassengerBaggageContract>();
            List <CrudeBookingPassengerBaggageData> dataList = CrudeBookingPassengerBaggageData.FetchWithFilter(
                bookingPassengerBaggageId: bookingPassengerBaggageId,
                itemCount: itemCount,
                weight: weight,
                userId: userId,
                dateTime: dateTime,
                remarks: remarks
                );

            foreach (CrudeBookingPassengerBaggageData data in dataList)
            {
                var crudeBookingPassengerBaggageContract = new CrudeBookingPassengerBaggageContract();
                DataToContract(data, crudeBookingPassengerBaggageContract);
                list.Add(crudeBookingPassengerBaggageContract);
            }

            return(list);
        }