00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _TARIFFPERIODGW_H_
00031 #define _TARIFFPERIODGW_H_
00032
00033
00034
00035
00036
00037
00038 #include "tariffperiod.h"
00039
00040
00041
00042 namespace OSB_DB {
00043 class Session;
00044 }
00045
00046
00047
00048 namespace OSB_DB {
00049
00050
00051
00052
00053
00054
00058 struct DayClassGw {
00060 friend class OSB_LIB::DayClass;
00061
00070 long fetch(
00071 const Session& session,
00072 OSB_LIB::DayClasses& dcs
00073 );
00074
00087 bool fetch(
00088 const Session& session,
00089 OSB_LIB::DayClass& dc
00090 );
00091
00092 private:
00109 bool insDayClass(
00110 const Session& session,
00111 OSB_LIB::DayClass& dc
00112 );
00113
00129 bool delDayClass(
00130 const Session& session,
00131 OSB_LIB::DayClass& dc
00132 );
00133
00149 bool updDayClass(
00150 const Session& session,
00151 OSB_LIB::DayClass& dc
00152 );
00153
00168 OSB_LIB::ObjectStatus checkObjVs(
00169 const Session& session,
00170 const OSB_LIB::DayClass& dc
00171 );
00172
00187 OSB_LIB::CfgStatus getStatus(
00188 const Session& session,
00189 const OSB_LIB::DayClass::Oid& oid
00190 );
00191
00199 void updStatus(
00200 const Session& session,
00201 OSB_LIB::DayClass& dc
00202 );
00203
00215 bool hasFreezedSpecialDate(
00216 const Session& session,
00217 const OSB_LIB::DayClass::Oid& oid
00218 );
00219
00231 bool hasReleasedSpecialDate(
00232 const Session& session,
00233 const OSB_LIB::DayClass::Oid& oid
00234 );
00235
00245 bool isUsedByFreezedTpVersion(
00246 const Session& session,
00247 const OSB_LIB::DayClass::Oid& oid
00248 );
00249
00259 bool isUsedByReleasedTpVersion(
00260 const Session& session,
00261 const OSB_LIB::DayClass::Oid& oid
00262 );
00263 };
00264
00265
00266
00270 struct SpecialDateGw {
00272 friend class OSB_LIB::SpecialDate;
00273
00285 long fetch(
00286 const Session& session,
00287 OSB_LIB::SpecialDates& sds
00288 );
00289
00302 bool fetch(
00303 const Session& session,
00304 OSB_LIB::SpecialDate& sd
00305 );
00306
00307 private:
00316 bool insSpecialDate(
00317 const Session& session,
00318 OSB_LIB::SpecialDate& sd
00319 );
00320
00331 bool delSpecialDate(
00332 const Session& session,
00333 OSB_LIB::SpecialDate& sd
00334 );
00335
00350 bool updSpecialDate(
00351 const Session& session,
00352 OSB_LIB::SpecialDate& sd
00353 );
00354
00369 OSB_LIB::ObjectStatus checkObjVs(
00370 const Session& session,
00371 const OSB_LIB::SpecialDate& sd
00372 );
00373
00388 OSB_LIB::CfgStatus getStatus(
00389 const Session& session,
00390 const OSB_LIB::SpecialDate::Oid& sdId
00391 );
00392
00400 void updStatus(
00401 const Session& session,
00402 OSB_LIB::SpecialDate& sd
00403 );
00404
00414 bool dateInFuture(
00415 const Session& session,
00416 const OSB_LIB::SpecialDate& sd
00417 );
00418
00428 bool dayClassFreezed(
00429 const Session& session,
00430 const OSB_LIB::SpecialDate& sd
00431 );
00432
00442 bool dayClassReleased(
00443 const Session& session,
00444 const OSB_LIB::SpecialDate& sd
00445 );
00446 };
00447
00448
00449
00453 struct TariffPeriodGw {
00455 friend class OSB_LIB::TariffPeriod;
00456
00467 long fetch(
00468 const Session& session,
00469 OSB_LIB::TariffPeriods& tps
00470 );
00471
00482 bool fetch(
00483 const Session& session,
00484 OSB_LIB::TariffPeriod& tp
00485 );
00486
00487 private:
00500 bool insTariffPeriod(
00501 const Session& session,
00502 OSB_LIB::TariffPeriod& tp
00503 );
00504
00522 bool updTariffPeriod(
00523 const Session& session,
00524 OSB_LIB::TariffPeriod& tp
00525 );
00526
00537 bool delTariffPeriod(
00538 const Session& session,
00539 OSB_LIB::TariffPeriod& tp
00540 );
00541
00556 OSB_LIB::ObjectStatus checkObjVs(
00557 const Session& session,
00558 const OSB_LIB::TariffPeriod& tp
00559 );
00560 };
00561
00562
00563
00567 struct TpSystemGw {
00569 friend class OSB_LIB::TpSystem;
00570
00580 long fetch(
00581 const Session& session,
00582 OSB_LIB::TpSystems& tpss
00583 );
00584
00593 bool fetch(
00594 const Session& session,
00595 OSB_LIB::TpSystem& tps
00596 );
00597
00598 private:
00615 bool insTpSystem(
00616 const Session& session,
00617 OSB_LIB::TpSystem& tps
00618 );
00619
00636 bool updTpSystem(
00637 const Session& session,
00638 OSB_LIB::TpSystem& tps
00639 );
00640
00657 bool delTpSystem(
00658 const Session& session,
00659 OSB_LIB::TpSystem& tps
00660 );
00661
00676 OSB_LIB::ObjectStatus checkObjVs(
00677 const Session& session,
00678 const OSB_LIB::TpSystem& tps
00679 );
00680 };
00681
00682
00683
00687 struct TpsVersionGw {
00689 friend class OSB_LIB::TpsVersion;
00690
00701 long fetch(
00702 const Session& session,
00703 OSB_LIB::TpsVersions& tpsvs
00704 );
00705
00717 bool fetch(
00718 const Session& session,
00719 OSB_LIB::TpsVersion& tpsv
00720 );
00721
00722 private:
00741 bool insTpsVersion(
00742 const Session& session,
00743 OSB_LIB::TpsVersion& tpsv
00744 );
00745
00762 bool delTpsVersion(
00763 const Session& session,
00764 OSB_LIB::TpsVersion& tpsv
00765 );
00766
00783 bool updTpsVersion(
00784 const Session& session,
00785 OSB_LIB::TpsVersion& tpsv
00786 );
00787
00796 OSB_LIB::ObjectStatus checkObjVs(
00797 const Session& session,
00798 const OSB_LIB::TpsVersion& tpsv
00799 );
00800
00811 bool eachDayCoveredOnce(
00812 const Session& session,
00813 const OSB_LIB::TpsVersion::Oid& oid
00814 );
00815
00825 bool checkSwitchTime(
00826 const Session& session,
00827 const OSB_LIB::TpsVersion::Oid& oid,
00828 OSB_LIB::OsbErrors& errors
00829 );
00830
00839 bool allDayClassesFreezed(
00840 const Session& session,
00841 const OSB_LIB::TpsVersion::Oid& oid,
00842 OSB_LIB::OsbErrors& errors
00843 );
00844
00856 bool checkDcSwitchTimeUnique(
00857 const Session& session,
00858 const OSB_LIB::TpsVersion::Oid& oid,
00859 OSB_LIB::OsbErrors& errors
00860 );
00861
00870 bool switchTimeZeroDefined(
00871 const Session& session,
00872 const OSB_LIB::TpsVersion::Oid& oid,
00873 OSB_LIB::OsbErrors& errors
00874 );
00875
00882 bool wholeWeekCover(
00883 const Session& session,
00884 const OSB_LIB::TpsVersion::Oid& oid
00885 );
00886
00902 bool identicalTariffPeriod(
00903 const Session& session,
00904 const OSB_LIB::TpsVersion::Oid& oid
00905 );
00906
00914 void updStatus(
00915 const Session& session,
00916 OSB_LIB::TpsVersion& tpsVs
00917 );
00918
00932 bool isReleasedInFuture(
00933 const Session& session,
00934 const OSB_LIB::TpsVersion::Oid& oid
00935 );
00936
00948 bool uniqueReleaseTs(
00949 const Session& session,
00950 const OSB_LIB::TpSystem::Oid& oid,
00951 const OSB_LIB::DateTime& ts
00952 ) const;
00953
00962 bool allDayClassesReleased(
00963 const Session& session,
00964 const OSB_LIB::TpsVersion::Oid& oid,
00965 OSB_LIB::OsbErrors& errors
00966 );
00967
00983 bool isTpSystemUsedByReleasedTsVersion(
00984 const Session& session,
00985 const OSB_LIB::TpSystem::Oid& oid
00986 );
00987
01003 bool isTpSystemUsedByFreezedTsVersion(
01004 const Session& session,
01005 const OSB_LIB::TpSystem::Oid& oid
01006 );
01007
01018 OSB_LIB::DateTime nextReleasedVersion(
01019 const Session& session,
01020 const OSB_LIB::TpsVersion::Oid& oid
01021 );
01022
01033 bool hasOtherReleasedTpsVersion(
01034 const Session& session,
01035 const OSB_LIB::TpsVersion::Oid& oid
01036 );
01037
01049 bool findReplacementFreezedTpsVersion(
01050 const Session& session,
01051 const OSB_LIB::TpsVersion::Oid& oid
01052 );
01053 };
01054
01055
01056
01057
01058 }
01059 #endif // #ifndef _TARIFFPERIODGW_H_