123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729 |
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- };
- var Bizgaze;
- (function (Bizgaze) {
- let Apps;
- (function (Apps) {
- let Hrms;
- (function (Hrms) {
- let Components;
- (function (Components) {
- class ShiftCalender extends Unibase.Platform.Core.BaseComponent {
- constructor() {
- super(...arguments);
- this.holidaycalendar = new Array();
- this.firstweekcheckedarray = [];
- this.secondweekcheckedarray = [];
- this.thirdweekcheckedarray = [];
- this.fourthweekcheckedarray = [];
- this.fifththweekcheckedarray = [];
- }
- init(formpropertyid, prop, callback) {
- var instance = this;
- this.holidaycalendar = [];
- this.firstweekcheckedarray = [];
- this.secondweekcheckedarray = [];
- this.thirdweekcheckedarray = [];
- this.fourthweekcheckedarray = [];
- this.fifththweekcheckedarray = [];
- $('#SelectAllSunday').change(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(".Sunday").prop("checked", true);
- }
- else {
- $(".Sunday").prop("checked", false);
- }
- });
- $(".Sunday").click(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- }
- else {
- $(this).prop("checked", false);
- }
- });
- $('#SelectAllMonday').change(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(".Monday").prop("checked", true);
- }
- else {
- $(".Monday").prop("checked", false);
- }
- });
- $(".Monday").click(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- }
- else {
- $(this).prop("checked", false);
- }
- });
- $('#SelectAllTuesday').change(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(".Tuesday").prop("checked", true);
- }
- else {
- $(".Tuesday").prop("checked", false);
- }
- });
- $(".Tuesday").click(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- }
- else {
- $(this).prop("checked", false);
- }
- });
- $('#SelectAllWednesday').change(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(".Wednesday").prop("checked", true);
- }
- else {
- $(".Wednesday").prop("checked", false);
- }
- });
- $(".Wednesday").click(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- }
- else {
- $(this).prop("checked", false);
- }
- });
- $('#SelectAllThursday').change(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(".Thursday").prop("checked", true);
- }
- else {
- $(".Thursday").prop("checked", false);
- }
- });
- $(".Thursday").click(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- }
- else {
- $(this).prop("checked", false);
- }
- });
- $('#SelectAllFriday').change(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(".Friday").prop("checked", true);
- }
- else {
- $(".Friday").prop("checked", false);
- }
- });
- $(".Friday").click(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- }
- else {
- $(this).prop("checked", false);
- }
- });
- $('#SelectAllSaturday').change(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(".Saturday").prop("checked", true);
- }
- else {
- $(".Saturday").prop("checked", false);
- }
- });
- $(".Saturday").click(function () {
- let checkelemnt = $(this).is(':checked');
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- }
- else {
- $(this).prop("checked", false);
- }
- });
- $(".fifthweek").click(function () {
- let checkelemnt = $(this).is(':checked');
- let day = $(this).val();
- var splt = day.toString().split(':');
- let dayname = splt[0];
- let dayval = Boolean(splt[1]);
- let weekday = { [dayname]: dayval };
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- instance.fifththweekcheckedarray.push({ [dayname]: dayval });
- console.log(instance.fifththweekcheckedarray);
- }
- else {
- $(this).prop("checked", false);
- let newArray = [];
- for (let i = 0; i < instance.fifththweekcheckedarray.length; i++) {
- if (JSON.stringify(instance.fifththweekcheckedarray[i]) !== JSON.stringify(weekday)) {
- newArray.push(instance.fifththweekcheckedarray[i]);
- }
- }
- instance.fifththweekcheckedarray = [];
- instance.fifththweekcheckedarray = newArray;
- console.log(instance.fifththweekcheckedarray);
- }
- });
- $(".firstweek").click(function () {
- let checkelemnt = $(this).is(':checked');
- let day = $(this).val();
- var splt = day.toString().split(':');
- let dayname = splt[0];
- let dayval = Boolean(splt[1]);
- let weekday = { [dayname]: dayval };
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- instance.firstweekcheckedarray.push({ [dayname]: dayval });
- console.log(instance.firstweekcheckedarray);
- }
- else {
- $(this).prop("checked", false);
- let newArray = [];
- for (let i = 0; i < instance.firstweekcheckedarray.length; i++) {
- if (JSON.stringify(instance.firstweekcheckedarray[i]) != JSON.stringify(weekday)) {
- newArray.push(instance.firstweekcheckedarray[i]);
- }
- }
- instance.firstweekcheckedarray = [];
- instance.firstweekcheckedarray = newArray;
- console.log(instance.firstweekcheckedarray);
- }
- });
- $(".secondweek").click(function () {
- let checkelemnt = $(this).is(':checked');
- let day = $(this).val();
- var splt = day.toString().split(':');
- let dayname = splt[0];
- let dayval = Boolean(splt[1]);
- let weekday = { [dayname]: dayval };
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- instance.secondweekcheckedarray.push({ [dayname]: dayval });
- console.log(instance.secondweekcheckedarray);
- }
- else {
- $(this).prop("checked", false);
- let newArray = [];
- for (let i = 0; i < instance.secondweekcheckedarray.length; i++) {
- if (JSON.stringify(instance.secondweekcheckedarray[i]) !== JSON.stringify(weekday)) {
- newArray.push(instance.secondweekcheckedarray[i]);
- }
- }
- instance.secondweekcheckedarray = [];
- instance.secondweekcheckedarray = newArray;
- console.log(instance.secondweekcheckedarray);
- }
- });
- $(".thirdweek").click(function () {
- let checkelemnt = $(this).is(':checked');
- let day = $(this).val();
- var splt = day.toString().split(':');
- let dayname = splt[0];
- let dayval = Boolean(splt[1]);
- let weekday = { [dayname]: dayval };
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- instance.thirdweekcheckedarray.push({ [dayname]: dayval });
- console.log(instance.thirdweekcheckedarray);
- }
- else {
- $(this).prop("checked", false);
- let newArray = [];
- for (let i = 0; i < instance.thirdweekcheckedarray.length; i++) {
- if (JSON.stringify(instance.thirdweekcheckedarray[i]) !== JSON.stringify(weekday)) {
- newArray.push(instance.thirdweekcheckedarray[i]);
- }
- }
- instance.thirdweekcheckedarray = [];
- instance.thirdweekcheckedarray = newArray;
- console.log(instance.thirdweekcheckedarray);
- }
- });
- $(".fourthweek").click(function () {
- let checkelemnt = $(this).is(':checked');
- let day = $(this).val();
- var splt = day.toString().split(':');
- let dayname = splt[0];
- let dayval = Boolean(splt[1]);
- let weekday = { [dayname]: dayval };
- if (checkelemnt == true) {
- $(this).prop("checked", true);
- instance.fourthweekcheckedarray.push({ [dayname]: dayval });
- console.log(instance.fourthweekcheckedarray);
- }
- else {
- $(this).prop("checked", false);
- let newArray = [];
- for (let i = 0; i < instance.fourthweekcheckedarray.length; i++) {
- if (JSON.stringify(instance.fourthweekcheckedarray[i]) !== JSON.stringify(weekday)) {
- newArray.push(instance.fourthweekcheckedarray[i]);
- }
- }
- instance.fourthweekcheckedarray = [];
- instance.fourthweekcheckedarray = newArray;
- console.log(instance.fourthweekcheckedarray);
- }
- });
- if (callback != null) {
- callback();
- }
- }
- loadControl(containerid, prop) {
- $("." + containerid).empty();
- let html = `<div class="card">
- <div class="card-header card-header-action">
- <div class="col-12">
- <span class="h6 ml-10">
- Weekend Definition
- </span>
-
- </div>
- </div>
- <div class="card-body" style="overflow-x:auto;">
-
- <table class="bg-white" id="bizgazecrm_Routes_tbl_DayWise" style="border: 1px solid #c6c6c6;text-align: left; border-collapse: collapse;width: 100%; ">
- <thead>
- <tr style="border: 1px solid #c6c6c6;" class="list-item-main-title">
- <td style="border: 1px solid #c6c6c6;padding: 15px;" rowspan="2"> Days</td>
- <td style="text-align:center;border: 1px solid #c6c6c6;padding:10px" colspan="6">Weeks</td>
- </tr>
- <tr style="border: 1px solid #c6c6c6;text-align;font-weight:500" >
- <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">All</td>
- <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">1st</td>
- <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">2nd</td>
- <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">3rd</td>
- <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">4th</td>
- <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">5th</td>
- </tr>
- </thead>
-
- <tr>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Sunday</td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllSunday" name="Sunday" value="" class="SelectAllSunday"></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Sunday firstweek" id="1stSunday" name="1stSunday" value=Sunday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday secondweek" id="2ndSunday" name="2ndSunday" value=Sunday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday thirdweek" id="3rdSunday" name="3rdSunday" value=Sunday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday fourthweek" id="4thSunday" name="4thSunday" value=Sunday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday fifthweek" id="5thSunday" name="5thSunday" value=Sunday:true></td>
- </tr>
- <tr>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Monday</td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllMonday" name="Monday" value="" class="SelectAllMonday"></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Monday firstweek" id="1stMonday" name="1stMonday" value=Monday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday secondweek" id="2ndMonday" name="2ndMonday" value=Monday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday thirdweek" id="3rdMonday" name="3rdMonday" value=Monday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday fourthweek" id="4thMonday" name="4thMonday" value=Monday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday fifthweek" id="5thMonday" name="5thMonday" value=Monday:true></td>
- </tr>
- <tr>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Tuesday</td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllTuesday" name="Tuesday" value="" class="SelectAllTuesday"></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Tuesday firstweek" id="1stTuesday" name="1stTuesday" value=Tuesday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday secondweek" id="2ndTuesday" name="2ndTuesday" value=Tuesday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday thirdweek" id="3rdTuesday" name="3rdTuesday" value=Tuesday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday fourthweek" id="4thTuesday" name="4thTuesday" value=Tuesday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday fifthweek" id="5thTuesday" name="5thTuesday" value=Tuesday:true></td>
- </tr>
- <tr>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Wednesday</td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllWednesday" name="Wednesday" value="" class="SelectAllWednesday"></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Wednesday firstweek" id="1stWednesday" name="1stWednesday" value=Wednesday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday secondweek" id="2ndWednesday" name="2ndWednesday" value=Wednesday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday thirdweek" id="3rdWednesday" name="3rdWednesday" value=Wednesday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday fourthweek" id="4thWednesday" name="4thWednesday" value=Wednesday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday fifthweek" id="5thWednesday" name="5thWednesday" value=Wednesday:true></td>
- </tr>
- <tr>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Thursday</td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllThursday" name="Thursday" value="" class="SelectAllThursday"></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Thursday firstweek" id="1stThursday" name="1stThursday" value=Thursday:1></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday secondweek" id="2ndThursday" name="2ndThursday" value=Thursday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday thirdweek" id="3rdThursday" name="3rdThursday" value=Thursday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday fourthweek" id="4thThursday" name="4thThursday" value=Thursday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday fifthweek" id="5thThursday" name="5thThursday" value=Thursday:true></td>
- </tr>
- <tr>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Friday</td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllFriday" name="Friday" value="" class="SelectAllFriday"></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Friday firstweek" id="1stFriday" name="1stFriday" value=Friday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday secondweek" id="2ndFriday" name="2ndFriday" value=Friday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday thirdweek" id="3rdFriday" name="3rdFriday" value=Friday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday fourthweek" id="4thFriday" name="4thFriday" value=Friday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday fifthweek" id="5thFriday" name="5thFriday" value=Friday:true></td>
- </tr>
- <tr>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Saturday</td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllSaturday" name="Saturday" value="AllSundays" class="SelectAllSaturday"></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Saturday firstweek" id="1stSaturday" name="1stSaturday" value=Saturday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday secondweek" id="2ndSaturday" name="2ndSaturday" value=Saturday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday thirdweek" id="3rdSaturday" name="3rdSaturday" value=Saturday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday fourthweek" id="4thSaturday" name="4thSaturday" value=Saturday:true></td>
- <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday fifthweek" id="5thSaturday" name="5thSaturday" value=Saturday:true></td>
- </tr>
- <input type="hidden" id="hdn_HolidayCalendarControl" class="value-control" value=" Bizgaze.Apps.Hrms.Components.ShiftCalender.Instance().HolidayCalendarobjitems();">
-
-
- </table>
- </div>
- </div>`;
- $("#" + containerid).html(html);
- }
- loadControlSettings(controlsettingjson, formpropertyid) {
- return null;
- }
- loadPropertySettings(propertysettings, formpropertyid, DocPropertyName) {
- return null;
- }
- bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
- var id = Number(propval);
- var instance = this;
- var jsfiles = ['apps/hrms/managers/holidaymanager.js'];
- instance.fileCacheHelper.loadJsFiles(jsfiles, function (response) {
- Bizgaze.Apps.Hrms.Managers.HolidayManager.Instance().getHolidayCalendar(id).then(function (response) {
- if (response.result.length > 0) {
- var data = response.result;
- var everysunday = data[0].everysunday;
- var everymonday = data[0].everymonday;
- var everytuesday = data[0].everytuesday;
- var everywednesday = data[0].everywednesday;
- var everythursday = data[0].everythursday;
- var everyfriday = data[0].everyfriday;
- var everysaturday = data[0].everysaturday;
- if (everysunday == true) {
- $(".Sunday").prop("checked", true);
- $("#SelectAllSunday").prop("checked", true);
- }
- else {
- $(".Sunday").prop("checked", false);
- $("#SelectAllSunday").prop("checked", false);
- }
- if (everymonday == true) {
- $(".Monday").prop("checked", true);
- $("#SelectAllMonday").prop("checked", true);
- }
- else {
- $(".Monday").prop("checked", false);
- $("#SelectAllMonday").prop("checked", false);
- }
- if (everytuesday == true) {
- $(".Tuesday").prop("checked", true);
- $("#SelectAllTuesday").prop("checked", true);
- }
- else {
- $(".Tuesday").prop("checked", false);
- $("#SelectAllTuesday").prop("checked", false);
- }
- if (everywednesday == true) {
- $(".Wednesday").prop("checked", true);
- $("#SelectAllWednesday").prop("checked", true);
- }
- else {
- $(".Wednesday").prop("checked", false);
- $("#SelectAllWednesday").prop("checked", false);
- }
- if (everythursday == true) {
- $(".Thursday").prop("checked", true);
- $("#SelectAllThursday").prop("checked", true);
- }
- else {
- $(".Thursday").prop("checked", false);
- $("#SelectAllThursday").prop("checked", false);
- }
- if (everyfriday == true) {
- $(".Friday").prop("checked", true);
- $("#SelectAllFriday").prop("checked", true);
- }
- else {
- $(".Friday").prop("checked", false);
- $("#SelectAllFriday").prop("checked", false);
- }
- if (everysaturday == true) {
- $(".Saturday").prop("checked", true);
- $("#SelectAllSaturday").prop("checked", true);
- }
- else {
- $(".Saturday").prop("checked", false);
- $("#SelectAllSaturday").prop("checked", false);
- }
- }
- instance.getCalenderWeekItems(id);
- });
- });
- }
- getCalenderWeekItems(id) {
- return __awaiter(this, void 0, void 0, function* () {
- let instance = this;
- yield Bizgaze.Apps.Hrms.Managers.HolidayManager.Instance().getCalendarWeekItems(id).then(function (response) {
- if (response.result.length > 0) {
- for (var i = 0; i < response.result.length; i++) {
- var data = response.result[i];
- let weekid = data.weekid;
- var sunday = data.sunday;
- var monday = data.monday;
- var tuesday = data.tuesday;
- var wednesday = data.wednesday;
- var thursday = data.thursday;
- var friday = data.friday;
- var saturday = data.saturday;
- if (weekid == 1) {
- if (sunday == true) {
- $("#1stSunday").prop("checked", true);
- instance.firstweekcheckedarray.push({ Sunday: true });
- }
- if (monday == true) {
- $("#1stMonday").prop("checked", true);
- instance.firstweekcheckedarray.push({ Monday: true });
- }
- if (tuesday == true) {
- $("#1stTuesday").prop("checked", true);
- instance.firstweekcheckedarray.push({ Tuesday: true });
- }
- if (wednesday == true) {
- $("#1stWednesday").prop("checked", true);
- instance.firstweekcheckedarray.push({ Wednesday: true });
- }
- if (thursday == true) {
- $("#1stThursday").prop("checked", true);
- instance.firstweekcheckedarray.push({ Thursday: true });
- }
- if (friday == true) {
- $("#1stFriday").prop("checked", true);
- instance.firstweekcheckedarray.push({ Friday: true });
- }
- if (saturday == true) {
- $("#1stSaturday").prop("checked", true);
- instance.firstweekcheckedarray.push({ Saturday: true });
- }
- }
- else if (weekid == 2) {
- if (sunday == true) {
- $("#2ndSunday").prop("checked", true);
- instance.secondweekcheckedarray.push({ Sunday: true });
- }
- if (monday == true) {
- $("#2ndMonday").prop("checked", true);
- instance.secondweekcheckedarray.push({ Monday: true });
- }
- if (tuesday == true) {
- $("#2ndTuesday").prop("checked", true);
- instance.secondweekcheckedarray.push({ Tuesday: true });
- }
- if (wednesday == true) {
- $("#2ndWednesday").prop("checked", true);
- instance.secondweekcheckedarray.push({ Wednesday: true });
- }
- if (thursday == true) {
- $("#2ndThursday").prop("checked", true);
- instance.secondweekcheckedarray.push({ Thursday: true });
- }
- if (friday == true) {
- $("#2ndFriday").prop("checked", true);
- instance.secondweekcheckedarray.push({ Friday: true });
- }
- if (saturday == true) {
- $("#2ndSaturday").prop("checked", true);
- instance.secondweekcheckedarray.push({ Saturday: true });
- }
- }
- else if (weekid == 3) {
- if (sunday == true) {
- $("#3rdSunday").prop("checked", true);
- instance.thirdweekcheckedarray.push({ Sunday: true });
- }
- if (monday == true) {
- $("#3rdMonday").prop("checked", true);
- instance.thirdweekcheckedarray.push({ Monday: true });
- }
- if (tuesday == true) {
- $("#3rdTuesday").prop("checked", true);
- instance.thirdweekcheckedarray.push({ Tuesday: true });
- }
- if (wednesday == true) {
- $("#3rdWednesday").prop("checked", true);
- instance.thirdweekcheckedarray.push({ Wednesday: true });
- }
- if (thursday == true) {
- $("#3rdThursday").prop("checked", true);
- instance.thirdweekcheckedarray.push({ Thursday: true });
- }
- if (friday == true) {
- $("#3rdFriday").prop("checked", true);
- instance.thirdweekcheckedarray.push({ Friday: true });
- }
- if (saturday == true) {
- $("#3rdSaturday").prop("checked", true);
- instance.thirdweekcheckedarray.push({ Saturday: true });
- }
- }
- else if (weekid == 4) {
- if (sunday == true) {
- $("#4thSunday").prop("checked", true);
- instance.fourthweekcheckedarray.push({ Sunday: true });
- }
- if (monday == true) {
- $("#4thMonday").prop("checked", true);
- instance.fourthweekcheckedarray.push({ Monday: true });
- }
- if (tuesday == true) {
- $("#4thTuesday").prop("checked", true);
- instance.fourthweekcheckedarray.push({ Tuesday: true });
- }
- if (wednesday == true) {
- $("#4thWednesday").prop("checked", true);
- instance.fourthweekcheckedarray.push({ Wednesday: true });
- }
- if (thursday == true) {
- $("#4thThursday").prop("checked", true);
- instance.fourthweekcheckedarray.push({ Thursday: true });
- }
- if (friday == true) {
- $("#4thFriday").prop("checked", true);
- instance.fourthweekcheckedarray.push({ Friday: true });
- }
- if (saturday == true) {
- $("#4thSaturday").prop("checked", true);
- instance.fourthweekcheckedarray.push({ Saturday: true });
- }
- }
- else if (weekid == 5) {
- if (sunday == true) {
- $("#5thSunday").prop("checked", true);
- instance.fifththweekcheckedarray.push({ Sunday: true });
- }
- if (monday == true) {
- $("#5thMonday").prop("checked", true);
- instance.fifththweekcheckedarray.push({ Monday: true });
- }
- if (tuesday == true) {
- $("#5thTuesday").prop("checked", true);
- instance.fifththweekcheckedarray.push({ Tuesday: true });
- }
- if (wednesday == true) {
- $("#5thWednesday").prop("checked", true);
- instance.fifththweekcheckedarray.push({ Wednesday: true });
- }
- if (thursday == true) {
- $("#5thThursday").prop("checked", true);
- instance.fifththweekcheckedarray.push({ Thursday: true });
- }
- if (friday == true) {
- $("#5thFriday").prop("checked", true);
- instance.fifththweekcheckedarray.push({ Friday: true });
- }
- if (saturday == true) {
- $("#5thSaturday").prop("checked", true);
- instance.fifththweekcheckedarray.push({ Saturday: true });
- }
- }
- }
- }
- });
- });
- }
- HolidayCalendarobj() {
- let instance = this;
- var allsundays;
- var allmondays;
- var alltuesdays;
- var allwednesdays;
- var allthursdays;
- var allfridays;
- var allsaturdays;
- if ($("#SelectAllSunday").is(':checked')) {
- allsundays = true;
- }
- else {
- allsundays = false;
- }
- if ($("#SelectAllMonday").is(':checked')) {
- allmondays = true;
- }
- else {
- allmondays = false;
- }
- if ($("#SelectAllTuesday").is(':checked')) {
- alltuesdays = true;
- }
- else {
- alltuesdays = false;
- }
- if ($("#SelectAllWednesday").is(':checked')) {
- allwednesdays = true;
- }
- else {
- allwednesdays = false;
- }
- if ($("#SelectAllThursday").is(':checked')) {
- allthursdays = true;
- }
- else {
- allthursdays = false;
- }
- if ($("#SelectAllFriday").is(':checked')) {
- allfridays = true;
- }
- else {
- allfridays = false;
- }
- if ($("#SelectAllSaturday").is(':checked')) {
- allsaturdays = true;
- }
- else {
- allsaturdays = false;
- }
- instance.holidaycalendar.push({
- AllSundays: allsundays,
- AllMondays: allmondays,
- AllTuesdays: alltuesdays,
- AllWednesdays: allwednesdays,
- AllThursdays: allthursdays,
- AllFridays: allfridays,
- AllSaturdays: allsaturdays
- });
- }
- HolidayCalendarobjitems() {
- let instance = this;
- instance.HolidayCalendarobj();
- var holidaycalendaritems = new Array();
- holidaycalendaritems.push({
- AllWeeks: instance.holidaycalendar,
- FirstWeek: instance.firstweekcheckedarray,
- SecondWeek: instance.secondweekcheckedarray,
- ThirdWeek: instance.thirdweekcheckedarray,
- FourthWeek: instance.fourthweekcheckedarray,
- FifthWeek: instance.fifththweekcheckedarray
- });
- return holidaycalendaritems;
- }
- static Instance() {
- if (this.instance === undefined) {
- this.instance = new ShiftCalender();
- }
- return this.instance;
- }
- }
- Components.ShiftCalender = ShiftCalender;
- })(Components = Hrms.Components || (Hrms.Components = {}));
- })(Hrms = Apps.Hrms || (Apps.Hrms = {}));
- })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
- })(Bizgaze || (Bizgaze = {}));
|