public async Task <BaseResult <List <HotelFacilityGroupViewModel> > > GetTemplateHotelFacilityFields(int templateId, int languageId) { DynamicParameters paramCollection = ContractTemplateRequestMapper.CreateTemplateHotelFacilityRequestParams(templateId, languageId, true); //return await iTemplateHotelFieldLibrary.ExecuteStoredProcedure(Constants.StoredProcedure.GetHotelFieldsByTemplateId, paramCollection).ConfigureAwait(false); var facilityGroup = await iTemplateHotelFieldLibrary.ExecuteStoredProcedure(Constants.StoredProcedure.GetHotelFieldsByTemplateId, paramCollection).ConfigureAwait(false); //IConnection<HotelFacilityGroup> iHotelFacilityGroupLibrary, // IConnection< HotelFacilityType > iHotelFacilityTypeLibrary, // IConnection<HotelFacility> iHotelFacilityLibrary, // IConnection< HotelFacilityRelation > iHotelFacilityRelationLibrary, // IConnection<InOutTime> inOutTimeLibrary IFacilities iFacilities = new FacilitiesRepository(new DapperConnection <HotelFacilityGroup>(iConfiguration), new DapperConnection <HotelFacilityType>(iConfiguration), new DapperConnection <HotelFacility>(iConfiguration), null, null); BaseResult <List <HotelFacilityGroup> > hotelFacilityGroup = await iFacilities.GeHotelFacilityGroup().ConfigureAwait(false); BaseResult <List <HotelFacilityType> > hotelFacilityType = await iFacilities.GeHotelFacilityType().ConfigureAwait(false); BaseResult <List <HotelFacility> > hotelFacility = await iFacilities.GeHotelFacility().ConfigureAwait(false); var facilities = FacilitiesResponseMapper.MapHotelFacilities(hotelFacility); ////maps to facilityViewModel var result = FacilitiesResponseMapper.MapHotelFacilityType(facilities, hotelFacilityType); ////maps to HotelFacilityTypeViewModel var result1 = FacilitiesResponseMapper.MapHotelFacilityGroup(facilities, hotelFacilityGroup, result); ////Maps to HotelFacilityGroupViewModel ContractTemplateResponseMapper.MapToFacilityFieldToViewModel(facilityGroup.Result, result1.Result); return(result1); }
/// <summary> /// Update Contract Template /// </summary> /// <param name="request">request</param> /// <param name="userName">userName</param> /// <returns>Bool Value (Success or not)</returns> public async Task <BaseResult <bool> > UpdateContractTemplateName(ContractTemplateViewModel request, string userName) { var templateRequest = ContractTemplateRequestMapper.MapToContractTemplateModel(request, userName); var param = new DynamicParameters(); param.Add(Constants.StoredProcedureParameters.TemplateId, templateRequest.Id); param.Add(Constants.StoredProcedureParameters.Name, templateRequest.Name); param.Add(Constants.StoredProcedureParameters.UpdatedBy, templateRequest.UpdatedBy); param.Add(Constants.StoredProcedureParameters.UpdatedDate, templateRequest.UpdatedDate); param.Add(Constants.StoredProcedureParameters.IsPublished, templateRequest.IsPublished); return(await iContractTemplateLibrary.ExecuteStoredProcedureInsertUpdate(Constants.StoredProcedure.UpdateContractTemplateName, param).ConfigureAwait(false)); }
/// <summary> /// Get The count of amenities for selected template (while creating contract). /// </summary> /// <param name="templateId"></param> /// <param name="languageId"></param> /// <returns> Count of amenities</returns> public async Task <BaseResult <int> > GetCountOfAmenitiesForSelectedTemplate(int templateId, int languageId) { var result = new BaseResult <int>(); DynamicParameters paramCollection = ContractTemplateRequestMapper.CreateTemplateHotelFacilityRequestParams(templateId, languageId, true); var list = await iTemplateRoomFieldLibrary.ExecuteStoredProcedure(Constants.StoredProcedure.GetRooomFieldsByTemplateId, paramCollection).ConfigureAwait(false); if (list.IsError == true && list.ExceptionMessage != null) { result.IsError = list.IsError; result.ExceptionMessage = list.ExceptionMessage; return(result); } if (list != null && list.Result.Any()) { var count = list.Result.Count(a => a.IsSelected == true); result.Result = count; return(result); } return(result); }
public async Task <BaseResult <bool> > UpdateContractTemplateRoomFields(List <RoomFieldViewModel> requestFields, string userName, int templateId) { var result = new BaseResult <bool>() { Result = true }; var roomFields = ContractTemplateRequestMapper.MapToContractTemplateRoomFieldsModel(requestFields, userName, templateId, true); foreach (var field in roomFields) { var param = ContractTemplateRequestMapper.CreateTemplateFieldsRequestParams(field); var updateResult = await iTemplateRoomFieldLibrary.ExecuteStoredProcedureInsertUpdate(Constants.StoredProcedure.UpdateRooomFields, param).ConfigureAwait(false); if (updateResult.IsError && updateResult.ExceptionMessage != null) { return(updateResult); } } return(result); }
public async Task <BaseResult <Field> > CreateTemplateCopy(CopyTemplate request, string userName) { BaseResult <List <Field> > templateList = new BaseResult <List <Field> >(); DynamicParameters paramCollection = ContractTemplateRequestMapper.CreateTemplateCopyRequest(request, userName); templateList = await iTemplate.ExecuteStoredProcedure(Constants.StoredProcedure.CreateTemplateCopy, paramCollection).ConfigureAwait(false); if (templateList != null) { BaseResult <Field> copiedtemplate = new BaseResult <Field> { IsError = templateList.IsError, ExceptionMessage = templateList.ExceptionMessage }; if (templateList.Result != null && templateList.Result.Any()) { copiedtemplate.Result = templateList.Result[0]; } return(copiedtemplate); } return(null); }
/// <summary> /// Insert Template Clause Library Fields /// </summary> /// <param name="requestClauseLibraryFields">request Clause Library Fields</param> /// <param name="userName">user Name</param> /// <param name="templateId">template Id</param> /// <returns></returns> public Task <BaseResult <long> > InsertTemplateClauseLibraryFields(List <TemplateClauseLibraryViewModel> requestClauseLibraryFields, string userName, int templateId) { var templateClauseLibraryFields = ContractTemplateRequestMapper.MapToContractTemplateClauseLibraryModel(requestClauseLibraryFields, userName, templateId); return(iTemplateClauseLibraryRelation.InsertEntityList(templateClauseLibraryFields)); }
public async Task <BaseResult <long> > InsertContractTemplateRoomFacilities(List <RoomFacilityGroupViewModel> requestFacilityFields, string userName, int templateId) { var roomFacilities = ContractTemplateRequestMapper.MapToContractTemplateRoomFacilityModel(requestFacilityFields, userName, templateId); return(await iTemplateRoomFieldLibrary.InsertEntityList(roomFacilities).ConfigureAwait(false)); }
public Task <BaseResult <long> > InsertContractTemplateHotelFacilities(List <HotelFacilityGroupViewModel> requestFacilityFields, string userName, int templateId) { var hotelFacilities = ContractTemplateRequestMapper.MapToContractTemplateHotelFacilityModel(requestFacilityFields, userName, templateId); return(iTemplateHotelFieldLibrary.InsertEntityList(hotelFacilities)); }
public Task <BaseResult <long> > InsertContractTemplateRoomProperties(List <RoomFieldViewModel> requestRoomFields, string userName, int templateId) { var roomFieldsProperties = ContractTemplateRequestMapper.MapToContractTemplateRoomFieldsModel(requestRoomFields, userName, templateId); return(iTemplateRoomFieldLibrary.InsertEntityList(roomFieldsProperties)); }
public Task <BaseResult <long> > CreateContractTemplate(ContractTemplateViewModel contractTemplateViewModel, string userName) { var contractTemplate = ContractTemplateRequestMapper.MapToContractTemplateModel(contractTemplateViewModel, userName); return(iContractTemplateLibrary.InsertEntity(contractTemplate)); }
public async Task <BaseResult <List <TemplateRoomField> > > GetTemplateRoomFields(int templateId, bool isFacility = false) { var paramCollection = ContractTemplateRequestMapper.CreateTemplateHotelFacilityRequestParams(templateId, 1, isFacility); return(await iTemplateRoomFieldLibrary.ExecuteStoredProcedure(Constants.StoredProcedure.GetRooomFieldsByTemplateId, paramCollection).ConfigureAwait(false)); }