From 6082271d4bc51f4efd10266838ab21114302341d Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Fri, 21 Sep 2018 19:25:38 +0530 Subject: [PATCH] master detail changes --- .../branch-dialog.component.html | 65 ++++ .../branch-dialog.component.scss | 8 + .../branch-dialog.component.spec.ts | 25 ++ .../branch-dialog/branch-dialog.component.ts | 86 +++++ .../branch-list/branch-list.component.html | 84 +++++ .../branch-list/branch-list.component.scss | 97 ++++++ .../branch-list/branch-list.component.spec.ts | 25 ++ .../branch-list/branch-list.component.ts | 118 +++++++ .../city-dialog/city-dialog.component.html | 56 ++++ .../city-dialog/city-dialog.component.scss | 3 + .../city-dialog/city-dialog.component.spec.ts | 25 ++ .../city/city-dialog/city-dialog.component.ts | 83 +++++ .../city/city-list/city-list.component.html | 76 +++++ .../city/city-list/city-list.component.scss | 69 ++++ .../city-list/city-list.component.spec.ts | 25 ++ .../city/city-list/city-list.component.ts | 107 ++++++ ...comments-on-locality-dialog.component.html | 42 +++ ...comments-on-locality-dialog.component.scss | 3 + ...ments-on-locality-dialog.component.spec.ts | 25 ++ .../comments-on-locality-dialog.component.ts | 58 ++++ .../comments-on-locality-list.component.html | 65 ++++ .../comments-on-locality-list.component.scss | 93 ++++++ ...omments-on-locality-list.component.spec.ts | 25 ++ .../comments-on-locality-list.component.ts | 107 ++++++ .../company-dialog.component.html | 114 +++++++ .../company-dialog.component.scss | 0 .../company-dialog.component.spec.ts | 25 ++ .../company-dialog.component.ts | 113 +++++++ .../company-list/company-list.component.html | 100 ++++++ .../company-list/company-list.component.scss | 93 ++++++ .../company-list.component.spec.ts | 25 ++ .../company-list/company-list.component.ts | 109 ++++++ .../customer-behaviour-dialog.component.html | 43 +++ .../customer-behaviour-dialog.component.scss | 3 + ...ustomer-behaviour-dialog.component.spec.ts | 25 ++ .../customer-behaviour-dialog.component.ts | 68 ++++ .../customer-behaviour-list.component.html | 65 ++++ .../customer-behaviour-list.component.scss | 93 ++++++ .../customer-behaviour-list.component.spec.ts | 25 ++ .../customer-behaviour-list.component.ts | 108 ++++++ .../customer-segment-dialog.component.html | 49 +++ .../customer-segment-dialog.component.scss | 3 + .../customer-segment-dialog.component.spec.ts | 25 ++ .../customer-segment-dialog.component.ts | 74 +++++ .../customer-segment-list.component.html | 70 ++++ .../customer-segment-list.component.scss | 93 ++++++ .../customer-segment-list.component.spec.ts | 25 ++ .../customer-segment-list.component.ts | 107 ++++++ .../designation-dialog.component.html | 51 +++ .../designation-dialog.component.scss | 3 + .../designation-dialog.component.spec.ts | 25 ++ .../designation-dialog.component.ts | 73 +++++ .../designation-list.component.html | 70 ++++ .../designation-list.component.scss | 93 ++++++ .../designation-list.component.spec.ts | 25 ++ .../designation-list.component.ts | 109 ++++++ .../frequency-dialog.component.html | 40 +++ .../frequency-dialog.component.scss | 3 + .../frequency-dialog.component.spec.ts | 25 ++ .../frequency-dialog.component.ts | 64 ++++ .../frequency-list.component.html | 79 +++++ .../frequency-list.component.scss | 122 +++++++ .../frequency-list.component.spec.ts | 25 ++ .../frequency-list.component.ts | 110 +++++++ ...ustry_classification-dialog.component.html | 42 +++ ...ustry_classification-dialog.component.scss | 3 + ...ry_classification-dialog.component.spec.ts | 25 ++ ...ndustry_classification-dialog.component.ts | 64 ++++ ...ndustry_classification-list.component.html | 79 +++++ ...ndustry_classification-list.component.scss | 118 +++++++ ...stry_classification-list.component.spec.ts | 0 .../industry_classification-list.component.ts | 126 +++++++ .../lender-hierarchy-dialog.component.html | 39 +++ .../lender-hierarchy-dialog.component.scss | 3 + .../lender-hierarchy-dialog.component.spec.ts | 25 ++ .../lender-hierarchy-dialog.component.ts | 73 +++++ .../lender-hierarchy-list.component.html | 64 ++++ .../lender-hierarchy-list.component.scss | 93 ++++++ .../lender-hierarchy-list.component.spec.ts | 25 ++ .../lender-hierarchy-list.component.ts | 108 ++++++ .../members-occupation-dialog.component.html | 41 +++ .../members-occupation-dialog.component.scss | 3 + ...embers-occupation-dialog.component.spec.ts | 25 ++ .../members-occupation-dialog.component.ts | 63 ++++ .../members-occupation-list.component.html | 84 +++++ .../members-occupation-list.component.scss | 59 ++++ .../members-occupation-list.component.spec.ts | 25 ++ .../members-occupation-list.component.ts | 111 +++++++ .../pd-allocation-type-dialog.component.html | 40 +++ .../pd-allocation-type-dialog.component.scss | 3 + ...d-allocation-type-dialog.component.spec.ts | 25 ++ .../pd-allocation-type-dialog.component.ts | 73 +++++ .../pd-allocation-type-list.component.html | 64 ++++ .../pd-allocation-type-list.component.scss | 93 ++++++ .../pd-allocation-type-list.component.spec.ts | 25 ++ .../pd-allocation-type-list.component.ts | 109 ++++++ ...pd-location-approach-dialog.component.html | 42 +++ ...pd-location-approach-dialog.component.scss | 3 + ...location-approach-dialog.component.spec.ts | 25 ++ .../pd-location-approach-dialog.component.ts | 75 +++++ .../pd-location-approach-list.component.html | 67 ++++ .../pd-location-approach-list.component.scss | 93 ++++++ ...d-location-approach-list.component.spec.ts | 25 ++ .../pd-location-approach-list.component.ts | 112 +++++++ .../pd-type-dialog.component.html | 43 +++ .../pd-type-dialog.component.scss | 3 + .../pd-type-dialog.component.spec.ts | 25 ++ .../pd-type-dialog.component.ts | 65 ++++ .../pd-type-list/pd-type-list.component.html | 64 ++++ .../pd-type-list/pd-type-list.component.scss | 93 ++++++ .../pd-type-list.component.spec.ts | 25 ++ .../pd/pd-type-list/pd-type-list.component.ts | 111 +++++++ .../product-dialog.component.html | 46 +++ .../product-dialog.component.scss | 8 + .../product-dialog.component.spec.ts | 25 ++ .../product-dialog.component.ts | 55 ++++ .../product-list/product-list.component.html | 309 ++++++++++++++++++ .../product-list/product-list.component.scss | 92 ++++++ .../product-list.component.spec.ts | 25 ++ .../product-list/product-list.component.ts | 159 +++++++++ .../regions-dialog.component.html | 42 +++ .../regions-dialog.component.scss | 3 + .../regions-dialog.component.spec.ts | 25 ++ .../regions-dialog.component.ts | 66 ++++ .../regions-list/regions-list.component.html | 65 ++++ .../regions-list/regions-list.component.scss | 93 ++++++ .../regions-list.component.spec.ts | 25 ++ .../regions-list/regions-list.component.ts | 109 ++++++ .../relation-ship-dialog.component.html | 41 +++ .../relation-ship-dialog.component.scss | 3 + .../relation-ship-dialog.component.spec.ts | 25 ++ .../relation-ship-dialog.component.ts | 64 ++++ .../relation-ship-list.component.html | 85 +++++ .../relation-ship-list.component.scss | 120 +++++++ .../relation-ship-list.component.spec.ts | 25 ++ .../relation-ship-list.component.ts | 116 +++++++ .../states-dialog.component.html | 66 ++++ .../states-dialog.component.scss | 3 + .../states-dialog.component.spec.ts | 25 ++ .../states-dialog/states-dialog.component.ts | 106 ++++++ .../states-list/states-list.component.html | 105 ++++++ .../states-list/states-list.component.scss | 93 ++++++ .../states-list/states-list.component.spec.ts | 25 ++ .../states-list/states-list.component.ts | 110 +++++++ .../sub-product-dialog.component.html | 75 +++++ .../sub-product-dialog.component.scss | 4 + .../sub-product-dialog.component.spec.ts | 25 ++ .../sub-product-dialog.component.ts | 74 +++++ .../sub-product-list.component.html | 95 ++++++ .../sub-product-list.component.scss | 120 +++++++ .../sub-product-list.component.spec.ts | 25 ++ .../sub-product-list.component.ts | 111 +++++++ .../title-dialog/title-dialog.component.html | 41 +++ .../title-dialog/title-dialog.component.scss | 3 + .../title-dialog.component.spec.ts | 25 ++ .../title-dialog/title-dialog.component.ts | 63 ++++ .../title-list/title-list.component.html | 85 +++++ .../title-list/title-list.component.scss | 119 +++++++ .../title-list/title-list.component.spec.ts | 25 ++ .../title/title-list/title-list.component.ts | 112 +++++++ .../activity-dialog.component.html | 41 +++ .../activity-dialog.component.scss | 3 + .../activity-dialog.component.spec.ts | 25 ++ .../activity-dialog.component.ts | 64 ++++ .../activity-list.component.html | 79 +++++ .../activity-list.component.scss | 118 +++++++ .../activity-list.component.spec.ts | 25 ++ .../activity-list/activity-list.component.ts | 104 ++++++ .../uom/uom-dialog/uom-dialog.component.html | 40 +++ .../uom/uom-dialog/uom-dialog.component.scss | 0 .../uom-dialog/uom-dialog.component.spec.ts | 25 ++ .../uom/uom-dialog/uom-dialog.component.ts | 65 ++++ .../uom/uom-list/uom-list.component.html | 79 +++++ .../uom/uom-list/uom-list.component.scss | 118 +++++++ .../uom/uom-list/uom-list.component.spec.ts | 25 ++ .../uom/uom-list/uom-list.component.ts | 115 +++++++ .../settings/masters/masters.component.html | 145 ++++++++ .../settings/masters/masters.component.scss | 3 + .../masters/masters.component.spec.ts | 25 ++ .../app/settings/masters/masters.component.ts | 198 +++++++++++ .../settings/masters/masters.module.spec.ts | 14 + .../app/settings/masters/masters.module.ts | 184 +++++++++++ .../app/settings/masters/masters.routing.ts | 12 + .../app/settings/masters/model/activity.ts | 11 + .../src/app/settings/masters/model/branch.ts | 24 ++ .../src/app/settings/masters/model/city.ts | 4 + .../masters/model/comments-on-locality.ts | 3 + .../src/app/settings/masters/model/company.ts | 3 + .../masters/model/customer-behaviour.ts | 4 + .../masters/model/customer-segment.ts | 3 + .../app/settings/masters/model/designation.ts | 4 + .../app/settings/masters/model/entity-type.ts | 3 + .../app/settings/masters/model/frequency.ts | 6 + .../masters/model/industry_classification.ts | 16 + .../masters/model/lender-hierarchy.ts | 4 + .../masters/model/members-occupation.ts | 11 + ng6-seed/src/app/settings/masters/model/pd.ts | 15 + .../settings/masters/model/product-master.ts | 16 + .../src/app/settings/masters/model/regions.ts | 3 + .../settings/masters/model/relation-ship.ts | 6 + .../src/app/settings/masters/model/states.ts | 3 + .../masters/model/sub-product-master.ts | 8 + .../src/app/settings/masters/model/title.ts | 6 + .../src/app/settings/masters/model/uom.ts | 6 + .../src/app/settings/masters/model/user.ts | 8 + .../service/masters/masters.service.spec.ts | 15 + .../service/masters/masters.service.ts | 217 ++++++++++++ ng6-seed/src/app/settings/settings.module.ts | 2 + ng6-seed/src/app/settings/settings.routing.ts | 8 +- .../menu-items/horizontal-menu-items.ts | 9 + .../src/app/shared/menu-items/menu-items.ts | 2 +- 211 files changed, 11428 insertions(+), 3 deletions(-) create mode 100644 ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.ts create mode 100644 ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html create mode 100644 ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.scss create mode 100644 ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts create mode 100644 ng6-seed/src/app/settings/masters/masters.component.html create mode 100644 ng6-seed/src/app/settings/masters/masters.component.scss create mode 100644 ng6-seed/src/app/settings/masters/masters.component.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/masters.component.ts create mode 100644 ng6-seed/src/app/settings/masters/masters.module.spec.ts create mode 100644 ng6-seed/src/app/settings/masters/masters.module.ts create mode 100755 ng6-seed/src/app/settings/masters/masters.routing.ts create mode 100644 ng6-seed/src/app/settings/masters/model/activity.ts create mode 100644 ng6-seed/src/app/settings/masters/model/branch.ts create mode 100644 ng6-seed/src/app/settings/masters/model/city.ts create mode 100644 ng6-seed/src/app/settings/masters/model/comments-on-locality.ts create mode 100644 ng6-seed/src/app/settings/masters/model/company.ts create mode 100644 ng6-seed/src/app/settings/masters/model/customer-behaviour.ts create mode 100644 ng6-seed/src/app/settings/masters/model/customer-segment.ts create mode 100644 ng6-seed/src/app/settings/masters/model/designation.ts create mode 100644 ng6-seed/src/app/settings/masters/model/entity-type.ts create mode 100644 ng6-seed/src/app/settings/masters/model/frequency.ts create mode 100644 ng6-seed/src/app/settings/masters/model/industry_classification.ts create mode 100644 ng6-seed/src/app/settings/masters/model/lender-hierarchy.ts create mode 100644 ng6-seed/src/app/settings/masters/model/members-occupation.ts create mode 100644 ng6-seed/src/app/settings/masters/model/pd.ts create mode 100644 ng6-seed/src/app/settings/masters/model/product-master.ts create mode 100644 ng6-seed/src/app/settings/masters/model/regions.ts create mode 100644 ng6-seed/src/app/settings/masters/model/relation-ship.ts create mode 100644 ng6-seed/src/app/settings/masters/model/states.ts create mode 100644 ng6-seed/src/app/settings/masters/model/sub-product-master.ts create mode 100644 ng6-seed/src/app/settings/masters/model/title.ts create mode 100644 ng6-seed/src/app/settings/masters/model/uom.ts create mode 100644 ng6-seed/src/app/settings/masters/model/user.ts create mode 100644 ng6-seed/src/app/settings/service/masters/masters.service.spec.ts create mode 100644 ng6-seed/src/app/settings/service/masters/masters.service.ts diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html new file mode 100644 index 000000000..3e7375ab1 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html @@ -0,0 +1,65 @@ + +
+
Branch
+
+
+
+ + + +
+ +
+ + +
+ + + + + {{ cd.name }} + + You must Pickup City Name. + + +
+ +
+ + + You must inculde a Name + + +
+ + + +
+
+ + + +
+ +
+
+
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.scss new file mode 100644 index 000000000..7c5eb0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.scss @@ -0,0 +1,8 @@ +mat-form-field{ + width:100%; +} +mat-dialog-container{ + width:10% !important; +} + +//style="width: 100%" \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.spec.ts new file mode 100644 index 000000000..17284f6c0 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BranchDialogComponent } from './branch-dialog.component'; + +describe('BranchDialogComponent', () => { + let component: BranchDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BranchDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BranchDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.ts new file mode 100644 index 000000000..7e14e6d33 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.ts @@ -0,0 +1,86 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; +import { Branch,States,City } from '../../../model/branch'; +import { Observable } from 'rxjs/Observable';//for Datatables + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './branch-dialog.component.html', + styleUrls: ['./branch-dialog.component.scss'] +}) + +export class BranchDialogComponent implements OnInit { + + + public _branchForm: FormGroup; + + citydatas: City[]; + errorMessage:string; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _mastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: Branch) { } + + + ngOnInit() { + + this._branchForm = this._formBuilder.group({ + branch_id: [this.data.branch_id], + name: [this.data.name, Validators.compose([Validators.required])], + fk_city_id: [this.data.fk_city_id, Validators.compose([Validators.required])] + }); + //console.log(this._branchForm); + + this._mastersService.getAllMasterData('CITY') + .subscribe( + data => { + + if (data.status == 200) { + this.citydatas = data.records; + this.citydatas = this.citydatas.filter(city=>city.isactive == 1 ); + } + + }, error => this.errorMessage = error); + + } + + /** For Popup Close Button */ + onNoClick(): void { + this.dialogRef.close(); + } + + /** To Save/Edited Popup Data */ + onSubmit() { + + var BranchFormValues = this._branchForm.value; + + if(isNaN(this.data.branch_id)) { + + Object.keys(BranchFormValues) + .forEach((key) => ( BranchFormValues[key] == null) && delete BranchFormValues[key]); + //console.log(BranchFormValues); + this._mastersService.addMasterDetails(BranchFormValues,'BRANCH').subscribe(data=>{ + // alert(1); + // console.log(data); + this._mastersService.getAllBranch(); + + this.dialogRef.close(); + }); + // this.dialogRef.close(); + //alert("saved"); + } else { + this._mastersService.editMasterDetails(BranchFormValues,'BRANCH').subscribe(); + this.dialogRef.close(); + //alert("edited"); + } + } + + /** To Reset Popup Data */ + onReset(){ + this._branchForm.reset(); + } + +} diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html new file mode 100644 index 000000000..191e9093d --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html @@ -0,0 +1,84 @@ +
+
+ +
+
+ + +
+ + + +
+ +
+ + + + + Name + {{row.name}} + + + + City Name + {{row.cityname}} + + + + Is Active + {{row.isactive}} + + + + + + + + + + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.scss b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.scss new file mode 100644 index 000000000..dc7f5c405 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.scss @@ -0,0 +1,97 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/*** Structure * +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; +} + +.example-header { + min-height: 64px; + padding: 8px 24px 0; +}****/ + +/**mat-cell{ +.cell{ + display:flex !important; + justify-content:center!important; + +} + +// mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; +} + + +table { + width: 100%; +} + +th { + text-align: left; +} + +.button{ +padding-left: 6px; + font-size: 20px; +}**/ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.spec.ts new file mode 100644 index 000000000..207c3d979 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BranchListComponent } from './branch-list.component'; + +describe('BranchListComponent', () => { + let component: BranchListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BranchListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BranchListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts new file mode 100644 index 000000000..d5d503129 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts @@ -0,0 +1,118 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { MatDialog, + MatDialogRef, + MatDialogConfig, + MatPaginator, + MatSort, + MatTableDataSource } from '@angular/material'; + +import { Observable } from 'rxjs'; +import 'rxjs/add/operator/map'; +import { map } from 'rxjs/operators'; + +import { DataSource } from '@angular/cdk/table'; +import { of as observableOf, merge } from 'rxjs'; +// import { Bra } from './../branch-list'; +// BranchListComponent +import { MastersService } from '../../../../service/masters/masters.service'; +import { BranchDialogComponent } from '../branch-dialog/branch-dialog.component'; +import { Branch,States,City } from '../../../model/branch'; + +@Component({ + selector: 'app-branch-list', + templateUrl: './branch-list.component.html', + styleUrls: ['./branch-list.component.scss'] +}) +export class BranchListComponent implements OnInit { + + + isPopupOpened = true; + loader: boolean = false; + BranchList: any = []; + + + + userData = null; + + public dataLength: number; + public dataSource = new MatTableDataSource(); + // displayedColumns = ['name', 'email', 'phone', 'company']; + displayedColumns = ['name','cname', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + constructor(private dialog: MatDialog, + private _mastersService: MastersService) { + this._mastersService.getAllBranch().subscribe( + data => { + this.userData = data.records; + // alert(this.userData); + this.dataLength = data.records.length; + this.dataSource.data = this.userData; + } + ) + + + // this._mastersService.getAllBranch().subscribe(dataresult =>{ + // this.dataLength = dataresult.records.length; + // alert(this.dataLength); + + // this.dataSource = dataresult.records; + + // }) + } + + ngOnInit() { + // this.getBranch(); + } + + + + /**Popup for ADD Branch */ + addBranch() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(BranchDialogComponent, { + data: {} + }); + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + /** Popup for EDIT Branch */ + editBranch(arr: Branch[]) { + this.isPopupOpened = true; + + const dialogRef = this.dialog.open(BranchDialogComponent, { + data: arr + }); + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + + /** To delete Branch Datas */ + deleteBranch(id: number) { + var PrimaryKeyWithValue ={'branch_id':id}; + this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'BRANCH').subscribe(); + + } + + ngAfterViewInit() { + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + } + + applyFilter(filterValue: string) { + filterValue = filterValue.trim(); // Remove whitespace + filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches + this.dataSource.filter = filterValue; + } + + +} +/** To set the All Branch value as Data sources with help of connect() */ diff --git a/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html new file mode 100644 index 000000000..2fa6c31c2 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html @@ -0,0 +1,56 @@ + +
+
City
+
+
+
+ + +
+ +
+ + +
+ + + {{ sd.name }} + + You must Pickup State Name. + + +
+
+ + + You must include a Name. + + +
+ + +
+
+ + + +
+ +
+
+ +
diff --git a/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.spec.ts new file mode 100644 index 000000000..fbe710de2 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CityDialogComponent } from './city-dialog.component'; + +describe('CityDialogComponent', () => { + let component: CityDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CityDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CityDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.ts new file mode 100644 index 000000000..ecf386a07 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.ts @@ -0,0 +1,83 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { States } from '../../../model/states'; + +import { MastersService } from '../../../../service/masters/masters.service'; +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './city-dialog.component.html', + styleUrls: ['./city-dialog.component.scss'] +}) +export class CityDialogComponent implements OnInit { + + + public _cityForm: FormGroup; + + stateDatas: any[]; + errorMessage:string; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._cityForm = this._formBuilder.group({ + //City_id: any; fk_city_id: any; + + city_id: [this.data.city_id], + name: [this.data.name, Validators.compose([Validators.required])], + fk_state_id: [this.data.fk_state_id, Validators.compose([Validators.required])] + }); + //console.log(this._cityForm); + + this._MastersService.getAllMasterData('STATE') + .subscribe( + data => { + if (data.status == 200) { + this.stateDatas = data.records; + this.stateDatas = this.stateDatas.filter(city=>city.isactive == 1 ); + } + + }, error => this.errorMessage = error); + + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addCity(this._cityForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editCity(this._cityForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.city_id)) { + var my_array = this._cityForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'CITY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._cityForm.value,'CITY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._cityForm.reset(); + } +} diff --git a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html new file mode 100644 index 000000000..29e55065c --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html @@ -0,0 +1,76 @@ + +
+ +
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + +
#City NameState NameIsactiveAction
No Records
{{i+1}}{{CL.name}}{{CL.state_name}}{{CL.isactive}} + edit + delete_outline +
+
+ + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.scss b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.scss new file mode 100644 index 000000000..2724e14f3 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.scss @@ -0,0 +1,69 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ + table { + width: 100%; + } + + th { + text-align: left; + } + +.button{ + padding-left: 6px; + font-size: 20px; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.spec.ts new file mode 100644 index 000000000..8f3c58bae --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CityListComponent } from './city-list.component'; + +describe('CityListComponent', () => { + let component: CityListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CityListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CityListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts new file mode 100644 index 000000000..86ce0f917 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts @@ -0,0 +1,107 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { CityDialogComponent } from '../city-dialog/city-dialog.component'; +import { City } from '../../../model/city'; + +@Component({ + selector: 'app-city-list', + templateUrl: './city-list.component.html', + styleUrls: ['./city-list.component.scss'] +}) +export class CityListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + CityList: any = []; + + //, createdon, fk_createdby, updatedon, fk_updatedby, isactive + displayedColumns = ['city_id','name', 'fk_state_id','state_name' , 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get CityList() { + // return this._MastersService.getAllCity(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + this.getCity(); + } + + + addCity() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(CityDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editCity(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllCity().find(c => c.ID === id); + const dialogRef = this.dialog.open(CityDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getCity() { + this.loader = true; + this._MastersService.getAllCity().subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.CityList = dataresult.records; + } + }) + + } + + deleteCity(id: number) { + var PrimaryKeyWithValue ={'city_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'CITY'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._bs.getAllCity(); + return this._bs.getAllMasterData('CITY'); + } + disconnect() {} +} + diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html new file mode 100644 index 000000000..971efad8b --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html @@ -0,0 +1,42 @@ + +
+
Comment On Locality
+
+
+
+ + +
+ +
+ + +
+ + + You must include a Rating. + + +
+ +
+
+ + + +
+ +
+
+ +
+ diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.spec.ts new file mode 100644 index 000000000..ea650445a --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CommentsOnLocalityDialogComponent } from './comments-on-locality-dialog.component'; + +describe('CommentsOnLocalityDialogComponent', () => { + let component: CommentsOnLocalityDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CommentsOnLocalityDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CommentsOnLocalityDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.ts new file mode 100644 index 000000000..b083ce225 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.ts @@ -0,0 +1,58 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './comments-on-locality-dialog.component.html', + styleUrls: ['./comments-on-locality-dialog.component.scss'] +}) +export class CommentsOnLocalityDialogComponent implements OnInit { + + + public _CommentOnLocalityForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._CommentOnLocalityForm = this._formBuilder.group({ + //branch_id: any; fk_city_id: any; + comments_on_locality_id: [this.data.comments_on_locality_id], + rating: [this.data.rating, Validators.compose([Validators.required])], + }); + + } + + + onSubmit() { + if(isNaN(this.data.comments_on_locality_id)) { + var my_array = this._CommentOnLocalityForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'COMMENTSONLOCALITY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._CommentOnLocalityForm.value,'COMMENTSONLOCALITY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._CommentOnLocalityForm.reset(); + } +} diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html new file mode 100644 index 000000000..013d6dd64 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html @@ -0,0 +1,65 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + +
#Comments On Locality IdRatingIsActiveAction
No Records
{{i+1}}{{CLL.comments_on_locality_id}}{{CLL.rating}}{{CLL.isactive}} + edit + delete_outline +
+ +
+ + + + +
diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.scss b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.scss new file mode 100644 index 000000000..3b5b29164 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.scss @@ -0,0 +1,93 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } + diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.spec.ts new file mode 100644 index 000000000..81bfc8c38 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CommentsOnLocalityListComponent } from './comments-on-locality-list.component'; + +describe('CommentsOnLocalityListComponent', () => { + let component: CommentsOnLocalityListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CommentsOnLocalityListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CommentsOnLocalityListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts new file mode 100644 index 000000000..8125c217a --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts @@ -0,0 +1,107 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { CommentsOnLocalityDialogComponent } from '../comments-on-locality-dialog/comments-on-locality-dialog.component'; +import { CommentsOnLocality } from '../../../model/comments-on-locality'; + + +@Component({ + selector: 'app-comments-on-locality-list', + templateUrl: './comments-on-locality-list.component.html', + styleUrls: ['./comments-on-locality-list.component.scss'] +}) +export class CommentsOnLocalityListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + CommentsOnLocalityList: any = []; + + displayedColumns = ['comments_on_locality_id','rating','isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get CommentsOnLocalityList() { + // return this._MastersService.getAllCommentsOnLocality(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + this.getCommentsOnLocality(); + } + + + addCommentsOnLocality() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(CommentsOnLocalityDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editCommentsOnLocality(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllCommentsOnLocality().find(c => c.ID === id); + const dialogRef = this.dialog.open(CommentsOnLocalityDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getCommentsOnLocality() { + this.loader = true; + this._MastersService.getAllMasterData('COMMENTSONLOCALITY').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.CommentsOnLocalityList = dataresult.records; + } + }) + + } + + deleteCommentsOnLocality(id: number) { + var PrimaryKeyWithValue ={'comments_on_locality_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMMENTSONLOCALITY'); + //this._MastersService.deleteMasterDetails('',id,''); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._bs.getAllCommentsOnLocality(); + return this._bs.getAllMasterData('COMMENTSONLOCALITY'); + } + disconnect() {} +} diff --git a/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html new file mode 100644 index 000000000..0bec921c2 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html @@ -0,0 +1,114 @@ + + +
+
Company
+
+
+
+ + +
+ +
+ + +
+ + + You must include a Name. + +
+
+ + + You must include a addressline1. + + +
+
+ + + You must include a Name. + + +
+
+ + + You must include a Name. + + +
+ +
+ + + + + {{ cd.name }} + + You must include a City. + + +
+
+ + + pincode should be in 6 digit format + + + Your pincode must be at least 5 characters long. + Your pincode name cannot exceed 6 characters. + + +
+
+ + + {{ sd.name }} + + You must Pickup a State. + + +
+ + +
+ logo + + +
+ + +
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.spec.ts new file mode 100644 index 000000000..35920973c --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CompanyDialogComponent } from './company-dialog.component'; + +describe('CompanyDialogComponent', () => { + let component: CompanyDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CompanyDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CompanyDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.ts new file mode 100644 index 000000000..f793a0737 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.ts @@ -0,0 +1,113 @@ + +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +//import { CompanyService } from '../../../service/company.service'; +import { MastersService } from '../../../../service/masters/masters.service'; +import { FileUploader } from 'ng2-file-upload/ng2-file-upload'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './company-dialog.component.html', + styleUrls: ['./company-dialog.component.scss'] +}) +export class CompanyDialogComponent implements OnInit { + + + public _companyForm: FormGroup; + + stateDatas: any[]; + citydatas: any[]; + errorMessage:string; + files: File = null + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _masterService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._companyForm = this._formBuilder.group({ + //Company_id: any; fk_city_id: any; + // + company_id: [this.data.company_id], + name: [this.data.name, Validators.compose([Validators.required])], + addressline1: [this.data.addressline1, Validators.compose([Validators.required])], + addressline2: [this.data.addressline2, Validators.compose([Validators.required])], + addressline3: [this.data.addressline3, Validators.compose([Validators.required])], + city: [this.data.city, Validators.compose([Validators.required])], + state: [this.data.state, Validators.compose([Validators.required])], + pincode: [this.data.pincode, Validators.compose([Validators.required, Validators.minLength(5), Validators.maxLength(6)])], + logo : [this.data.logo] + }); + + this._masterService.getAllMasterData('STATE') + .subscribe( + data => { + if (data.status == 200) { + this.stateDatas = data.records; + this.stateDatas = this.stateDatas.filter(dataresult=>dataresult.isactive == 1 ); + } + + }, error => this.errorMessage = error); + + this._masterService.getAllMasterData('CITY') + .subscribe( + data => { + + this.citydatas = data.records; + this.citydatas = this.citydatas.filter(dataresult=>dataresult.isactive == 1 ); + + }, error => this.errorMessage = error); + + + } + onFileChange($event) { + //console.log($event.target.files[0]); + + //if($event.target.files[0] < 0 ){ + this.files = $event.target.files[0]; + //} + //console.log(this.files); + } + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._companyService.addCompany(this._companyForm.value); + // this.dialogRef.close(); + // } else { + // this._companyService.editCompany(this._companyForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if (this.files) { + this.data.logo = this.files; + } + if(isNaN(this.data.company_id)) { + var my_array = this._companyForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._masterService.addMasterDetails(my_array,'COMPANY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._masterService.editMasterDetails(this._companyForm.value,'COMPANY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._companyForm.reset(); + } +} diff --git a/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.html b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.html new file mode 100644 index 000000000..7a49c820e --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.html @@ -0,0 +1,100 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
#Company NameCompany CityCompany StateAction
No Records
{{i+1}}{{CL.name}}{{CL.city_name}}{{CL.state_name}} + edit + delete_outline +
+ +
+ + + + +
+ + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.scss b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.scss new file mode 100644 index 000000000..3b5b29164 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.scss @@ -0,0 +1,93 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } + diff --git a/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.spec.ts new file mode 100644 index 000000000..f9d0a5216 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CompanyListComponent } from './company-list.component'; + +describe('CompanyListComponent', () => { + let component: CompanyListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CompanyListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CompanyListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.ts b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.ts new file mode 100644 index 000000000..32d988545 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.ts @@ -0,0 +1,109 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { CompanyDialogComponent } from '../company-dialog/company-dialog.component'; +import { Company } from '../../../model/company'; +import { MastersService } from '../../../../service/masters/masters.service'; + + +@Component({ + selector: 'app-company-list', + templateUrl: './company-list.component.html', + styleUrls: ['./company-list.component.scss'] +}) +export class CompanyListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + CompanyList: any = []; + + //displayedColumns = ['Company_id', 'fk_city_id', 'name', 'createdon', 'fk_createdby', 'updatedon', 'fk_updatedby', 'isactive','actions']; + displayedColumns = ['company_id', 'name', 'addressline1', 'addressline2','addressline3', 'city', 'state','city_name', 'state_name', 'pincode', 'logo','action']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get CompanyList() { + // return this._MastersService.getAllCompany(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + this.getCompany(); + } + + + addCompany() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(CompanyDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editCompany(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllCompany().find(c => c.ID === id); + const dialogRef = this.dialog.open(CompanyDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getCompany() { + this.loader = true; + this._MastersService.getAllCompany().subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.CompanyList = dataresult.records; + } + }) + + } + + deleteCompany(id: number) { + var PrimaryKeyWithValue ={'company_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMPANY'); + //this._MastersService.deleteMasterDetails('company_id',id,'COMPANY'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllCompany(); + //return this._bs.getAllMasterData('COMPANY'); + } + disconnect() {} +} diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html new file mode 100644 index 000000000..f687d62b4 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html @@ -0,0 +1,43 @@ + +
+
Customer Behaviour
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+ + +
+
+ + + +
+ +
+
+ +
diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.spec.ts new file mode 100644 index 000000000..ab3715a4e --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CustomerBehaviourDialogComponent } from './customer-behaviour-dialog.component'; + +describe('CustomerBehaviourDialogComponent', () => { + let component: CustomerBehaviourDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CustomerBehaviourDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CustomerBehaviourDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.ts new file mode 100644 index 000000000..727c1e453 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.ts @@ -0,0 +1,68 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './customer-behaviour-dialog.component.html', + styleUrls: ['./customer-behaviour-dialog.component.scss'] +}) +export class CustomerBehaviourDialogComponent implements OnInit { + + public _customerBehaviourForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._customerBehaviourForm = this._formBuilder.group({ + //branch_id: any; fk_city_id: any; + customer_behaviour_id: [this.data.customer_behaviour_id], + description: [this.data.description, Validators.compose([Validators.required])] + + }); + //customer_behaviour_id, description, createdon, fk_createdby, updatedon, fk_updatedby, isactive + //console.log(this._customerBehaviourForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addBranch(this._customerBehaviourForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editBranch(this._customerBehaviourForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.customer_behaviour_id)) { + var my_array = this._customerBehaviourForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'CUSTOMERBEHAVIOUR').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._customerBehaviourForm.value,'CUSTOMERBEHAVIOUR').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._customerBehaviourForm.reset(); + } +} diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html new file mode 100644 index 000000000..2b7b90e58 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html @@ -0,0 +1,65 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + +
#CustomerBehaviour IDDescriptionIsActiveAction
No Records
{{i+1}}{{CBL.customer_behaviour_id}}{{CBL.description}}{{CBL.isactive}} + edit + delete_outline +
+ +
+ + + +
diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.scss b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.scss new file mode 100644 index 000000000..3b5b29164 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.scss @@ -0,0 +1,93 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } + diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.spec.ts new file mode 100644 index 000000000..594ef2329 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CustomerBehaviourListComponent } from './customer-behaviour-list.component'; + +describe('CustomerBehaviourListComponent', () => { + let component: CustomerBehaviourListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CustomerBehaviourListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CustomerBehaviourListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts new file mode 100644 index 000000000..be8148726 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts @@ -0,0 +1,108 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { CustomerBehaviourDialogComponent } from '../customer-behaviour-dialog/customer-behaviour-dialog.component'; +import { CustomerBehaviour } from '../../../model/customer-behaviour'; + + +@Component({ + selector: 'app-customer-behaviour-list', + templateUrl: './customer-behaviour-list.component.html', + styleUrls: ['./customer-behaviour-list.component.scss'] +}) +export class CustomerBehaviourListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + CustomerBehaviourList: any = []; + + displayedColumns = ['customer_behaviour_id', 'description', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get CustomerBehaviourList() { + // return this._MastersService.getAllCustomerBehaviour(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + this.getCustomerBehaviour(); + } + + + addCustomerBehaviour() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(CustomerBehaviourDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editCustomerBehaviour(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllCustomerBehaviour().find(c => c.ID === id); + const dialogRef = this.dialog.open(CustomerBehaviourDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getCustomerBehaviour() { + this.loader = true; + this._MastersService.getAllMasterData('CUSTOMERBEHAVIOUR').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.CustomerBehaviourList = dataresult.records; + } + }) + + } + + deleteCustomerBehaviour(id: number) { + var PrimaryKeyWithValue ={'customer_behaviour_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'CUSTOMERBEHAVIOUR'); + //this._MastersService.deleteMasterDetails('customer_behaviour_id',id,'CUSTOMERBEHAVIOUR'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._bs.getAllCustomerBehaviour(); + return this._bs.getAllMasterData('CUSTOMERBEHAVIOUR'); + } + disconnect() {} +} diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html new file mode 100644 index 000000000..e836328b1 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html @@ -0,0 +1,49 @@ + +
+
Customer Segment
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+ +
+ + + You must include a Abbrevation. + + +
+
+
+ + + +
+ +
+
+ +
diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.spec.ts new file mode 100644 index 000000000..7ca82c37c --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CustomerSegmentDialogComponent } from './customer-segment-dialog.component'; + +describe('CustomerSegmentDialogComponent', () => { + let component: CustomerSegmentDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CustomerSegmentDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CustomerSegmentDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.ts new file mode 100644 index 000000000..7d9ce0662 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.ts @@ -0,0 +1,74 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './customer-segment-dialog.component.html', + styleUrls: ['./customer-segment-dialog.component.scss'] +}) +export class CustomerSegmentDialogComponent implements OnInit { + + public _customerSegmentForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._customerSegmentForm = this._formBuilder.group({ + //CustomerSegment_id: any; fk_city_id: any; + customer_segment_id: [this.data.customer_segment_id], + name: [this.data.name, Validators.compose([Validators.required])], + abbr: [this.data.abbr, Validators.compose([Validators.required])] + }); + //console.log(this._customerSegmentForm); + //customer_segment_id, name, abbr, createdon, fk_createdby, updatedon, isactive, fk_updatedby + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addCustomerSegment(this._customerSegmentForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editCustomerSegment(this._customerSegmentForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.customer_segment_id)) { + var my_array = this._customerSegmentForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'CUSTOMERSEGMENT').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._customerSegmentForm.value,'CUSTOMERSEGMENT').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._customerSegmentForm.reset(); + } +} + + + + + + diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html new file mode 100644 index 000000000..e0632e646 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html @@ -0,0 +1,70 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
#CustomerSegment NameAbbrevationIsActiveAction
No Records
{{i+1}}{{CSL.name}}{{CSL.abbr}}{{CSL.isactive}} + edit + delete_outline +
+ +
+ + +
+ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.scss b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.scss new file mode 100644 index 000000000..3b5b29164 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.scss @@ -0,0 +1,93 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } + diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.spec.ts new file mode 100644 index 000000000..a8fc7b5fe --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CustomerSegmentListComponent } from './customer-segment-list.component'; + +describe('CustomerSegmentListComponent', () => { + let component: CustomerSegmentListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CustomerSegmentListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CustomerSegmentListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts new file mode 100644 index 000000000..29e7eb6d9 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts @@ -0,0 +1,107 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { CustomerSegmentDialogComponent } from '../customer-segment-dialog/customer-segment-dialog.component'; +import { CustomerSegment } from '../../../model/customer-segment'; + + +@Component({ + selector: 'app-customer-segment-list', + templateUrl: './customer-segment-list.component.html', + styleUrls: ['./customer-segment-list.component.scss'] +}) +export class CustomerSegmentListComponent implements OnInit { + isPopupOpened = true; + loader: boolean = false; + CustomerSegmentList: any = []; + + displayedColumns = ['customer_segment_id', 'abbr', 'name', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get CustomerSegmentList() { + // return this._MastersService.getAllCustomerSegment(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + this.getCustomerSegment(); + } + + + addCustomerSegment() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(CustomerSegmentDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editCustomerSegment(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllCustomerSegment().find(c => c.ID === id); + const dialogRef = this.dialog.open(CustomerSegmentDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getCustomerSegment() { + this.loader = true; + this._MastersService.getAllMasterData('CUSTOMERSEGMENT').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.CustomerSegmentList = dataresult.records; + } + }) + + } + + deleteCustomerSegment(id: number) { + var PrimaryKeyWithValue ={'customer_segment_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'CUSTOMERSEGMENT'); + //this._MastersService.deleteMasterDetails('customer_segment_id',id,'CUSTOMERSEGMENT'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._bs.getAllCustomerSegment(); + return this._bs.getAllMasterData('CUSTOMERSEGMENT'); + } + disconnect() {} +} diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html new file mode 100644 index 000000000..85dd5b0f5 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html @@ -0,0 +1,51 @@ + +
+
Designation
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+ + + +
+ + + You must include a Short Name. + + +
+
+
+ + + +
+ +
+
+ +
diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.spec.ts new file mode 100644 index 000000000..e49243a00 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DesignationDialogComponent } from './designation-dialog.component'; + +describe('DesignationDialogComponent', () => { + let component: DesignationDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DesignationDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DesignationDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.ts new file mode 100644 index 000000000..2331d93f3 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.ts @@ -0,0 +1,73 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + + +@Component({ + selector: 'app-designation-dialog', + templateUrl: './designation-dialog.component.html', + styleUrls: ['./designation-dialog.component.scss'] +}) +export class DesignationDialogComponent implements OnInit { + + public _designationForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._designationForm = this._formBuilder.group({ + //Designation_id: any; fk_city_id: any; + designation_id: [this.data.designation_id], + name: [this.data.name, Validators.compose([Validators.required])], + short_name: [this.data.short_name, Validators.compose([Validators.required])] + }); + //console.log(this._designationForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addDesignation(this._designationForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editDesignation(this._designationForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.designation_id)) { + var my_array = this._designationForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'DESIGNATION').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._designationForm.value,'DESIGNATION').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._designationForm.reset(); + } +} + + + + + + diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html new file mode 100644 index 000000000..b0d993ac2 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html @@ -0,0 +1,70 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + +
#Designation NameIsActiveAction
No Records
{{i+1}}{{DL.name}}{{DL.isactive}} + edit + delete_outline +
+ +
+ + + + +
diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.scss b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.scss new file mode 100644 index 000000000..3b5b29164 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.scss @@ -0,0 +1,93 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } + diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.spec.ts new file mode 100644 index 000000000..9911c6f26 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DesignationListComponent } from './designation-list.component'; + +describe('DesignationListComponent', () => { + let component: DesignationListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DesignationListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DesignationListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts new file mode 100644 index 000000000..2ab36b0cb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts @@ -0,0 +1,109 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { DesignationDialogComponent } from '../designation-dialog/designation-dialog.component'; +import { Designation } from '../../../model/designation'; + + +@Component({ + selector: 'app-designation-list', + templateUrl: './designation-list.component.html', + styleUrls: ['./designation-list.component.scss'] +}) +export class DesignationListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + DesignationList: any = []; + + displayedColumns = ['designation_id', 'name', 'short_name','isactive','actions']; + + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get DesignationList() { + // return this._MastersService.getAllDesignation(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + this.getDesignation(); + } + + + addDesignation() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(DesignationDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editDesignation(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllDesignation().find(c => c.ID === id); + const dialogRef = this.dialog.open(DesignationDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getDesignation() { + this.loader = true; + this._MastersService.getAllMasterData('DESIGNATION').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.DesignationList = dataresult.records; + } + }) + + } + + deleteDesignation(id: number) { + var PrimaryKeyWithValue ={'designation_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'DESIGNATION'); + // this._MastersService.deleteMasterDetails('designation_id',id,'DESIGNATION'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._bs.getAllDesignation(); + return this._bs.getAllMasterData('DESIGNATION'); + } + disconnect() {} +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html new file mode 100644 index 000000000..49ccbd2e1 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html @@ -0,0 +1,40 @@ + +
+
Frequency
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.spec.ts new file mode 100644 index 000000000..f691a3dea --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FrequencyDialogComponent } from './frequency-dialog.component'; + +describe('FrequencyDialogComponent', () => { + let component: FrequencyDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FrequencyDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FrequencyDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.ts new file mode 100644 index 000000000..e1358d77c --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.ts @@ -0,0 +1,64 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +import { MastersService } from '../../../../service/masters/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './frequency-dialog.component.html', + styleUrls: ['./frequency-dialog.component.scss'] +}) +export class FrequencyDialogComponent implements OnInit { + + + public _frequencyForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._frequencyForm = this._formBuilder.group({ + frequency_id: [this.data.frequency_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._frequencyForm); + } + + onSubmit() { + if(isNaN(this.data.frequency_id)) { + var my_array = this._frequencyForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'FREQUENCY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._MastersService.editMasterDetails( this._frequencyForm.value,'FREQUENCY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._contactService.addIndustryMaster(this._frequencyForm.value); + // this.dialogRef.close(); + // } else { + // this._contactService.editIndustryMaster(this._frequencyForm.value); + // this.dialogRef.close(); + // } + // } + + onReset(){ + this._frequencyForm.reset(); + } +} + diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html new file mode 100644 index 000000000..f3004e09b --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html @@ -0,0 +1,79 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + +
#Frequency NameIsActiveAction
No Records
{{i+1}}{{FL.name}}{{FL.isactive}} + edit + delete_outline +
+ +
+ + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.scss b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.scss new file mode 100644 index 000000000..af46dbc43 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.scss @@ -0,0 +1,122 @@ +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + }*/ + + // + + + + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; +} + +.example-header { + min-height: 64px; + padding: 8px 24px 0; +} + +//mat-cell{ +.cell{ + display:flex !important; + justify-content:center!important; + +} + +// mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; +} + + +table { + width: 100%; +} + +th { + text-align: left; +} + diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.spec.ts new file mode 100644 index 000000000..2b7cbc2ab --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FrequencyListComponent } from './frequency-list.component'; + +describe('FrequencyListComponent', () => { + let component: FrequencyListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FrequencyListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FrequencyListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts new file mode 100644 index 000000000..f623b76e0 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts @@ -0,0 +1,110 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { FrequencyDialogComponent }from '../frequency-dialog/frequency-dialog.component'; +import { Frequency } from '../../../model/frequency'; + + +@Component({ + selector: 'app-frequency-list', + templateUrl: './frequency-list.component.html', + styleUrls: ['./frequency-list.component.scss'] +}) +export class FrequencyListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + FrequencyList: any = []; + + displayedColumns = ['frequency_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get FrequencyList() { + // return this._MastersService. getAllFrequency(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + this.getFrequency(); + } + + + addFrequency() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(FrequencyDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editFrequency(arr: any) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllFrequency().find(c => c.ID === id); + const dialogRef = this.dialog.open(FrequencyDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getFrequency() { + this.loader = true; + this._MastersService.getAllMasterData('FREQUENCY').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.FrequencyList = dataresult.records; + } + }) + + } + + deleteFrequency(id: number) { + var PrimaryKeyWithValue ={'frequency_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'FREQUENCY'); + // this._MastersService.deleteMasterDetails('designation_id',id,'DESIGNATION'); + + //this._MastersService.deleteMasterDetails('frequency_id',id,'FREQUENCY'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _fs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._fs.getAllFrequency(); + return this._fs.getAllMasterData('FREQUENCY'); + } + disconnect() {} +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html new file mode 100644 index 000000000..c358d229c --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html @@ -0,0 +1,42 @@ + +
+
Industry Classification
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Classified Name. + + +
+
+
+ + + + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.spec.ts new file mode 100644 index 000000000..1a9feee41 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { IndustryMasterDialogComponent } from './industry-master-dialog.component'; + +describe('IndustryMasterDialogComponent ', () => { + let component: IndustryMasterDialogComponent ; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ IndustryMasterDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(IndustryMasterDialogComponent ); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.ts new file mode 100644 index 000000000..419896cd3 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.ts @@ -0,0 +1,64 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './industry_classification-dialog.component.html', + styleUrls: ['./industry_classification-dialog.component.scss'] +}) +export class IndustryClassificationDialogComponent implements OnInit { + + public _IndustryClassificationForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _contactService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._IndustryClassificationForm = this._formBuilder.group({ + industry_classification_id: [this.data.industry_classification_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._IndustryClassificationForm); + //industry_classification_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._contactService.addIndustryClassification(this._IndustryClassificationForm.value); + // this.dialogRef.close(); + // } else { + // this._contactService.editIndustryClassification(this._IndustryClassificationForm.value); + // this.dialogRef.close(); + // } + // } + + + onSubmit() { + if(isNaN(this.data.industry_classification_id)) { + var my_array = this._IndustryClassificationForm.value; + Object.keys(my_array).forEach((key) => (my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._contactService.addMasterDetails(my_array,'INDUSTRYCLASSIFICATION').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._contactService.editMasterDetails(this._IndustryClassificationForm.value,'INDUSTRYCLASSIFICATION').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + onReset(){ + this._IndustryClassificationForm.reset(); + } +} diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html new file mode 100644 index 000000000..eee766509 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html @@ -0,0 +1,79 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
#Classification NameIsActiveAction
No Records
{{i+1}}{{IM.name}}{{IM.isactive}} + edit + delete_outline +
+ +
+ + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.scss b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.scss new file mode 100644 index 000000000..49827ebf1 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.scss @@ -0,0 +1,118 @@ +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + }*/ + + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; +} + +.example-header { + min-height: 64px; + padding: 8px 24px 0; +} + +//mat-cell{ +.cell{ + display:flex !important; + justify-content:center!important; + +} + +// mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; +} + + +table { + width: 100%; +} + +th { + text-align: left; +} + diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.spec.ts new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.ts b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.ts new file mode 100644 index 000000000..18e27206d --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.ts @@ -0,0 +1,126 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { IndustryClassificationDialogComponent } from '../industry_classification-dialog/industry_classification-dialog.component'; +import { IndustryClassification } from '../../../model/industry_classification'; + +@Component({ + selector: 'app-industry_classification-list', + templateUrl: './industry_classification-list.component.html', + styleUrls: ['./industry_classification-list.component.scss'] +}) + + +// export class TablePagingComponent implements OnInit { + +// } + +export class IndustryClassificationListComponent implements OnInit { + + + isPopupOpened = true; + loader: boolean = false; + IndustryClassificationList: any = []; + + + displayedColumns = ['industry_classification_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + //industry_classification_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _IMService: MastersService) { } + + // get IndustryClassificationList() { + // return this._IMService.getAllIndustryClassification(); + // } + + //displayedColumns: string[] = ['ID','ClassifiedName']; + dataSource = new UserDataSource(this._IMService); + + + ngOnInit() { + this.getIndustryClassification(); + } + + + addIndustryClassification() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(IndustryClassificationDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editIndustryClassification(arr: any) { + this.isPopupOpened = true; + //const indu = this._IMService.getAllIndustryClassification().find(c => c.ID === id); + const dialogRef = this.dialog.open(IndustryClassificationDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getIndustryClassification() { + this.loader = true; + this._IMService.getAllMasterData('INDUSTRYCLASSIFICATION').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.IndustryClassificationList = dataresult.records; + } + else{ + this.IndustryClassificationList = []; + } + }) + + } + + + deleteIndustryClassification(id: number) { + var PrimaryKeyWithValue ={'industry_classification_id':id}; + console.log('PrimaryKeyWithValue',PrimaryKeyWithValue); + console.log('id',id); + this._IMService.deleteMasterDetails(PrimaryKeyWithValue,'INDUSTRYCLASSIFICATION'); + //this._IMService.deleteMasterDetails('industry_classification_id',id,'INDUSTRYCLASSIFICATION'); + } + +} + + + +export class UserDataSource extends DataSource { + + constructor(private _ims: MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._ims.getAllIndustryClassification(); + return this._ims.getAllMasterData('INDUSTRYCLASSIFICATION'); + } + disconnect() {} +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html new file mode 100644 index 000000000..556e1957e --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html @@ -0,0 +1,39 @@ + +
+
Lender Hierarchy
+
+
+
+ + +
+ +
+ + +
+ + + You must include a Lender Hierarchy Name. + + +
+
+
+ + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.spec.ts new file mode 100644 index 000000000..fec89337c --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LenderHierarchyDialogComponent } from './lender-hierarchy-dialog.component'; + +describe('LenderHierarchyDialogComponent', () => { + let component: LenderHierarchyDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LenderHierarchyDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LenderHierarchyDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.ts new file mode 100644 index 000000000..9255f0b89 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.ts @@ -0,0 +1,73 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './lender-hierarchy-dialog.component.html', + styleUrls: ['./lender-hierarchy-dialog.component.scss'] +}) +export class LenderHierarchyDialogComponent implements OnInit { + + public _lenderHierarchyForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._lenderHierarchyForm = this._formBuilder.group({ + //Designation_id: any; fk_city_id: any; + + lender_hierarchy_id: [this.data.lender_hierarchy_id], + lender_hierarchy: [this.data.lender_hierarchy, Validators.compose([Validators.required])], + + }); + //console.log(this._lenderHierarchyForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addDesignation(this._lenderHierarchyForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editDesignation(this._lenderHierarchyForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.lender_hierarchy_id)) { + var my_array = this._lenderHierarchyForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'LENDERHIERARCHY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._lenderHierarchyForm.value,'LENDERHIERARCHY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._lenderHierarchyForm.reset(); + } +} + + + + + + diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.html b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.html new file mode 100644 index 000000000..d853be328 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.html @@ -0,0 +1,64 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + +
#Lender Hierarchy NameIsActiveAction
No Records
{{i+1}}{{LHL.lender_hierarchy}} {{LHL.isactive}} + edit + delete_outline +
+ +
+ + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.scss b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.scss new file mode 100644 index 000000000..3b5b29164 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.scss @@ -0,0 +1,93 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } + diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.spec.ts new file mode 100644 index 000000000..7310059fb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LenderHierarchyListComponent } from './lender-hierarchy-list.component'; + +describe('LenderHierarchyListComponent', () => { + let component: LenderHierarchyListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LenderHierarchyListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LenderHierarchyListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts new file mode 100644 index 000000000..79b1adc79 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts @@ -0,0 +1,108 @@ + +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + +import { MastersService } from '../../../../service/masters/masters.service'; +import { LenderHierarchyDialogComponent }from '../lender-hierarchy-dialog/lender-hierarchy-dialog.component'; +import { LenderHierarchy } from '../../../model/lender-hierarchy'; + + +@Component({ + selector: 'app-lender-hierarchy-list', + templateUrl: './lender-hierarchy-list.component.html', + styleUrls: ['./lender-hierarchy-list.component.scss'] +}) +export class LenderHierarchyListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + LenderHierarchyList: any = []; + + displayedColumns = ['lender_hierarchy_id', 'lender_hierarchy','isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get LenderHierarchyList() { + // return this._MastersService. getAllLenderHierarchy(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + this.getLenderHierarchy(); + } + + + addLenderHierarchy() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(LenderHierarchyDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editLenderHierarchy(arr: any) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllLenderHierarchy().find(c => c.ID === id); + const dialogRef = this.dialog.open(LenderHierarchyDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getLenderHierarchy() { + this.loader = true; + this._MastersService.getAllMasterData('LENDERHIERARCHY').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.LenderHierarchyList = dataresult.records; + } + }) + + } + + deleteLenderHierarchy(id: number) { + var PrimaryKeyWithValue ={'lender_hierarchy_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'LENDERHIERARCHY'); + //this._MastersService.deleteMasterDetails('lender_hierarchy_id',id,'LENDERHIERARCHY'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _fs: MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._fs.getAllLenderHierarchy(); + return this._fs.getAllMasterData('LENDERHIERARCHY'); + } + disconnect() {} +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html new file mode 100644 index 000000000..db0003168 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html @@ -0,0 +1,41 @@ + +
+
Occupation of Non earning members
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.spec.ts new file mode 100644 index 000000000..2d3a7b44d --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MembersOccupationDialogComponent } from './members-occupation-dialog.component'; + +describe('MembersOccupationDialogComponent', () => { + let component: MembersOccupationDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MembersOccupationDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MembersOccupationDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.ts new file mode 100644 index 000000000..d5e63ea9f --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.ts @@ -0,0 +1,63 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './members-occupation-dialog.component.html', + styleUrls: ['./members-occupation-dialog.component.scss'] +}) +export class MembersOccupationDialogComponent implements OnInit { + + + public _occupationForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _memberService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._occupationForm = this._formBuilder.group({ + occupation_non_earning_member_id: [this.data.occupation_non_earning_member_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._occupationForm); + } + + onSubmit() { + if(isNaN(this.data.occupation_non_earning_member_id)) { + var my_array = this._occupationForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._memberService.addMasterDetails(my_array,'OCCUPATIONMEMBERS').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._memberService.editMasterDetails(this._occupationForm.value,'OCCUPATIONMEMBERS').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._memberService.addMembersOccupation(this._occupationForm.value); + // this.dialogRef.close(); + // } else { + // this._memberService.editMembersOccupation(this._occupationForm.value); + // this.dialogRef.close(); + // } + // } + + onReset(){ + this._occupationForm.reset(); + } +} + diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html new file mode 100644 index 000000000..f3ec2f194 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html @@ -0,0 +1,84 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + +
#Occupation NameIsActiveAction
No Records
{{i+1}}{{ML.name}}{{ML.isactive}} + edit + delete_outline +
+ +
+ + + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.scss b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.scss new file mode 100644 index 000000000..e29cae6e3 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.scss @@ -0,0 +1,59 @@ +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + }*/ + + .example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.spec.ts new file mode 100644 index 000000000..6df9db6d5 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MembersOccupationListComponent } from './members-occupation-list.component'; + +describe('MembersOccupationListComponent', () => { + let component: MembersOccupationListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MembersOccupationListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MembersOccupationListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts new file mode 100644 index 000000000..c1c667ce9 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts @@ -0,0 +1,111 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { MembersOccupationDialogComponent } from '../members-occupation-dialog/members-occupation-dialog.component'; +import { MembersOccupation } from '../../../model/members-occupation'; + + +@Component({ + selector: 'app-members-occupation-list', + templateUrl: './members-occupation-list.component.html', + styleUrls: ['./members-occupation-list.component.scss'] +}) +export class MembersOccupationListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + MemberOccupationList: any = []; + + + displayedColumns = ['occupation_non_earning_member_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + //occupation_non_earning_member_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _memberService: MastersService) { } + + // get MemberOccupationList() { + // return this._memberService.getAllMembersOccupation(); + // } + + ngOnInit() { + this.getMemberOccupation(); + } + + dataSource = new UserDataSource(this._memberService); + + addMemberOccupation() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(MembersOccupationDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editMemberOccupation(arr : any) { + this.isPopupOpened = true; + //const contact = this._memberService.getAllMembersOccupation().find(c => c.ID === id); + const dialogRef = this.dialog.open(MembersOccupationDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getMemberOccupation() { + this.loader = true; + this._memberService.getAllMasterData('OCCUPATIONMEMBERS').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.MemberOccupationList = dataresult.records; + } + }) + + } + + + deleteMemberOccupation(id: number) { + var PrimaryKeyWithValue ={'occupation_non_earning_member_id':id}; + this._memberService.deleteMasterDetails(PrimaryKeyWithValue,'OCCUPATIONMEMBERS'); + //this._memberService.deleteMasterDetails('occupation_non_earning_member_id',id,'OCCUPATIONMEMBERS'); + } +} + + + +export class UserDataSource extends DataSource { + + constructor(private _mos:MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._mos.getAllMembersOccupation(); + return this._mos.getAllMasterData('OCCUPATIONMEMBERS'); + } + disconnect() {} +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.html b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.html new file mode 100644 index 000000000..05f46c8c2 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.html @@ -0,0 +1,40 @@ + + +
+
PD Allocation Type
+
+
+
+ +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.spec.ts new file mode 100644 index 000000000..a98fc3331 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdAllocationTypeDialogComponent } from './pd-allocation-type-dialog.component'; + +describe('PdAllocationTypeDialogComponent', () => { + let component: PdAllocationTypeDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdAllocationTypeDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdAllocationTypeDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.ts new file mode 100644 index 000000000..404c9f036 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component.ts @@ -0,0 +1,73 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './pd-allocation-type-dialog.component.html', + styleUrls: ['./pd-allocation-type-dialog.component.scss'] +}) +export class PdAllocationTypeDialogComponent implements OnInit { + + + + public _PDAllocationTypeForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _pds: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._PDAllocationTypeForm = this._formBuilder.group({ + pd_allocation_type_id: [this.data.pd_allocation_type_id], + pd_allocation_type_name: [this.data.pd_allocation_type_name, Validators.compose([Validators.required])] + }); + //pd_allocation_type_id, pd_allocation_type_name, createdon, fk_createdby, updatedon, isactive + //console.log(this._PDAllocationTypeForm); + } + + onSubmit() { + if(isNaN(this.data.pd_allocation_type_id)) { + var my_array = this._PDAllocationTypeForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._pds.addMasterDetails(my_array,'PDALLOCATIONTYPE').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._pds.editMasterDetails(this._PDAllocationTypeForm.value,'PDALLOCATIONTYPE').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._memberService.addMembersOccupation(this._PDAllocationTypeForm.value); + // this.dialogRef.close(); + // } else { + // this._memberService.editMembersOccupation(this._PDAllocationTypeForm.value); + // this.dialogRef.close(); + // } + // } + + onReset(){ + this._PDAllocationTypeForm.reset(); + } +} + + + + + + + + + diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html new file mode 100644 index 000000000..8db1d6b0b --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html @@ -0,0 +1,64 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + +
#PD Allocation Type NameIsactiveAction
No Records
{{i+1}}{{PAT.pd_allocation_type_name}}{{PAT.isactive}} + edit + delete_outline +
+ +
+ + + +
+ + +
diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss new file mode 100644 index 000000000..3b5b29164 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss @@ -0,0 +1,93 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } + diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.spec.ts new file mode 100644 index 000000000..22d79c3df --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdAllocationTypeListComponent } from './pd-allocation-type-list.component'; + +describe('PdAllocationTypeListComponent', () => { + let component: PdAllocationTypeListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdAllocationTypeListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdAllocationTypeListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.ts new file mode 100644 index 000000000..ff9001407 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.ts @@ -0,0 +1,109 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { PdAllocationTypeDialogComponent } from '../pd-allocation-type-dialog/pd-allocation-type-dialog.component'; +import { PdAllocationType } from '../../../model/pd'; + + +@Component({ + selector: 'app-pd-allocation-type-list', + templateUrl: './pd-allocation-type-list.component.html', + styleUrls: ['./pd-allocation-type-list.component.scss'] +}) +export class PdAllocationTypeListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + PDAllocationTypeList: any = []; + + displayedColumns = ['pd_allocation_type_id','pd_allocation_type_name','isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get PDAllocationTypeList() { + // return this._MastersService.getAllPDAllocationType(); + // } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + this.getPDAllocationType(); + } + + + addPDAllocationType() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(PdAllocationTypeDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editPDAllocationType(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllPDAllocationType().find(c => c.ID === id); + const dialogRef = this.dialog.open(PdAllocationTypeDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getPDAllocationType() { + this.loader = true; + this._MastersService.getAllMasterData('PDALLOCATIONTYPE').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.PDAllocationTypeList = dataresult.records; + } + }) + + } + + deletePDAllocationType(id: number) { + var PrimaryKeyWithValue ={'pd_allocation_type_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'PDALLOCATIONTYPE'); + //this._MastersService.deleteMasterDetails('pd_allocation_type_id',id,'PDALLOCATIONTYPE'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._bs.getAllPDAllocationType(); + return this._bs.getAllMasterData('PDALLOCATIONTYPE'); + } + disconnect() {} +} + diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.html b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.html new file mode 100644 index 000000000..04bcbc70b --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.html @@ -0,0 +1,42 @@ + +
+
PD Location Approach
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Description. + + +
+ +
+
+ + + +
+ +
+
+ +
diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.spec.ts new file mode 100644 index 000000000..c3e59ee70 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdLocationApproachDialogComponent } from './pd-location-approach-dialog.component'; + +describe('PdLocationApproachDialogComponent', () => { + let component: PdLocationApproachDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdLocationApproachDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdLocationApproachDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.ts new file mode 100644 index 000000000..7a3d05bb2 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.ts @@ -0,0 +1,75 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './pd-location-approach-dialog.component.html', + styleUrls: ['./pd-location-approach-dialog.component.scss'] +}) +export class PdLocationApproachDialogComponent implements OnInit { + + public _pdLocationApproachForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + //pd_location_approach_id, description, createdon, fk_createdby, updatedon, fk_updatedby, isactive + ngOnInit() { + + this._pdLocationApproachForm = this._formBuilder.group({ + //branch_id: any; fk_city_id: any; + pd_location_approach_id: [this.data.pd_location_approach_id], + description: [this.data.description, Validators.compose([Validators.required])] + }); + //console.log(this._pdLocationApproachForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addBranch(this._pdLocationApproachForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editBranch(this._pdLocationApproachForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.pd_location_approach_id)) { + var my_array = this._pdLocationApproachForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'PDLOCATIONAPPROACH').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._pdLocationApproachForm.value,'PDLOCATIONAPPROACH').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._pdLocationApproachForm.reset(); + } +} + + + + + + + + + + diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.html b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.html new file mode 100644 index 000000000..cabf987af --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.html @@ -0,0 +1,67 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + +
#NameIsactiveAction
No Records
{{i+1}}{{PAL.pd_location_approach_id}} {{PAL.description}}{{PAL.isactive}} + edit + delete_outline + +
+ +
+ + + + +
diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.scss b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.scss new file mode 100644 index 000000000..3b5b29164 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.scss @@ -0,0 +1,93 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } + diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.spec.ts new file mode 100644 index 000000000..34c33f238 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdLocationApproachListComponent } from './pd-location-approach-list.component'; + +describe('PdLocationApproachListComponent', () => { + let component: PdLocationApproachListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdLocationApproachListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdLocationApproachListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.ts new file mode 100644 index 000000000..b3c8b4c52 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.ts @@ -0,0 +1,112 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { PdLocationApproachDialogComponent } from '../pd-location-approach-dialog/pd-location-approach-dialog.component'; +import { PdLocationApproach } from '../../../model/pd'; + + +@Component({ + selector: 'app-pd-location-approach-list', + templateUrl: './pd-location-approach-list.component.html', + styleUrls: ['./pd-location-approach-list.component.scss'] +}) +export class PdLocationApproachListComponent implements OnInit { + + + isPopupOpened = true; + loader: boolean = false; + PdLocationApproachList: any = []; + + displayedColumns = ['pd_allocation_type_id', 'pd_allocation_type_name', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get PdLocationApproachList() { + // return this._MastersService.getAllPdLocationApproach(); + // } + + //dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + this.getPdLocationApproach(); + } + + + addPdLocationApproach() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(PdLocationApproachDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editPdLocationApproach(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllPdLocationApproach().find(c => c.ID === id); + const dialogRef = this.dialog.open(PdLocationApproachDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getPdLocationApproach() { + this.loader = true; + this._MastersService.getAllMasterData('PDLOCATIONAPPROACH').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.PdLocationApproachList = dataresult.records; + } + }) + + } + + deletePdLocationApproach(id: number) { + var PrimaryKeyWithValue ={'pd_allocation_type_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'PDLOCATIONAPPROACH'); + //this._MastersService.deleteMasterDetails('pd_allocation_type_id',id,'PDLOCATIONAPPROACH'); + } + //sdffsadfasf +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._bs.getAllPDLocationApproach(); + return this._bs.getAllMasterData('PDLOCATIONAPPROACH'); + } + disconnect() {} +} + + diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.html b/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.html new file mode 100644 index 000000000..fa7937d52 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.html @@ -0,0 +1,43 @@ + +
+
PD type
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a type_name. + + +
+ +
+
+ + + +
+ +
+
+ +
+ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.spec.ts new file mode 100644 index 000000000..ec0f1b7bb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdTypeDialogComponent } from './pd-type-dialog.component'; + +describe('PdTypeDialogComponent', () => { + let component: PdTypeDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdTypeDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdTypeDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.ts new file mode 100644 index 000000000..19e610190 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.ts @@ -0,0 +1,65 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './pd-type-dialog.component.html', + styleUrls: ['./pd-type-dialog.component.scss'] +}) +export class PdTypeDialogComponent implements OnInit { + + public _pdTypeForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _pdTypeService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._pdTypeForm = this._formBuilder.group({ + //branch_id: any; fk_city_id: any;pd_type_id, type_name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + pd_type_id: [this.data.pd_type_id], + type_name: [this.data.type_name, Validators.compose([Validators.required])] + }); + //console.log(this._pdTypeForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._pdTypeService.addBranch(this._pdTypeForm.value); + // this.dialogRef.close(); + // } else { + // this._pdTypeService.editBranch(this._pdTypeForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.pd_type_id)) { + var my_array = this._pdTypeForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._pdTypeService.addMasterDetails(my_array,'PDTYPE').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._pdTypeService.editMasterDetails(this._pdTypeForm.value,'PDTYPE').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._pdTypeForm.reset(); + } +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.html b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.html new file mode 100644 index 000000000..abbf22efa --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.html @@ -0,0 +1,64 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + +
S.noPDType NamePDType City NameAction
No Records
{{i+1}}{{BL.type_name}}{{BL.isactive}} + edit + delete_outline +
+ +
+ + + +
+ + +
diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.scss b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.scss new file mode 100644 index 000000000..3b5b29164 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.scss @@ -0,0 +1,93 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } + diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.spec.ts new file mode 100644 index 000000000..32f21fbf2 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdTypeListComponent } from './pd-type-list.component'; + +describe('PdTypeListComponent', () => { + let component: PdTypeListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdTypeListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdTypeListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.ts new file mode 100644 index 000000000..a8047e81b --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.ts @@ -0,0 +1,111 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { PdTypeDialogComponent } from '../pd-type-dialog/pd-type-dialog.component'; +import { PdType } from '../../../model/pd'; + + +@Component({ + selector: 'app-pd-type-list', + templateUrl: './pd-type-list.component.html', + styleUrls: ['./pd-type-list.component.scss'] +}) +export class PdTypeListComponent implements OnInit { + + + isPopupOpened = true; + loader: boolean = false; + PDTypeList: any = []; + + displayedColumns = ['pd_type_id', 'type_name', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _PDTypeService: MastersService) { } + + // get PDTypeList() { + // return this._PDTypeService.getAllPDType(); + // } + + dataSource = new UserDataSource(this._PDTypeService); + + ngOnInit() { + this.getPDType(); + } + + + addPDType() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(PdTypeDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editPDType(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._PDTypeService.getAllPDType().find(c => c.ID === id); + const dialogRef = this.dialog.open(PdTypeDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getPDType() { + this.loader = true; + this._PDTypeService.getAllMasterData('PDTYPE').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.PDTypeList = dataresult.records; + } + }) + + } + + deletePDType(id: number) { + var PrimaryKeyWithValue ={'pd_type_id':id}; + this._PDTypeService.deleteMasterDetails(PrimaryKeyWithValue,'PDTYPE'); + //this._PDTypeService.deleteMasterDetails('pd_type_id',id,'PDTYPE'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._bs.getAllPDType(); + return this._bs.getAllMasterData('PDTYPE'); + } + disconnect() {} +} + + diff --git a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html new file mode 100644 index 000000000..cc75e2f49 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html @@ -0,0 +1,46 @@ + +
+
Product Details
+
+
+
+ + +
+ +
+ + +
+ + + You must include a Product name. + + +
+ +
+ + + + You must include a Product abbrevation. +
+ +
+ + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.scss new file mode 100644 index 000000000..f5c65c46d --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.scss @@ -0,0 +1,8 @@ + + table { + width: 100%; + } + + mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.spec.ts new file mode 100644 index 000000000..d79e7b4bc --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProductDialogComponent } from './product-dialog.component'; + +describe('ProductDialogComponent', () => { + let component: ProductDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ProductDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProductDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.ts new file mode 100644 index 000000000..ce333299a --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.ts @@ -0,0 +1,55 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './product-dialog.component.html', + styleUrls: ['./product-dialog.component.scss'] +}) + +export class ProductDialogComponent implements OnInit { + + public _productMasterForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._productMasterForm = this._formBuilder.group({ + //ID: [this.data.ID], + product_id: [this.data.product_id], + name: [this.data.name, Validators.compose([Validators.required])], + abbr: [this.data.abbr, Validators.compose([Validators.required])] + }); + console.log(this._productMasterForm); + } + + onSubmit() { + if(isNaN(this.data.product_id)) { + + var my_array = this._productMasterForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + //this._MastersService.addProductMaster(this._productMasterForm.value); + //this._MastersService.addProd(this._productMasterForm.value).subscribe(data=>this.array=data); + this._MastersService.addMasterDetails(my_array,'PRODUCTS').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + //this._MastersService.editProductMaster(this._productMasterForm.value); + this._MastersService.editMasterDetails(this._productMasterForm.value,'PRODUCTS').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html new file mode 100644 index 000000000..b30403538 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html @@ -0,0 +1,309 @@ + +
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
No. {{element.ID}} Name {{element.ProductName}} ProductAbbr {{element.ProductAbbr}}
+ + +
+ + + + + + +
+ + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
#Product NameProduct AbbreviationIs ActvieAction
No Records
{{i+1}}{{PM.name}}{{PM.abbr}}{{PM.isactive}} + + edit + delete_outline +
+ +
+
+ + + + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.scss b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.scss new file mode 100644 index 000000000..71f5d6a9d --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.scss @@ -0,0 +1,92 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.spec.ts new file mode 100644 index 000000000..a2c901bdd --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProductListComponent } from './product-list.component'; + +describe('ProductListComponent', () => { + let component: ProductListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ProductListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProductListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts new file mode 100644 index 000000000..3bdb9ec0c --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts @@ -0,0 +1,159 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { MastersService } from '../../../../service/masters/masters.service'; +import { ProductDialogComponent } from '../product-dialog/product-dialog.component'; +import { ProductMaster } from '../../../model/product-master'; +//import { DataSource } from '@angular/cdk/table'; +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +//import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + +@Component({ + selector: 'app-product-list', + templateUrl: './product-list.component.html', + styleUrls: ['./product-list.component.scss'] +}) +export class ProductListComponent implements OnInit { + + //Variable Declaration part + isPopupOpened: boolean = true; + loader: boolean = false; + ProductMasterList: any = []; + + + //For Data Table + //displayedColumns = ['product_id','name','abbr','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + + + //dataSource = new UserDataSource(this._ProductService); + + displayedColumns: string[] = ['ID','ProductName','ProductAbbr']; + dataSource = new MatTableDataSource(ELEMENT_DATA1); + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + //Onready function + ngOnInit() { + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + this.getProductMaster(); + } + + applyFilter(filterValue: string) { + this.dataSource.filter = filterValue.trim().toLowerCase(); + } + + constructor(private dialog: MatDialog, + private _ProductService: MastersService) {} + + //To open dialog for add the data + addProductMaster() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(ProductDialogComponent, { + data: {} + }); + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To open dialog for edit the data + editProductMaster(arr: any[]) { + //alert(arr); + console.log(arr); + this.isPopupOpened = true; + //const contact = this._ProductService.getAllProductMaster().find(c => c.ID === id); + // let contact = this._ProductService.getProd().map(res=>res.filter(data =>data.product_id == id))[0]; + // console.log(contact); + + const dialogRef = this.dialog.open(ProductDialogComponent, { + data: arr + }); + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getProductMaster() { + this.loader = true; + this._ProductService.getAllMasterData('PRODUCTS').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.ProductMasterList = dataresult.records; + } + }) + + } + + //To inactive the data + deleteProductMaster(id: number) { + console.log('Deleted ID in List Component',id) + //this._ProductService.deleteProductMaster(id); + var PrimaryKeyWithValue ={'product_id':id}; + this._ProductService.deleteMasterDetails(PrimaryKeyWithValue,'PRODUCTS'); + //this._ProductService.deleteMasterDetails('product_id',id,'PRODUCTS').subscribe(); + //this._ProductService.deleteProductMaster(id); + } + +} + + +// export class UserDataSource extends DataSource { + +// // paginator: MatPaginator; +// // sort: MatSort; + +// constructor(private _ps:MastersService) { +// super(); +// } + +// // connect(): Observable { +// // //return this.userService.getUser(); +// // let productData; +// // this._ps.getAllMasterData('PRODUCTS').subscribe(data=>{ +// // productData = data.records; +// // //return productData; +// // }); +// // return productData; +// // } + + +// // public getdata(){ +// // this._ps.getAllMasterData('PRODUCTS') +// // .subscribe(dataresult => dataresult.status ); +// // } + +// connect(): Observable { +// //return this.userService.getUser(); +// return this._ps.getAllMasterData('PRODUCTS'); +// } + +// disconnect() {} +// } + +export interface ProductElement { + ProductName: string; + ID: number; + ProductAbbr: string; +} + +const ELEMENT_DATA1: ProductElement[] = [ + {ID: 1, ProductName: 'Home Loan',ProductAbbr: 'HL'}, + {ID: 2, ProductName: 'Non Residential Premises Loans', ProductAbbr: 'NRPL'}, + {ID: 3, ProductName: 'Loan Against Property', ProductAbbr: 'LAP'}, + {ID: 4, ProductName: 'Business Loans', ProductAbbr: 'BL'}, + {ID: 5, ProductName: 'Personal Loans', ProductAbbr: 'PL'}, + {ID: 6, ProductName: 'Land Loan', ProductAbbr: 'LL'} +]; \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html new file mode 100644 index 000000000..2fe9eaa86 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html @@ -0,0 +1,42 @@ + +
+
Region
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+ + +
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.spec.ts new file mode 100644 index 000000000..b77959900 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RegionsDialogComponent } from './regions-dialog.component'; + +describe('RegionsDialogComponent', () => { + let component: RegionsDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RegionsDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RegionsDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.ts new file mode 100644 index 000000000..b2f00117b --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.ts @@ -0,0 +1,66 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './regions-dialog.component.html', + styleUrls: ['./regions-dialog.component.scss'] +}) +export class RegionsDialogComponent implements OnInit { + + public _regionsForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _regionsService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._regionsForm = this._formBuilder.group({ + //Regions_id: any; fk_city_id: any; + region_id: [this.data.region_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._regionsForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._regionsService.addRegions(this._regionsForm.value); + // this.dialogRef.close(); + // } else { + // this._regionsService.editRegions(this._regionsForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.region_id)) { + var my_array = this._regionsForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._regionsService.addMasterDetails(my_array,'REGIONS').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._regionsService.editMasterDetails(this._regionsForm.value,'REGIONS').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._regionsForm.reset(); + } +} diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html new file mode 100644 index 000000000..37809dfdb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html @@ -0,0 +1,65 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + +
#Regions NameIsActiveAction
No Records
{{i+1}}{{RL.name}}{{RL.isactive}} + edit + delete_outline +
+ +
+ + + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.scss b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.scss new file mode 100644 index 000000000..3b5b29164 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.scss @@ -0,0 +1,93 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } + diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.spec.ts new file mode 100644 index 000000000..6b77ed40a --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RegionsListComponent } from './regions-list.component'; + +describe('RegionsListComponent', () => { + let component: RegionsListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RegionsListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RegionsListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts new file mode 100644 index 000000000..5367ff932 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts @@ -0,0 +1,109 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { RegionsDialogComponent } from '../regions-dialog/regions-dialog.component'; +import { Regions } from '../../../model/regions'; + + +@Component({ + selector: 'app-regions-list', + templateUrl: './regions-list.component.html', + styleUrls: ['./regions-list.component.scss'] +}) +export class RegionsListComponent implements OnInit { + + + isPopupOpened = true; + loader: boolean = false; + regionsList: any = []; + + displayedColumns = ['region_id', 'name', 'isactive','actions']; + //region_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + constructor(private dialog: MatDialog, + private _regionsService: MastersService) { } + + // get regionsList() { + // return this._regionsService.getAllregions(); + // } + + dataSource = new UserDataSource(this._regionsService); + + ngOnInit() { + this.getregions(); + } + + + addregions() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(RegionsDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editregions(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._regionsService.getAllregions().find(c => c.ID === id); + const dialogRef = this.dialog.open(RegionsDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getregions() { + this.loader = true; + this._regionsService.getAllMasterData('REGIONS').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.regionsList = dataresult.records; + } + }) + + } + + deleteregions(id: number) { + var PrimaryKeyWithValue ={'region_id':id}; + this._regionsService.deleteMasterDetails(PrimaryKeyWithValue,'REGIONS'); + //this._regionsService.deleteMasterDetails('region_id',id,'REGIONS'); + } +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllMasterData('REGIONS'); + } + disconnect() {} +} + diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html new file mode 100644 index 000000000..78ec48b91 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html @@ -0,0 +1,41 @@ + +
+
Relation Ship
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.spec.ts new file mode 100644 index 000000000..71a8031ed --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RelationShipDialogComponent } from './relation-ship-dialog.component'; + +describe('RelationShipDialogComponent', () => { + let component: RelationShipDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RelationShipDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RelationShipDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.ts new file mode 100644 index 000000000..724668fee --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.ts @@ -0,0 +1,64 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './relation-ship-dialog.component.html', + styleUrls: ['./relation-ship-dialog.component.scss'] +}) +export class RelationShipDialogComponent implements OnInit { + + + public _relationShipForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef< RelationShipDialogComponent>, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._relationShipForm = this._formBuilder.group({ + relationship_id: [this.data.relationship_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._relationShipForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addRelationShip(this._relationShipForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editRelationShip(this._relationShipForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.relationship_id)) { + var my_array = this._relationShipForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'RELATIONSHIPS').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._MastersService.editMasterDetails(this._relationShipForm.value,'RELATIONSHIPS').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + onReset(){ + this._relationShipForm.reset(); + } +} diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html new file mode 100644 index 000000000..ff6f8dea3 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html @@ -0,0 +1,85 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + +
#Relationship NameIsactiveAction
No Records
{{i+1}}{{RL.name}}{{RL.isactive}} + edit + delete_outline +
+ +
+ + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.scss b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.scss new file mode 100644 index 000000000..e5c82000e --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.scss @@ -0,0 +1,120 @@ +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + }*/ + + // + + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; +} + +.example-header { + min-height: 64px; + padding: 8px 24px 0; +} + +//mat-cell{ +.cell{ + display:flex !important; + justify-content:center!important; + +} + +// mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; +} + + +table { + width: 100%; +} + +th { + text-align: left; +} + diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.spec.ts new file mode 100644 index 000000000..9bc48ca02 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RelationShipListComponent } from './relation-ship-list.component'; + +describe('RelationShipListComponent', () => { + let component: RelationShipListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RelationShipListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RelationShipListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts new file mode 100644 index 000000000..0be882a6d --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts @@ -0,0 +1,116 @@ +// import { Component, OnInit } from '@angular/core'; +// import { MatDialog, MatPaginator, MatTableDataSource } from '@angular/material'; + +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { RelationShipDialogComponent } from '../relation-ship-dialog/relation-ship-dialog.component'; +import { RelationShip } from '../../../model/relation-ship'; + + +@Component({ + selector: 'app-relation-ship-list', + templateUrl: './relation-ship-list.component.html', + styleUrls: ['./relation-ship-list.component.scss'] +}) +export class RelationShipListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + RelationShipList: any = []; + + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get RelationShipList() { + // return this._MastersService.getAllRelationShip(); + // } + + displayedColumns = ['relationship_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + //relationship_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + ngOnInit() { + this.getRelationShip(); + } + + dataSource = new UserDataSource(this._MastersService); + + addRelationShip() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(RelationShipDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editRelationShip(arr: any) { + this.isPopupOpened = true; + // const contact = this._MastersService.getAllRelationShip().find(c => c.ID === id); + const dialogRef = this.dialog.open(RelationShipDialogComponent, { + + data : arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getRelationShip() { + this.loader = true; + this._MastersService.getAllMasterData('RELATIONSHIPS').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.RelationShipList = dataresult.records; + } + }) + + } + + deleteRelationShip(id: number) { + var PrimaryKeyWithValue ={'relationship_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'RELATIONSHIPS'); + //this._MastersService.deleteMasterDetails('relationship_id',id,'RELATIONSHIPS'); + } +} + + + +export class UserDataSource extends DataSource { + + constructor(private _rss:MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._rss.getAllRelationShip(); + return this._rss.getAllMasterData('RELATIONSHIPS'); + } + disconnect() {} +} + + diff --git a/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html new file mode 100644 index 000000000..73baaf80b --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html @@ -0,0 +1,66 @@ + +
+
State
+
+
+
+ + +
+ +
+ + +
+ + + {{ sd.name }} + + You must include a Region. + +
+ +
+ + + You must include a Name. + + +
+
+ +
+
+ + + You must include a Code. + + +
+ +
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.spec.ts new file mode 100644 index 000000000..ce8f2a826 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { StatesDialogComponent } from './states-dialog.component'; + +describe('StatesDialogComponent', () => { + let component: StatesDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ StatesDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(StatesDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.ts new file mode 100644 index 000000000..9af51a9e2 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.ts @@ -0,0 +1,106 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; +import { States } from '../../../model/states'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './states-dialog.component.html', + styleUrls: ['./states-dialog.component.scss'] +}) +export class StatesDialogComponent implements OnInit { + + public _statesForm: FormGroup; + regionDatas : any[]; + foundBooks: any; + errorMessage:string; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + // get RegionData(){ + // return this._MastersService.getRegionData().subscribe( + // data => { this.foundBooks = data }); + // } + + // getBooks() + // { + // this._MastersService.getRegionData().subscribe( + // data => { this.foundBooks = data.json(); + // this.foundBooks = Array.of(this.foundBooks); + // }, + // err => console.error(err), + // () => console.log('getBooks completed') + // ); + // } + + + + ngOnInit() { + // console.log(this._MastersService.getRegionData()); + //console.log('RegionData',this.RegionData); + //console.log('getBooks',this.getBooks); + //console.log('foundBooks',this.foundBooks); + + this._statesForm = this._formBuilder.group({ + //States_id: any; fk_city_id: any; + state_id: [this.data.state_id], + name: [this.data.name, Validators.compose([Validators.required])], + code: [this.data.code, Validators.compose([Validators.required])], + fk_region_id : [this.data.fk_region_id, Validators.compose([Validators.required])] + }); + this._MastersService.getAllMasterData('REGIONS') + .subscribe( + data => { + + if (data.status == 200) { + this.regionDatas = data.records; + this.regionDatas = this.regionDatas.filter(city=>city.isactive == 1 ); + } + + }, error => this.errorMessage = error); + //console.log(this._statesForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addStates(this._statesForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editStates(this._statesForm.value); + // this.dialogRef.close(); + // } + // } + + + + onSubmit() { + if(isNaN(this.data.state_id)) { + var my_array = this._statesForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'STATE').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._statesForm.value,'STATE').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + + + onReset(){ + this._statesForm.reset(); + } +} + diff --git a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html new file mode 100644 index 000000000..c2ffaf4ac --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html @@ -0,0 +1,105 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + +
#State NameRegion NameIsactiveAction
No Records
{{i+1}}{{SL.name}}{{SL.region_name}}{{SL.isactive}} + edit + delete_outline + +
+ +
+ + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.scss b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.scss new file mode 100644 index 000000000..3b5b29164 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.scss @@ -0,0 +1,93 @@ + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + } + + + table { + width: 100%; + } + + th { + text-align: left; + } + diff --git a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.spec.ts new file mode 100644 index 000000000..ba198df67 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { StatesListComponent } from './states-list.component'; + +describe('StatesListComponent', () => { + let component: StatesListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ StatesListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(StatesListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts new file mode 100644 index 000000000..1a9e4203f --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts @@ -0,0 +1,110 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + +import { MastersService } from '../../../../service/masters/masters.service'; +import { StatesDialogComponent } from '../states-dialog/states-dialog.component'; +import { States } from '../../../model/states'; + + +@Component({ + selector: 'app-states-list', + templateUrl: './states-list.component.html', + styleUrls: ['./states-list.component.scss'] +}) +export class StatesListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + StateList: any = []; + + //displayedColumns = ['states_id', 'fk_city_id', 'name', 'createdon', 'fk_createdby', 'updatedon', 'fk_updatedby', 'isactive','actions']; + displayedColumns = ['state_id', 'fk_region_id','region_name', 'name', 'code', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + + constructor(private dialog: MatDialog, + private _statesService: MastersService) { } + + // get StatesList() { + // return this._statesService.getAllStates(); + // } + + dataSource = new UserDataSource(this._statesService); + + ngOnInit() { + this.getState(); + } + + + addState() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(StatesDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editState(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._statesService.getAllStates().find(c => c.ID === id); + const dialogRef = this.dialog.open(StatesDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getState() { + this.loader = true; + this._statesService. getAllState().subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.StateList = dataresult.records; + } + }) + + } + + deleteState(id: number) { + var PrimaryKeyWithValue ={'state_id':id}; + this._statesService.deleteMasterDetails(PrimaryKeyWithValue,'STATE'); + //this._statesService.deleteMasterDetails('state_id',id,'STATE'); + } + + +} + +export class UserDataSource extends DataSource { + + + constructor(private _bs: MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._bs.getAllState(); + //return this._bs.getAllMasterData('STATE'); + } + disconnect() {} +} diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html new file mode 100644 index 000000000..bfff31848 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html @@ -0,0 +1,75 @@ + + +
+
Sub Product Details
+
+
+
+ + +
+ +
+ + +
+ +
+ + + {{ sd.name }} + + You must include a Product name. + +
+ + +
+ +
+ + + You must include a Sub Product name. + + +
+ + +
+ + + You must include a Sub Product Abbrevation. + + +
+ +
+
+ + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.scss new file mode 100644 index 000000000..510588abc --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.scss @@ -0,0 +1,4 @@ +mat-form-field{ + width:100%; +} + diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.spec.ts new file mode 100644 index 000000000..fd75bb331 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SubProductDialogComponent } from './sub-product-dialog.component'; + +describe('SubProductDialogComponent', () => { + let component: SubProductDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SubProductDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SubProductDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.ts new file mode 100644 index 000000000..26e50bf3f --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.ts @@ -0,0 +1,74 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './sub-product-dialog.component.html', + styleUrls: ['./sub-product-dialog.component.scss'] +}) +export class SubProductDialogComponent implements OnInit { + + public _subProductMasterForm: FormGroup; + productDatas : any[]; + errorMessage:string; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._subProductMasterForm = this._formBuilder.group({ + subproduct_id: [this.data.subproduct_id], + name: [this.data.name, Validators.compose([Validators.required])], + fk_product_id: [this.data.fk_product_id, Validators.compose([Validators.required])], + abbr: [this.data.abbr, Validators.compose([Validators.required])] + }); + + this._MastersService.getAllMasterData('PRODUCTS') + .subscribe( + data => { + + if (data.status == 200) { + this.productDatas = data.records; + this.productDatas = this.productDatas.filter(city=>city.isactive == 1 ); + } + + + }, error => this.errorMessage = error); + //console.log(this._industryMasterForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addSubProductMaster(this._subProductMasterForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editSubProductMaster(this._subProductMasterForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.subproduct_id)) { + var my_array = this._subProductMasterForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'SUBPRODUCTS').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._MastersService.editMasterDetails(this._subProductMasterForm.value,'SUBPRODUCTS').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html new file mode 100644 index 000000000..77d9d4cb1 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html @@ -0,0 +1,95 @@ + +
+ +
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + +
#Product NameSubProduct NameSubProduct AbbrevationIsactiveAction
No Records
{{i+1}}{{SPM.product_name}}{{SPM.name}}{{SPM.abbr}}{{SPM.isactive}} + edit + delete_outline +
+ +
+ + + +
+ + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.scss b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.scss new file mode 100644 index 000000000..e5c82000e --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.scss @@ -0,0 +1,120 @@ +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + }*/ + + // + + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; +} + +.example-header { + min-height: 64px; + padding: 8px 24px 0; +} + +//mat-cell{ +.cell{ + display:flex !important; + justify-content:center!important; + +} + +// mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; +} + + +table { + width: 100%; +} + +th { + text-align: left; +} + diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.spec.ts new file mode 100644 index 000000000..9413c8586 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SubProductListComponent } from './sub-product-list.component'; + +describe('SubProductListComponent', () => { + let component: SubProductListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SubProductListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SubProductListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts new file mode 100644 index 000000000..b994ebc7f --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts @@ -0,0 +1,111 @@ +// import { Component, OnInit } from '@angular/core'; +// import { MatDialog, MatPaginator, MatTableDataSource } from '@angular/material'; +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { SubProductDialogComponent } from '../sub-product-dialog/sub-product-dialog.component'; +import { SubProductMaster } from '../../../model/sub-product-master'; + +@Component({ + selector: 'app-sub-product-list', + templateUrl: './sub-product-list.component.html', + styleUrls: ['./sub-product-list.component.scss'] +}) +export class SubProductListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + SubProductMasterList: any = []; + + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get SubProductMasterList() { + // return this._MastersService.getAllSubProductMaster(); + // } + + displayedColumns = ['subproduct_id','fk_product_id','product_name','name','abbr','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + //subproduct_id, fk_product_id, name, abbr, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + dataSource = new UserDataSource(this._MastersService); + + + ngOnInit() { + this.getSubProductMaster(); + } + + + addSubProductMaster() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(SubProductDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editSubProductMaster(arr : any) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllSubProductMaster().find(c => c.ID === id); + const dialogRef = this.dialog.open(SubProductDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } +//To get data for listing +getSubProductMaster() { + this.loader = true; + this._MastersService.getAllSubProduct().subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.SubProductMasterList = dataresult.records; + } + }) + +} + + deleteSubProductMaster(id: number) { + var PrimaryKeyWithValue ={'subproduct_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'SUBPRODUCTS'); + //this._MastersService.deleteMasterDetails('subproduct_id',id,'SUBPRODUCTS'); + } +} + +export class UserDataSource extends DataSource { + + constructor(private _sps:MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + //return this._sps.getAllMasterData('SUBPRODUCTS'); + return this._sps.getAllSubProduct(); + + } + disconnect() {} +} diff --git a/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.html b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.html new file mode 100644 index 000000000..ccc45b149 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.html @@ -0,0 +1,41 @@ + +
+
Title
+
+
+
+ + + +
+ +
+ + +
+ + + You must include a Title. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.spec.ts new file mode 100644 index 000000000..75bed54be --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TitleDialogComponent } from './title-dialog.component'; + +describe('TitleDialogComponent', () => { + let component: TitleDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TitleDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TitleDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.ts new file mode 100644 index 000000000..8e3ecda04 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.ts @@ -0,0 +1,63 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './title-dialog.component.html', + styleUrls: ['./title-dialog.component.scss'] +}) +export class TitleDialogComponent implements OnInit { + + + public _titleForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._titleForm = this._formBuilder.group({ + title_id: [this.data.title_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._titleForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._contactService.addTitle(this._titleForm.value); + // this.dialogRef.close(); + // } else { + // this._contactService.editTitle(this._titleForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.title_id)) { + var my_array = this._titleForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'TITLES').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._MastersService.editMasterDetails(this._titleForm.value,'TITLES').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + onReset(){ + this._titleForm.reset(); + } +} + diff --git a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html new file mode 100644 index 000000000..7de36b7b0 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html @@ -0,0 +1,85 @@ + +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + +
#Title NameAbbrevationIsActiveAction
No Records
{{i+1}}{{TL.name}}{{TL.abbr}}{{TL.isactive}} + edit + delete_outline +
+ +
+ + + +
+ + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.scss b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.scss new file mode 100644 index 000000000..4c7ba0782 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.scss @@ -0,0 +1,119 @@ +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + }*/ + + + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; +} + +.example-header { + min-height: 64px; + padding: 8px 24px 0; +} + +//mat-cell{ +.cell{ + display:flex !important; + justify-content:center!important; + +} + +// mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; +} + + +table { + width: 100%; +} + +th { + text-align: left; +} + diff --git a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.spec.ts new file mode 100644 index 000000000..cce70c5ff --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TitleListComponent } from './title-list.component'; + +describe('TitleListComponent', () => { + let component: TitleListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TitleListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TitleListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts new file mode 100644 index 000000000..5373d3eaf --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts @@ -0,0 +1,112 @@ +// import { Component, OnInit } from '@angular/core'; +// import { MatDialog, MatPaginator, MatTableDataSource } from '@angular/material'; + +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { TitleDialogComponent } from '../title-dialog/title-dialog.component'; +import { Title } from '../../../model/title'; + +@Component({ + selector: 'app-title-list', + templateUrl: './title-list.component.html', + styleUrls: ['./title-list.component.scss'] +}) +export class TitleListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + TitleList: any = []; + + + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + displayedColumns = ['title_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + + //title_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + dataSource = new UserDataSource(this._MastersService); + + + // get TitleList() { + // return this._MastersService.getAllTitle(); + // } + + + ngOnInit() { + this.getTitle(); + } + + + addTitle() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(TitleDialogComponent , { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editTitle(arr : any) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllTitle().find(c => c.ID === id); + const dialogRef = this.dialog.open(TitleDialogComponent , { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getTitle() { + this.loader = true; + this._MastersService.getAllMasterData('TITLES').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.TitleList = dataresult.records; + } + }) + + } + + deleteTitle(id: number) { + var PrimaryKeyWithValue ={'title_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'TITLES'); + //this._MastersService.deleteMasterDetails('title_id',id,'TITLES'); + } +} + +export class UserDataSource extends DataSource { + + constructor(private _ts:MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._ts.getAllMasterData('TITLES'); + } + disconnect() {} +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.html b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.html new file mode 100644 index 000000000..4e6b095bd --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.html @@ -0,0 +1,41 @@ + + +
+
Type of activity
+
+
+
+ + +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.spec.ts new file mode 100644 index 000000000..ae3d3e8f4 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ActivityDialogComponent } from './activity-dialog.component'; + +describe('ActivityDialogComponent', () => { + let component: ActivityDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ActivityDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ActivityDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.ts new file mode 100644 index 000000000..2ae682683 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.ts @@ -0,0 +1,64 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +import { MastersService } from '../../../../service/masters/masters.service'; + + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './activity-dialog.component.html', + styleUrls: ['./activity-dialog.component.scss'] +}) +export class ActivityDialogComponent implements OnInit { + + public _activityMasterForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _MastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._activityMasterForm = this._formBuilder.group({ + type_of_activity_id: [this.data.type_of_activity_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._activityMasterForm); + } + + onSubmit() { + if(isNaN(this.data.type_of_activity_id)) { + var my_array = this._activityMasterForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._MastersService.addMasterDetails(my_array,'TYPEOFACTIVITY').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + + this._MastersService.editMasterDetails(this._activityMasterForm.value,'TYPEOFACTIVITY').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._MastersService.addActivity(this._activityMasterForm.value); + // this.dialogRef.close(); + // } else { + // this._MastersService.editActivity(this._activityMasterForm.value); + // this.dialogRef.close(); + // } + // } + + onReset(){ + this._activityMasterForm.reset(); + } +} diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html new file mode 100644 index 000000000..da8b1ad9e --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html @@ -0,0 +1,79 @@ + +
+ +
+
+
+ +
+ +
+ + + + + + + + + + + + + + + +
#Activity NameIsactiveAction
No Records
{{i+1}}{{AL.name}}{{AL.isactive}} + edit + delete_outline +
+ +
+ + + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.scss b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.scss new file mode 100644 index 000000000..49827ebf1 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.scss @@ -0,0 +1,118 @@ +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + }*/ + + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; +} + +.example-header { + min-height: 64px; + padding: 8px 24px 0; +} + +//mat-cell{ +.cell{ + display:flex !important; + justify-content:center!important; + +} + +// mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; +} + + +table { + width: 100%; +} + +th { + text-align: left; +} + diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.spec.ts new file mode 100644 index 000000000..4d660e1c2 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ActivityListComponent } from './activity-list.component'; + +describe('ActivityListComponent', () => { + let component: ActivityListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ActivityListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ActivityListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts new file mode 100644 index 000000000..2bf542b4d --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts @@ -0,0 +1,104 @@ +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { ActivityDialogComponent } from '../activity-dialog/activity-dialog.component'; +import { Activity } from '../../../model/activity'; + +@Component({ + selector: 'app-activity-list', + templateUrl: './activity-list.component.html', + styleUrls: ['./activity-list.component.scss'] +}) +export class ActivityListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + ActivityList: any = []; + + displayedColumns = ['type_of_activity_id', 'name', 'createdon', 'fk_createdby', 'updatedon', 'fk_updatedby', 'isactive','actions']; + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + dataSource = new UserDataSource(this._MastersService); + + ngOnInit() { + this.getActivity(); + } + + + addActivity() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open(ActivityDialogComponent, { + data: {} + }); + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + + editActivity(arr: any[]) { + this.isPopupOpened = true; + //const contact = this._MastersService.getAllActivity().find(c => c.ID === id); + const dialogRef = this.dialog.open(ActivityDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getActivity() { + this.loader = true; + this._MastersService.getAllMasterData('TYPEOFACTIVITY').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.ActivityList = dataresult.records; + } + }) + + } + + + deleteActivity(id: number) { + var PrimaryKeyWithValue ={'type_of_activity_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'TYPEOFACTIVITY'); + //this._MastersService.deleteMasterDetails('type_of_activity_id',id,'TYPEOFACTIVITY').subscribe(); + } + +} + + +export class UserDataSource extends DataSource { + + + constructor(private _as:MastersService) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._as.getAllMasterData('TYPEOFACTIVITY'); + } + disconnect() {} +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.html b/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.html new file mode 100644 index 000000000..0fe11fc90 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.html @@ -0,0 +1,40 @@ + +
+
Unit of Measurement
+
+
+
+ + +
+ +
+ + +
+ + + You must include a Name. + + +
+
+
+ + + +
+ +
+
+ +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.scss b/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.spec.ts b/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.spec.ts new file mode 100644 index 000000000..d38e5da1d --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UomDialogComponent } from './uom-dialog.component'; + +describe('UomDialogComponent', () => { + let component: UomDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UomDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UomDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.ts new file mode 100644 index 000000000..07b60fdd3 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.ts @@ -0,0 +1,65 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { MastersService } from '../../../../service/masters/masters.service'; + +@Component({ + selector: 'app-jazz-dialog', + templateUrl: './uom-dialog.component.html', + styleUrls: ['./uom-dialog.component.scss'] +}) +export class UomDialogComponent implements OnInit { + + + public _uomForm: FormGroup; + + constructor(private _formBuilder: FormBuilder, + private dialogRef: MatDialogRef, + private _mastersService: MastersService, + @Inject(MAT_DIALOG_DATA) public data: any) { } + + onNoClick(): void { + this.dialogRef.close(); + } + + ngOnInit() { + + this._uomForm = this._formBuilder.group({ + // ID: [this.data.ID], + // Name: [this.data.Name, Validators.compose([Validators.required])] + // uom_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + uom_id: [this.data.uom_id], + name: [this.data.name, Validators.compose([Validators.required])] + }); + //console.log(this._UomForm); + } + + // onSubmit() { + // if (isNaN(this.data.ID)) { + // this._mastersService.addUom(this._uomForm.value); + // this.dialogRef.close(); + // } else { + // this._mastersService.editUom(this._uomForm.value); + // this.dialogRef.close(); + // } + // } + + onSubmit() { + if(isNaN(this.data.subproduct_id)) { + var my_array = this._uomForm.value; + Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]); + console.log(my_array); + this._mastersService.addMasterDetails(my_array,'UOM').subscribe(); + this.dialogRef.close(); + alert("saved"); + } else { + this._mastersService.editMasterDetails(this._uomForm.value,'UOM').subscribe(); + this.dialogRef.close(); + alert("edited"); + } + } + + onReset(){ + this._uomForm.reset(); + } +} diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html new file mode 100644 index 000000000..01db74d5f --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html @@ -0,0 +1,79 @@ + +
+ +
+
+
+ +
+ +
+ + + + + + + + + + + + + + + +
#UOMIsActiveAction
No Records
{{i+1}}{{UL.name}}{{UL.isactive}} + edit + delete_outline +
+ +
+ + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.scss b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.scss new file mode 100644 index 000000000..625557102 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.scss @@ -0,0 +1,118 @@ +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + } + + .example-header { + min-height: 64px; + padding: 8px 24px 0; + } + + //mat-cell{ + .cell{ + display:flex !important; + justify-content:center!important; + + } + + // mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; + }*/ + + + +/* Structure +.example-container { + display: flex; + flex-direction: column; + min-width: 300px; +} + +.example-header { + min-height: 56px; + max-height: 56px; + display: flex; + align-items: center; + padding: 8px 24px 0; + font-size: 20px; + justify-content: space-between; + border-bottom: 1px solid transparent; +} + +.mat-input-container { + font-size: 14px; + flex-grow: 1; + margin-left: 32px; + margin-top: 8px; +} + +.example-no-results { + display: flex; + justify-content: center; + padding: 24px; + font-size: 12px; + font-style: italic; +} + +/** Selection styles +.example-selection-header { + font-size: 18px; + background: rgba(255, 64, 129, 0.3); + border-bottom: 1px solid #d696ac; +} + +.mat-column-select { + max-width: 54px; +} + +.mat-row:hover, .example-selected-row { + background: #f5f5f5; +} + +.mat-row:active, .mat-row.example-selected-row { + background: #eaeaea; +} + +.mat-table { + overflow: auto; + max-height: 500px; +}*/ +/* Structure */ +.example-container { + display: flex; + flex-direction: column; + min-width: 30px; + width : 80%; + margin : 20px auto; +} + +.example-header { + min-height: 64px; + padding: 8px 24px 0; +} + +//mat-cell{ +.cell{ + display:flex !important; + justify-content:center!important; + +} + +// mat-header-cell { + .header-cell{ + display:flex; + justify-content:center; +} + + +table { + width: 100%; +} + +th { + text-align: left; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.spec.ts b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.spec.ts new file mode 100644 index 000000000..b21e75294 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UomListComponent } from './uom-list.component'; + +describe('UomListComponent', () => { + let component: UomListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UomListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UomListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts new file mode 100644 index 000000000..53e449b0b --- /dev/null +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts @@ -0,0 +1,115 @@ +// import { Component, OnInit } from '@angular/core'; +// import { MatDialog, MatPaginator, MatTableDataSource } from '@angular/material'; + +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material'; + +import { Observable, Subject } from 'rxjs'; +import { Http, Response } from '@angular/http'; +import 'rxjs/add/operator/map'; + +import { DataSource } from '@angular/cdk/collections'; +import { map } from 'rxjs/operators'; +import { of as observableOf, merge } from 'rxjs'; + + +import { MastersService } from '../../../../service/masters/masters.service'; +import { UomDialogComponent } from '../uom-dialog/uom-dialog.component'; +import { Uom } from '../../../model/uom'; + + + +@Component({ + selector: 'app-uom-list', + templateUrl: './uom-list.component.html', + styleUrls: ['./uom-list.component.scss'] +}) +export class UomListComponent implements OnInit { + + isPopupOpened = true; + loader: boolean = false; + UOMList: any = []; + + constructor(private dialog: MatDialog, + private _MastersService: MastersService) { } + + // get UOMList() { + // return this._MastersService.getAllUom(); + // } + + ngOnInit() { + this.getUOM(); + } + + displayedColumns = ['uom_id','name','createdon','fk_createdby','updatedon','isactive','fk_updatedby','actions']; + //uom_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive + + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + + dataSource = new UserDataSource(this._MastersService); + + + addUOM() { + this.isPopupOpened = true; + const dialogRef = this.dialog.open( UomDialogComponent, { + data: {} + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + editUOM(arr : any) { + this.isPopupOpened = true; + // const contact = this._MastersService.getAllUom().find(c => c.ID === id); + const dialogRef = this.dialog.open( UomDialogComponent, { + data: arr + }); + + + dialogRef.afterClosed().subscribe(result => { + this.isPopupOpened = false; + }); + } + + //To get data for listing + getUOM() { + this.loader = true; + this._MastersService.getAllMasterData('UOM').subscribe(dataresult => { + + this.loader = false; + + if (dataresult.dataStatus  === true) { + this.UOMList = dataresult.records; + } + }) + + } + + + deleteUOM(id: number) { + var PrimaryKeyWithValue ={'uom_id':id}; + this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'UOM'); + //this._MastersService.deleteMasterDetails('uom_id',id,'UOM'); + } +} + + +export class UserDataSource extends DataSource { + + constructor(private _us:MastersService ) { + super(); + } + + connect(): Observable { + //return this.userService.getUser(); + return this._us.getAllMasterData('UOM'); + } + disconnect() {} +} + + + diff --git a/ng6-seed/src/app/settings/masters/masters.component.html b/ng6-seed/src/app/settings/masters/masters.component.html new file mode 100644 index 000000000..9395514a3 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/masters.component.html @@ -0,0 +1,145 @@ + + + + Master Details + Pickup the Master to View Master Detail + + + + +
+
+ + + + + + +
+ + + + + {{master.name}} + + + + +
+ + + +
+ +
+ +
+ +
+ + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/masters.component.scss b/ng6-seed/src/app/settings/masters/masters.component.scss new file mode 100644 index 000000000..3e80f0dbb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/masters.component.scss @@ -0,0 +1,3 @@ +mat-form-field{ + width:100%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/masters.component.spec.ts b/ng6-seed/src/app/settings/masters/masters.component.spec.ts new file mode 100644 index 000000000..accdb83d1 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/masters.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MastersComponent } from './masters.component'; + +describe('MastersComponent', () => { + let component: MastersComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MastersComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MastersComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/masters.component.ts b/ng6-seed/src/app/settings/masters/masters.component.ts new file mode 100644 index 000000000..361c026a9 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/masters.component.ts @@ -0,0 +1,198 @@ +//import { Component, OnInit } from '@angular/core'; +//import { FormControl } from '@angular/forms'; +//import { startWith } from 'rxjs/operators'; + + + import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; + import { FormControl, FormGroup, FormBuilder } from '@angular/forms'; + import { ReplaySubject } from 'rxjs'; + import { MatSelect } from '@angular/material'; + import { Subject } from 'rxjs'; + import { take, takeUntil } from 'rxjs/operators'; + + import { MastersService } from './../service/masters/masters.service' + + export interface Master { + id: string; + name: string; + } + + // export interface Master { + // master_id: string; + // master_name: string; + // } + + + +// export interface masterArray { +// value: string; +// viewValue: string; +// } + +@Component({ + selector: 'app-masters', + templateUrl: './masters.component.html', + styleUrls: ['./masters.component.scss'] +}) +export class MastersComponent implements OnInit { + + /* Normal Search Code + pickUpMasterData : string; + + constructor() {} + + For Master Dropdown Elements + masterArray = [{ code: 'master-1', viewValue: 'Industry Classfication' }, + { code: 'master-2', viewValue: 'Product'}, + { code: 'master-3', viewValue: 'Sub Product'} + ]; + + ngOnInit() {}*/ + + + +/* AutoComplete Code + stateCtrl: FormControl; + currentState = ''; + + reactiveStates: any; + tdStates: any[]; + + tdDisabled = false; + + tdAuto: string; + + reactiveAuto: string; + + masterArray = [{ code: 'master-1', viewValue: 'Industry Classfication' }, + { code: 'master-2', viewValue: 'Product'}, + { code: 'master-3', viewValue: 'Sub Product'} + ]; + + constructor() { + this.tdStates = this.masterArray; + //this.reactiveStates = this.stateCtrl.valueChanges; + } + + + filterStates(val: string) { + return val ? this.masterArray.filter((s) => s.viewValue.match(new RegExp(val, 'gi'))) : this.masterArray; + }*/ + + /* Select Search Code + /** control for the selected bank */ + public masterCtrl: FormControl = new FormControl(); + + + /** control for the MatSelect filter keyword */ + public masterFilterCtrl: FormControl = new FormControl(); + + //masters: Master[]; + + constructor(private _MastersService: MastersService) + { + // this._MastersService.getAllMasterData('LISTOFMASTERS') + // .subscribe(result => this.masters = result); + // console.log(this.masters); + // console.log(this._MastersService.getAllMasterData('LISTOFMASTERS').subscribe()); + } + + /** list of masters */ + + private masters: Master[] = [ + {id: 'master-1',name: 'Industry Classfication'}, + {id: 'master-2',name: 'Branch'}, + {id: 'master-3',name: 'Title'}, + {id: 'master-4',name: 'Relation Ship'}, + {id: 'master-5',name: 'Product'}, + {id: 'master-6',name: 'Sub Product'}, + {id: 'master-7',name: 'Occupation of Non earning members'}, + {id: 'master-8',name: 'Type of activity'}, + {id: 'master-9',name: 'Unit of Measurement'}, + {id: 'master-10',name: 'Frequency'}, + {id: 'master-11',name: 'Approach to PD location'}, + {id: 'master-12',name: 'Comments on locality'}, + {id: 'master-13',name: 'Customer Behaviour'}, + {id: 'master-14',name: 'Customer Segment'}, + {id: 'master-15',name: 'Designation'}, + {id: 'master-16',name: 'PD Allocation Type'}, + {id: 'master-17',name: 'PD Type'}, + {id: 'master-18',name: 'Company Details'}, + {id: 'master-19',name: 'City'}, + {id: 'master-20',name: 'States'}, + {id: 'master-21',name: 'Regions'}, + {id: 'master-22',name: 'Lender Hierarchy'} + ]; + + /** list of masters filtered by search keyword */ + public filteredMasters: ReplaySubject = new ReplaySubject(1); + + + @ViewChild('singleSelect') singleSelect: MatSelect; + + /** Subject that emits when the component has been destroyed. */ + private _onDestroy = new Subject(); + + ngOnInit() { + + // this._MastersService.getAllMasterData('LISTOFMASTERS').subscribe((data:Master[]) => { + // this.masters = data; + // console.log(this.masters); + // }); + console.log(this.masters); + // load the initial master list + this.filteredMasters.next(this.masters.slice()); + + // listen for search field value changes + this.masterFilterCtrl.valueChanges + .pipe(takeUntil(this._onDestroy)) + .subscribe(() => { + this.filterMasters(); + }); + + } + + ngAfterViewInit() { + //this.setInitialValue(); + } + + ngOnDestroy() { + this._onDestroy.next(); + this._onDestroy.complete(); + } + + // /** + // * Sets the initial value after the filteredMasters are loaded initially + // */ + // private setInitialValue() { + // this.filteredMasters + // .pipe(take(1), takeUntil(this._onDestroy)) + // .subscribe(() => { + // // setting the compareWith property to a comparison function + // // triggers initializing the selection according to the initial value of + // // the form control (i.e. _initializeSelection()) + // // this needs to be done after the filteredBanks are loaded initially + // // and after the mat-option elements are available + // this.singleSelect.compareWith = (a: Bank, b: Bank) => a.id === b.id; + // }); + // } + + private filterMasters() { + if (!this.masters) { + return; + } + // get the search keyword + let search = this.masterFilterCtrl.value; + if (!search) { + this.filteredMasters.next(this.masters.slice()); + return; + } else { + search = search.toLowerCase(); + } + // filter the masters + this.filteredMasters.next( + this.masters.filter(master => master.name.toLowerCase().indexOf(search) > -1) + ); + } + +} diff --git a/ng6-seed/src/app/settings/masters/masters.module.spec.ts b/ng6-seed/src/app/settings/masters/masters.module.spec.ts new file mode 100644 index 000000000..d726fe8e7 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/masters.module.spec.ts @@ -0,0 +1,14 @@ + +import { MastersModule } from './masters.module'; + +describe('MastersModule', () => { + let mastersModule: MastersModule; + + beforeEach(() => { + mastersModule = new MastersModule(); + }); + + it('should create an instance', () => { + expect(mastersModule).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/settings/masters/masters.module.ts b/ng6-seed/src/app/settings/masters/masters.module.ts new file mode 100644 index 000000000..78ec99884 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/masters.module.ts @@ -0,0 +1,184 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { CommonModule } from '@angular/common'; +import { HttpClientModule } from '@angular/common/http' +import { HttpModule } from '@angular/http'; + +import { + MatCardModule, + MatIconModule, + MatInputModule, + MatRadioModule, + MatButtonModule,MatTableModule,MatPaginatorModule, + MatProgressBarModule,MatDialogModule, MatSortModule, + MatToolbarModule,MatSelectModule } from '@angular/material'; + +import { DemoMaterialModule } from '../../shared/demo.module'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload'; + + +import { NgxMatSelectSearchModule } from 'ngx-mat-select-search'; +import { NgxDatatableModule } from '@swimlane/ngx-datatable'; +import { FlexLayoutModule } from '@angular/flex-layout'; + +import 'hammerjs'; + +/** Master Main Component */ +import { MastersComponent } from './masters.component'; + +/** Master Child Component - For Listing screen*/ +import { IndustryClassificationListComponent } from './component/industry_classification/industry_classification-list/industry_classification-list.component'; +import { ProductListComponent } from './component/product/product-list/product-list.component'; +import { SubProductListComponent } from './component/sub-product/sub-product-list/sub-product-list.component'; +import { BranchListComponent } from './component/branch/branch-list/branch-list.component'; +import { TitleListComponent } from './component/title/title-list/title-list.component'; +import { RelationShipListComponent } from './component/relation-ship/relation-ship-list/relation-ship-list.component'; +import { MembersOccupationListComponent } from './component/members-occupation/members-occupation-list/members-occupation-list.component'; +import { ActivityListComponent } from './component/type-of-activity/activity-list/activity-list.component'; +import { UomListComponent } from './component/uom/uom-list/uom-list.component'; +import { FrequencyListComponent } from './component/frequency/frequency-list/frequency-list.component'; +import { StatesListComponent } from './component/states/states-list/states-list.component'; +import { CityListComponent } from './component/city/city-list/city-list.component'; +import { CompanyListComponent } from './component/company/company-list/company-list.component'; +import { CustomerSegmentListComponent } from './component/customer-segment/customer-segment-list/customer-segment-list.component'; +import { CustomerBehaviourListComponent } from './component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component'; +import { DesignationListComponent } from './component/designation/designation-list/designation-list.component'; +import { RegionsListComponent } from './component/regions/regions-list/regions-list.component'; +import { CommentsOnLocalityListComponent } from './component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component'; +import { PdAllocationTypeListComponent } from './component/pd/pd-allocation-type-list/pd-allocation-type-list.component'; +import { PdLocationApproachListComponent } from './component/pd/pd-location-approach-list/pd-location-approach-list.component'; +import { PdTypeListComponent } from './component/pd/pd-type-list/pd-type-list.component'; +import { LenderHierarchyListComponent } from './component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component'; + +/** Master Child Component - For Dialogboxes*/ +import { ProductDialogComponent } from './component/product/product-dialog/product-dialog.component'; +import { IndustryClassificationDialogComponent } from './component/industry_classification/industry_classification-dialog/industry_classification-dialog.component'; +import { SubProductDialogComponent } from './component/sub-product/sub-product-dialog/sub-product-dialog.component'; +import { BranchDialogComponent } from './component/branch/branch-dialog/branch-dialog.component'; +import { TitleDialogComponent } from './component/title/title-dialog/title-dialog.component'; +import { RelationShipDialogComponent } from './component/relation-ship/relation-ship-dialog/relation-ship-dialog.component'; +import { MembersOccupationDialogComponent } from './component/members-occupation/members-occupation-dialog/members-occupation-dialog.component'; +import { ActivityDialogComponent } from './component/type-of-activity/activity-dialog/activity-dialog.component'; +import { UomDialogComponent } from './component/uom/uom-dialog/uom-dialog.component'; +import { FrequencyDialogComponent } from './component/frequency/frequency-dialog/frequency-dialog.component'; +import { PdTypeDialogComponent } from './component/pd/pd-type-dialog/pd-type-dialog.component'; +import { PdLocationApproachDialogComponent } from './component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component'; +import { PdAllocationTypeDialogComponent } from './component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component'; +import { LenderHierarchyDialogComponent } from './component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component'; +import { CommentsOnLocalityDialogComponent } from './component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component'; +import { DesignationDialogComponent } from './component/designation/designation-dialog/designation-dialog.component'; +import { CustomerBehaviourDialogComponent } from './component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component'; +import { CustomerSegmentDialogComponent } from './component/customer-segment/customer-segment-dialog/customer-segment-dialog.component'; +import { StatesDialogComponent } from './component/states/states-dialog/states-dialog.component'; +import { CompanyDialogComponent } from './component/company/company-dialog/company-dialog.component'; +import { CityDialogComponent } from './component/city/city-dialog/city-dialog.component'; +import { RegionsDialogComponent } from './component/regions/regions-dialog/regions-dialog.component'; + +/** Master Routes */ +import { MastersRoutes } from './masters.routing'; + +/** Master Service */ +import { MastersService } from '../service/masters/masters.service'; + + + +@NgModule({ + imports: [ + CommonModule, + FormsModule, ReactiveFormsModule, + RouterModule.forChild(MastersRoutes), + MatCardModule, + MatIconModule, + MatInputModule, + MatRadioModule, + MatButtonModule, + MatTableModule, + MatPaginatorModule, + MatProgressBarModule, + MatDialogModule, + MatSortModule, + MatToolbarModule, + MatSelectModule, + FlexLayoutModule, + FileUploadModule, + NgxMatSelectSearchModule, + NgxDatatableModule, + MatSortModule + ], + declarations: [MastersComponent, + IndustryClassificationListComponent, + ProductListComponent, + SubProductListComponent, + BranchListComponent, + TitleListComponent, + RelationShipListComponent, + MembersOccupationListComponent, + ActivityListComponent, + UomListComponent, + FrequencyListComponent, + StatesListComponent, + CityListComponent, + CompanyListComponent, + CustomerSegmentListComponent, + CustomerBehaviourListComponent, + DesignationListComponent, + RegionsListComponent, + CommentsOnLocalityListComponent, + PdAllocationTypeListComponent, + PdLocationApproachListComponent, + PdTypeListComponent, + LenderHierarchyListComponent, + + ProductDialogComponent, + IndustryClassificationDialogComponent, + SubProductDialogComponent, + BranchDialogComponent, + TitleDialogComponent, + RelationShipDialogComponent, + MembersOccupationDialogComponent, + ActivityDialogComponent, + UomDialogComponent, + FrequencyDialogComponent, + PdTypeDialogComponent, + PdLocationApproachDialogComponent, + PdAllocationTypeDialogComponent, + LenderHierarchyDialogComponent, + CommentsOnLocalityDialogComponent, + DesignationDialogComponent, + CustomerBehaviourDialogComponent, + CustomerSegmentDialogComponent, + StatesDialogComponent, + CompanyDialogComponent, + CityDialogComponent, + RegionsDialogComponent], + + providers: [ MastersService ], + + entryComponents: [ + IndustryClassificationDialogComponent, + ProductDialogComponent, + SubProductDialogComponent, + BranchDialogComponent, + TitleDialogComponent, + RelationShipDialogComponent, + MembersOccupationDialogComponent, + ActivityDialogComponent, + UomDialogComponent, + FrequencyDialogComponent, + PdTypeDialogComponent, + PdLocationApproachDialogComponent, + PdAllocationTypeDialogComponent, + LenderHierarchyDialogComponent, + CommentsOnLocalityDialogComponent, + DesignationDialogComponent, + CustomerBehaviourDialogComponent, + CustomerSegmentDialogComponent, + StatesDialogComponent, + CompanyDialogComponent, + CityDialogComponent, + RegionsDialogComponent], + + +}) +export class MastersModule { } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/masters.routing.ts b/ng6-seed/src/app/settings/masters/masters.routing.ts new file mode 100755 index 000000000..c80a026d9 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/masters.routing.ts @@ -0,0 +1,12 @@ +import { Routes } from '@angular/router'; +import { MastersComponent } from './masters.component'; + + +export const MastersRoutes: Routes = [ +{ + + path: '', + component: MastersComponent + //component: IndustryMasterListComponent + +}]; diff --git a/ng6-seed/src/app/settings/masters/model/activity.ts b/ng6-seed/src/app/settings/masters/model/activity.ts new file mode 100644 index 000000000..a431ed1cb --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/activity.ts @@ -0,0 +1,11 @@ +export class Activity { + + type_of_activity_id: any; + name: any; + createdon: any; + fk_createdby: any; + updatedon: any; + fk_updatedby: any; + isactive: any; + +} diff --git a/ng6-seed/src/app/settings/masters/model/branch.ts b/ng6-seed/src/app/settings/masters/model/branch.ts new file mode 100644 index 000000000..34b421444 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/branch.ts @@ -0,0 +1,24 @@ +export class Branch { + // ID: number; + // CityID: string; + // Name: string; + branch_id: any; + fk_city_id: any; + name: any; + createdon: any; + fk_createdby: any; + updatedon: any; + fk_updatedby: any; + isactive: any; +} +export class States { + state_id: any; + name: any; + isactive: any; +} +export class City { + city_id: any; + name: any; + isactive: any; +} + diff --git a/ng6-seed/src/app/settings/masters/model/city.ts b/ng6-seed/src/app/settings/masters/model/city.ts new file mode 100644 index 000000000..ab95b089b --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/city.ts @@ -0,0 +1,4 @@ +export class City { + + city_id: any; fk_state_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/comments-on-locality.ts b/ng6-seed/src/app/settings/masters/model/comments-on-locality.ts new file mode 100644 index 000000000..acccd906d --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/comments-on-locality.ts @@ -0,0 +1,3 @@ +export class CommentsOnLocality { + comments_on_locality_id: any; rating: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/company.ts b/ng6-seed/src/app/settings/masters/model/company.ts new file mode 100644 index 000000000..40a49777c --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/company.ts @@ -0,0 +1,3 @@ +export class Company { + company_id: any; name: any; addressline1: any; addressline2: any; pincode: any; logo: any; company_master_createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; addressline3: any; state: any; city: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/customer-behaviour.ts b/ng6-seed/src/app/settings/masters/model/customer-behaviour.ts new file mode 100644 index 000000000..f8c1d90a5 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/customer-behaviour.ts @@ -0,0 +1,4 @@ +export class CustomerBehaviour { + + customer_behaviour_id: any; description: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/customer-segment.ts b/ng6-seed/src/app/settings/masters/model/customer-segment.ts new file mode 100644 index 000000000..32e6c1fe0 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/customer-segment.ts @@ -0,0 +1,3 @@ +export class CustomerSegment { + customer_segment_id: any; name: any; abbr: any; createdon: any; fk_createdby: any; updatedon: any; isactive: any; fk_updatedby: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/designation.ts b/ng6-seed/src/app/settings/masters/model/designation.ts new file mode 100644 index 000000000..f0f29738f --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/designation.ts @@ -0,0 +1,4 @@ +export class Designation { + + designation_id: any; name: any; short_name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/entity-type.ts b/ng6-seed/src/app/settings/masters/model/entity-type.ts new file mode 100644 index 000000000..b8529b433 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/entity-type.ts @@ -0,0 +1,3 @@ +export class EntityType { + entity_type_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/frequency.ts b/ng6-seed/src/app/settings/masters/model/frequency.ts new file mode 100644 index 000000000..26741b3c8 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/frequency.ts @@ -0,0 +1,6 @@ +export class Frequency { + // ID: number; + // Name: string; + + frequency_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/industry_classification.ts b/ng6-seed/src/app/settings/masters/model/industry_classification.ts new file mode 100644 index 000000000..9a0e464e0 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/industry_classification.ts @@ -0,0 +1,16 @@ +export class IndustryClassification { + //ID: number; + //ClassifiedName: string; + // LastName: string; + // Contact: string; + // Email: string; + + industry_classification_id: any; + name: any; + createdon: any; + fk_createdby: any; + updatedon: any; + fk_updatedby: any; + isactive: any; +} + diff --git a/ng6-seed/src/app/settings/masters/model/lender-hierarchy.ts b/ng6-seed/src/app/settings/masters/model/lender-hierarchy.ts new file mode 100644 index 000000000..48751cbf2 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/lender-hierarchy.ts @@ -0,0 +1,4 @@ +export class LenderHierarchy { + lender_hierarchy_id: any; lender_hierarchy: any; createdon: any; fk_createdby: any; updatedon: any; isactive: any; +} + \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/model/members-occupation.ts b/ng6-seed/src/app/settings/masters/model/members-occupation.ts new file mode 100644 index 000000000..c2cd72a9e --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/members-occupation.ts @@ -0,0 +1,11 @@ +export class MembersOccupation { + // ID: number; + // Name: string; + occupation_non_earning_member_id: any; + name: any; + createdon: any; + fk_createdby: any; + updatedon: any; + fk_updatedby: any; + isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/pd.ts b/ng6-seed/src/app/settings/masters/model/pd.ts new file mode 100644 index 000000000..d31d4dfe9 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/pd.ts @@ -0,0 +1,15 @@ +export class PdAllocationType { + pd_allocation_type_id: any; pd_allocation_type_name: any; createdon: any; fk_createdby: any; updatedon: any; isactive: any; +} + +export class PdLocationApproach { + pd_location_approach_id: any; description: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} + +export class PdStatus { + pd_status_id: any; pd_status_name: any; createdon: any; fk_createdby: any; updatedon: any; isactive: any; +} + +export class PdType { + pd_type_id: any; type_name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/model/product-master.ts b/ng6-seed/src/app/settings/masters/model/product-master.ts new file mode 100644 index 000000000..ef2a71765 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/product-master.ts @@ -0,0 +1,16 @@ +export class ProductMaster { +// ID: number; +// ProductName: string; +// ProductAbbr: string; + + product_id: any; + name: any; + abbr: any; + createdon: any; + fk_createdby : any; + updatedon : any; + isactive : any; + fk_updatedby :any; + +} + diff --git a/ng6-seed/src/app/settings/masters/model/regions.ts b/ng6-seed/src/app/settings/masters/model/regions.ts new file mode 100644 index 000000000..7087bb440 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/regions.ts @@ -0,0 +1,3 @@ +export class Regions { + region_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/relation-ship.ts b/ng6-seed/src/app/settings/masters/model/relation-ship.ts new file mode 100644 index 000000000..540da038c --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/relation-ship.ts @@ -0,0 +1,6 @@ +export class RelationShip { + // ID: number; + // Name: string; + + relationship_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/states.ts b/ng6-seed/src/app/settings/masters/model/states.ts new file mode 100644 index 000000000..b65e715d0 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/states.ts @@ -0,0 +1,3 @@ +export class States { + state_id: any; fk_region_id: any; name: any; code: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/sub-product-master.ts b/ng6-seed/src/app/settings/masters/model/sub-product-master.ts new file mode 100644 index 000000000..db7146a28 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/sub-product-master.ts @@ -0,0 +1,8 @@ +export class SubProductMaster { + // ID: number; + // ProductName: string; + // SubProductName: string; + // SubProductAbbr: string; + + subproduct_id: any; fk_product_id: any; name: any; abbr: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/title.ts b/ng6-seed/src/app/settings/masters/model/title.ts new file mode 100644 index 000000000..32e1491d7 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/title.ts @@ -0,0 +1,6 @@ +export class Title { + // ID: number; + // Name: string; + + title_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/uom.ts b/ng6-seed/src/app/settings/masters/model/uom.ts new file mode 100644 index 000000000..b864ee2e4 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/uom.ts @@ -0,0 +1,6 @@ +export class Uom { + // ID: number; + // Name: string; + + uom_id: any; name: any; createdon: any; fk_createdby: any; updatedon: any; fk_updatedby: any; isactive: any; +} diff --git a/ng6-seed/src/app/settings/masters/model/user.ts b/ng6-seed/src/app/settings/masters/model/user.ts new file mode 100644 index 000000000..4747c8979 --- /dev/null +++ b/ng6-seed/src/app/settings/masters/model/user.ts @@ -0,0 +1,8 @@ +export interface User { + name: string; + email: string; + phone: string; + company: { + name: string; + } +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/service/masters/masters.service.spec.ts b/ng6-seed/src/app/settings/service/masters/masters.service.spec.ts new file mode 100644 index 000000000..2550bd5a4 --- /dev/null +++ b/ng6-seed/src/app/settings/service/masters/masters.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { MastersService } from './masters.service'; + +describe('MastersService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [MastersService] + }); + }); + + it('should be created', inject([MastersService], (service: MastersService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/ng6-seed/src/app/settings/service/masters/masters.service.ts b/ng6-seed/src/app/settings/service/masters/masters.service.ts new file mode 100644 index 000000000..a9f771cc1 --- /dev/null +++ b/ng6-seed/src/app/settings/service/masters/masters.service.ts @@ -0,0 +1,217 @@ +/** Common Import Section */ +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs';//for Datatables +import { HttpClient } from '@angular/common/http'; +import { catchError } from 'rxjs/operators'; +import { of } from 'rxjs'; + +/** Imported Service Files Are., */ +import { AwsService } from '../../../AwsService/aws.service'; + + +/** Consant Value For Created Date And Updated Date */ +const currentdate = new Date().toJSON().slice(0,19).replace('T',' '); + +/** Master Interface */ +export interface Master { + master_id:number; + master_name:string; + constant_name:string; +} + +@Injectable() + +export class MastersService { + + + private apiUrl = 'http://localhost/sparqapi/api/'; + + + constructor(private _http: HttpClient, + private _aws:AwsService) { } + + //headers:any = this._shared.headercofig(''); + + /** + * TO Add Master Datas using API Call + * 1st argument is "Records": any - Set of Data To Adding to database + * 2nd argument is "MasterName" :string - Table Name To Store the Records + */ + addMasterDetails(Records: any,MasterName:string): Observable { + + //Records.fk_createdby = this._aws.getlocale();//to get user id for who is created the Record + Records.createdon = currentdate;//to get Current date and Time for when the Record is created + + var ArrayData = { "master_name":MasterName, + "records": Records } + +// var data = this._http.post(this.apiUrl+'saveMaster',ArrayData); +// console.log('from service',data); + +return this._http.post(this.apiUrl+"saveMaster", ArrayData) +.pipe( + catchError(this.handleError('role', [])) + ) + + // return data; + } + + /** + * TO Edit Master Datas using API Call + * 1st argument is "Records": any - Set of Updated Data + * 2nd argument is "MasterName" :string - Table Name + */ + editMasterDetails(Records: any,MasterName:string): Observable { + + //Records.fk_updatedby = this._aws.getlocale();//to get user id for who is update the record + Records.updatedon = currentdate;//to get Current date and Time for when the Record is updated + + var ArrayData = { "master_name":MasterName, + "records": Records } + + var data = this._http.post(this.apiUrl+'saveMaster',ArrayData); + + return data; + + } + + + /** + * TO Inactive the Master Datas using API Call + * Note : Which means To delete The records + * 1st argument is "PrimaryKeyWithValue" : any - Primarykey and its value + * 2nd argument is "MasterName" :string - Table Name + */ + deleteMasterDetails(PrimaryKeyWithValue:any,MasterName:string): Observable { + + //This "otherDatas" Array is common Argument For All Master + let otherDatas:any = {isactive:0, + //fk_updatedby:this._aws.getlocale(), + updatedon:currentdate} + + //This "dataWithPrimaryKey" Array is Mergeing The 'PrimaryKeyWithValue' argument with otherDatas + let dataWithPrimaryKey = Object.assign(otherDatas,PrimaryKeyWithValue); + + var ArrayData = { "master_name":MasterName, + "records":JSON.parse(JSON.stringify(dataWithPrimaryKey)) + } + + var data = this._http.post(this.apiUrl+'saveMaster',ArrayData); + alert(data); + return data; + } + + /** + * TO Get the Master Datas using API Call + * 1st argument is "TableName" :string - Table Name + */ + getAllMasterData(TableName:string): Observable { + return this._http.post(this.apiUrl+"getListOfMaster", { "master_name":TableName }) + .pipe( + catchError(this.handleError('role', [])) + ) + } + + /** + * TO get Branch Data For Listing Screen + */ + getAllBranch(): Observable { + return this._http.get(this.apiUrl+'getListOfBranches') + .pipe( + catchError(this.handleError('role', [])) + ) + + } + + + + /** + * TO get Subproduct Data For Listing Screen + */ + getAllSubProduct(): Observable { + + return this._http.get(this.apiUrl+'getListOfSubProduct') + .pipe( + catchError(this.handleError('role', [])) + ) + + } + + + /** + * TO get State Data For Listing Screen + */ + getAllState(): Observable { + + return this._http.get(this.apiUrl+'getListOfState') + .pipe( + catchError(this.handleError('role', [])) + ) + + + } + + /** + * TO get Company Data For Listing Screen + */ + getAllCompany(): Observable { + + return this._http.get(this.apiUrl+'getListOfCompany') + .pipe( + catchError(this.handleError('role', [])) + ) + + } + + /** + * TO get City Data For Listing Screen + */ + getAllCity(): Observable { + + return this._http.get(this.apiUrl+'getListOfCity') + .pipe( + catchError(this.handleError('role', [])) + ) + +} + + + /** Get All EntityType Data using API call With master Keyword */ + // getAllEntityType(): Observable { + // var EntityTypeArr = { + // "master_name":"ENTITYTYPE", + // } + // return this._http.post(this.apiUrl+'getListOfMaster',EntityTypeArr,{headers:this.headers}) + // .pipe( + // catchError(this.handleError('role', [])) + // ) + // } + + + + /** + * Seperated Records from the res + * argument 'res' : Response + */ + private extractData(res : Response) { + + let Response = res['_body']; + Response = JSON.parse(Response); + + return Response['dataStatus'] === true + ? Response['records'] + : []; + + } + + /** + * TO Handle The Error + */ + private handleError(operation = 'operation', result?: T) { + + return (error: any): Observable => { + return of(result as T); + }; +} + +} \ No newline at end of file diff --git a/ng6-seed/src/app/settings/settings.module.ts b/ng6-seed/src/app/settings/settings.module.ts index f14230f55..373b4af7d 100644 --- a/ng6-seed/src/app/settings/settings.module.ts +++ b/ng6-seed/src/app/settings/settings.module.ts @@ -26,12 +26,14 @@ import { RouterModule } from '@angular/router'; import { SettingsRoutes } from './settings.routing'; import { RegisterComponent } from '../session/register/register.component'; import { UserService } from './service/user.service'; +import { MastersModule } from './masters/masters.module'; // import { HttpClientModule } from '@angular/common/http'; @NgModule({ imports: [ CommonModule, RouterModule.forChild(SettingsRoutes),MatCardModule, + MastersModule, MatIconModule, MatInputModule, MatRadioModule, diff --git a/ng6-seed/src/app/settings/settings.routing.ts b/ng6-seed/src/app/settings/settings.routing.ts index e437d802e..aa7e9bcbe 100644 --- a/ng6-seed/src/app/settings/settings.routing.ts +++ b/ng6-seed/src/app/settings/settings.routing.ts @@ -1,10 +1,14 @@ import { Routes } from '@angular/router'; - +import { MastersModule } from './masters/masters.module'; export const SettingsRoutes: Routes = [{ path: '', children:[{ path:'users', loadChildren:'./users/users.module#UsersModule' - }] + },{ + path:'mastermodule', + loadChildren:'./masters/masters.module#MastersModule' + } +] }] diff --git a/ng6-seed/src/app/shared/menu-items/horizontal-menu-items.ts b/ng6-seed/src/app/shared/menu-items/horizontal-menu-items.ts index 5af4ede9a..8de5b001c 100644 --- a/ng6-seed/src/app/shared/menu-items/horizontal-menu-items.ts +++ b/ng6-seed/src/app/shared/menu-items/horizontal-menu-items.ts @@ -75,6 +75,15 @@ const HORIZONTALMENUITEMS = [ } ] }, + { + state:'setting', + name:'Settings', + type:'sub', + icon:'settings', + children:[ + {state:'mastermodule',name:'Master Details'} + ] + }, { state: 'material', name: 'MATERIAL', diff --git a/ng6-seed/src/app/shared/menu-items/menu-items.ts b/ng6-seed/src/app/shared/menu-items/menu-items.ts index 3e39a50a0..aeca25a4a 100644 --- a/ng6-seed/src/app/shared/menu-items/menu-items.ts +++ b/ng6-seed/src/app/shared/menu-items/menu-items.ts @@ -33,7 +33,7 @@ const MENUITEMS : Menu[] = [ icon:'explore', children:[ {state:'users',name:'User List'}, - + {state:'mastermodule',name:'Master Details'} ] }, {