/// <summary> /// <see cref="CustomerMaintenanceSettingApiService"/> クラスの新しいインスタンスを作成します。 /// </summary> public CustomerMaintenanceSettingApiService( ) { var customerMaintenanceSetting = new CustomerMaintenanceSettingDto(); // 締日区分 customerMaintenanceSetting.CutoffDateTypeList = DataBase.CutoffDateTypes.Select <CutoffDateTypeModel, CutoffDateTypeListItem>( c => new CutoffDateTypeListItem() { CutoffDateType = c.CutoffDateType, CutoffDateTypeName = c.CutoffDateTypeName }).ToList(); // 回収日区分 customerMaintenanceSetting.CollectionDateTypeList = DataBase.CollectionDateTypes.Select <CollectionDateTypeModel, CollectionDateTypeListItem>( c => new CollectionDateTypeListItem() { CollectionDateType = c.CollectionDateType, CollectionDateTypeName = c.CollectionDateTypeName }).ToList(); // 消費税区分 customerMaintenanceSetting.TaxTypeList = DataBase.TaxTypes.Select <TaxTypeModel, TaxTypeListItem>( t => new TaxTypeListItem() { TaxType = t.TaxType, TaxTypeName = t.TaxTypeName }).ToList(); // 消費税計算区分 customerMaintenanceSetting.TaxCalcTypeList = DataBase.TaxCalcTypes.Select <TaxCalcTypeModel, TaxCalcTypeListItem>( t => new TaxCalcTypeListItem() { TaxCalcType = t.TaxCalcType, TaxCalcTypeName = t.TaxCalcTypeName }).ToList(); // 消費税端数処理区分 customerMaintenanceSetting.TaxRoundTypeList = DataBase.TaxRoundTypes.Select <TaxRoundTypeModel, TaxRoundTypeListItem>( t => new TaxRoundTypeListItem() { TaxRoundType = t.TaxRoundType, TaxRoundTypeName = t.TaxRoundTypeName }).ToList(); this.CustomerMaintenanceSetting = customerMaintenanceSetting; }
public CustomerMaintenanceSettingDto Get( [FromServices] ICustomerMaintenanceSettingGetService service ) { var output = service.Get(); var response = new CustomerMaintenanceSettingDto(); // 締日区分リスト response.CutoffDateTypeList = output.CutoffDateTypes.Select <ICutoffDateTypeModel, CutoffDateTypeListItem>( model => new CutoffDateTypeListItem() { CutoffDateType = model.CutoffDateType, CutoffDateTypeName = model.CutoffDateTypeName }).ToList(); // 回収日区分リスト response.CollectionDateTypeList = output.CollectionDateTypes.Select <ICollectionDateTypeModel, CollectionDateTypeListItem>( model => new CollectionDateTypeListItem() { CollectionDateType = model.CollectionDateType, CollectionDateTypeName = model.CollectionDateTypeName }).ToList(); // 消費税区分リスト response.TaxTypeList = output.TaxTypes.Select <ITaxTypeModel, TaxTypeListItem>( model => new TaxTypeListItem() { TaxType = model.TaxType, TaxTypeName = model.TaxTypeName }).ToList(); // 消費税計算区分リスト response.TaxCalcTypeList = output.TaxCalcTypes.Select <ITaxCalcTypeModel, TaxCalcTypeListItem>( model => new TaxCalcTypeListItem() { TaxCalcType = model.TaxCalcType, TaxCalcTypeName = model.TaxCalcTypeName }).ToList(); // 消費税端数処理区分リスト response.TaxRoundTypeList = output.TaxRoundTypes.Select <ITaxRoundType, TaxRoundTypeListItem>( model => new TaxRoundTypeListItem() { TaxRoundType = model.TaxRoundType, TaxRoundTypeName = model.TaxRoundTypeName }).ToList(); return(response); }