// copy all columns from a SOAP Contract to a serialized data object // links: // docLink: http://sql2x.org/documentationLink/10700d38-2227-4021-be12-2f4f206f5dd9 public static void ContractToData(CrudeFerryContract contract, CrudeFerryData data) { data.FerryId = contract.FerryId; data.FerryName = contract.FerryName; data.FerryTypeRcd = contract.FerryTypeRcd; data.ProductId = contract.ProductId; data.FirstFloatDateTime = contract.FirstFloatDateTime; data.OperationalDateTime = contract.OperationalDateTime; data.EngineType = contract.EngineType; data.PassengerCapacity = contract.PassengerCapacity; data.UserId = contract.UserId; data.DateTime = contract.DateTime; }
// 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 <CrudeFerryModel> FetchWithFilter(System.Guid ferryId, string ferryName, string ferryTypeRcd, System.Guid productId, System.DateTime firstFloatDateTime, System.DateTime operationalDateTime, string engineType, int passengerCapacity, System.Guid userId, System.DateTime dateTime) { var list = new List <CrudeFerryModel>(); List <CrudeFerryData> dataList = CrudeFerryData.FetchWithFilter(ferryId, ferryName, ferryTypeRcd, productId, firstFloatDateTime, operationalDateTime, engineType, passengerCapacity, userId, dateTime); foreach (CrudeFerryData data in dataList) { var crudeFerryBusinessModel = new CrudeFerryModel(); DataToModel(data, crudeFerryBusinessModel); list.Add(crudeFerryBusinessModel); } return(list); }
// fetch all rows from table with an offset, and limit of rows // links: // docLink: http://sql2x.org/documentationLink/a87e5c54-b47e-4031-bc3b-837b4cf9f692 public List <CrudeFerryModel> FetchAllWithLimitAndOffset(string limit, string offset) { var list = new List <CrudeFerryModel>(); List <CrudeFerryData> dataList = CrudeFerryData.FetchAllWithLimitAndOffset(int.Parse(limit), int.Parse(offset)); foreach (CrudeFerryData crudeFerryBusiness in dataList) { var model = new CrudeFerryModel(); DataToModel(crudeFerryBusiness, model); list.Add(model); } return(list); }
// copy all rows from a List of serialized data objects in CrudeFerryData to a List of SOAP Contracts // links: // docLink: http://sql2x.org/documentationLink/3d3e60c3-69e4-43d6-8bd5-14a67a6ecf58 public List <CrudeFerryModel> FetchAll() { var list = new List <CrudeFerryModel>(); List <CrudeFerryData> dataList = CrudeFerryData.FetchAll(); foreach (CrudeFerryData crudeFerryBusiness in dataList) { var model = new CrudeFerryModel(); DataToModel(crudeFerryBusiness, model); list.Add(model); } return(list); }
// copy all rows from a List of serialized data objects to a List of SOAP Contracts, // with a limit on number of returned rows and order by columns, starting at a specific row // links: // docLink: http://sql2x.org/documentationLink/3fe9f1b3-97b6-4f58-a0f2-adfcbd973bfc public List <CrudeFerryContract> FetchAllWithLimitAndOffset(int limit, int offset) { var list = new List <CrudeFerryContract>(); List <CrudeFerryData> dataList = CrudeFerryData.FetchAllWithLimitAndOffset(limit, offset); foreach (CrudeFerryData crudeFerry in dataList) { var contract = new CrudeFerryContract(); DataToContract(crudeFerry, contract); list.Add(contract); } return(list); }
// copy all rows from a List of serialized data objects in CrudeFerryData to a List of SOAP Contracts // links: // docLink: http://sql2x.org/documentationLink/9204c68e-93b8-4c77-af3c-3181985ff75f public List <CrudeFerryContract> FetchAll() { var list = new List <CrudeFerryContract>(); List <CrudeFerryData> dataList = CrudeFerryData.FetchAll(); foreach (CrudeFerryData crudeFerry in dataList) { var contract = new CrudeFerryContract(); DataToContract(crudeFerry, contract); list.Add(contract); } return(list); }
// fetch by Search key into current object // links: // crud definition: https://en.wikipedia.org/wiki/Create,_read,_update_and_delete // docLink: http://sql2x.org/documentationLink/87368fa6-b618-4f0c-acbb-1fc4e273bb2d // parameters: // ProductId: key of table CrudeFerryData public List <CrudeFerryModel> FetchByProductId(System.Guid productId) { return(DataListToModelList(CrudeFerryData.FetchByProductId(productId))); }
// fetch by Search key into current object // links: // crud definition: https://en.wikipedia.org/wiki/Create,_read,_update_and_delete // docLink: http://sql2x.org/documentationLink/87368fa6-b618-4f0c-acbb-1fc4e273bb2d // parameters: // FerryTypeRcd: key of table CrudeFerryData public List <CrudeFerryModel> FetchByFerryTypeRcd(string ferryTypeRcd) { return(DataListToModelList(CrudeFerryData.FetchByFerryTypeRcd(ferryTypeRcd))); }
// delete row // links: // docLink: http://sql2x.org/documentationLink/59823bf7-4ad8-4684-a48b-2abd49c607ee public void Delete(System.Guid ferryId) { CrudeFerryData.Delete(ferryId); }
// get a count of rows in table // links: // docLink: http://sql2x.org/documentationLink/39677f9e-daee-45c6-9527-da98a0d7958d public int FetchAllCount() { return(CrudeFerryData.FetchAllCount()); }
// fetch by Search key into current object // links: // crud definition: https://en.wikipedia.org/wiki/Create,_read,_update_and_delete // docLink: http://sql2x.org/documentationLink/87368fa6-b618-4f0c-acbb-1fc4e273bb2d // parameters: // UserId: key of table CrudeFerryData public List <CrudeFerryModel> FetchByUserId(System.Guid userId) { return(DataListToModelList(CrudeFerryData.FetchByUserId(userId))); }
// fetch by Foreign key into new List of class instances // links: // docLink: http://sql2x.org/documentationLink/a7599485-4f00-4ebf-974d-53f69c43654e public List <CrudeFerryContract> FetchByFerryTypeRcd(string ferryTypeRcd) { return(DataListToContractList(CrudeFerryData.FetchByFerryTypeRcd(ferryTypeRcd))); }
// fetch by Foreign key into new List of class instances // links: // docLink: http://sql2x.org/documentationLink/a7599485-4f00-4ebf-974d-53f69c43654e public List <CrudeFerryContract> FetchByUserId(System.Guid userId) { return(DataListToContractList(CrudeFerryData.FetchByUserId(userId))); }
// fetch by Foreign key into new List of class instances // links: // docLink: http://sql2x.org/documentationLink/a7599485-4f00-4ebf-974d-53f69c43654e public List <CrudeFerryContract> FetchByProductId(System.Guid productId) { return(DataListToContractList(CrudeFerryData.FetchByProductId(productId))); }