Example #1
0
        public CELGenerateAppearanceDay(GCAL.ContentServer content)
        {
            GPLocationProvider locProv          = null;
            GPGregorianTime    startWesternTime = null;
            GPGregorianTime    endWesternTime   = null;

            locProv = content.getLocationWithPostfix("");

            if (locProv == null)
            {
                locProv = GPAppHelper.getMyLocation();
            }

            startWesternTime = new GPGregorianTime(locProv);
            startWesternTime.setDate(content.getInt("startyear", startWesternTime.getYear()),
                                     content.getInt("startmonth", startWesternTime.getMonth()),
                                     content.getInt("startday", startWesternTime.getDay()));
            startWesternTime.setDayHours(content.getInt("starthour", startWesternTime.getHour()) / 24.0 + content.getInt("startmin", startWesternTime.getMinuteRound()) / 1440.0);

            SetData(locProv, startWesternTime);
            SyncExecute();

            StringBuilder sb = new StringBuilder();

            FormaterHtml.WriteAppDayHTML_BodyTable(CalculatedObject as GPAppDayResults, sb);
            HtmlText = sb.ToString();
        }
Example #2
0
        public CELGenerateCalendarPlusCore(GCAL.ContentServer content)
        {
            GPLocationProvider locProv          = null;
            GPGregorianTime    startWesternTime = null;
            GPGregorianTime    endWesternTime   = null;

            locProv = content.getLocationWithPostfix("");

            if (locProv == null)
            {
                HtmlText = "<p>Error: location provider is null";
                return;
            }

            startWesternTime = new GPGregorianTime(locProv);
            startWesternTime.setDate(content.getInt("startyear", startWesternTime.getYear()),
                                     content.getInt("startmonth", startWesternTime.getMonth()),
                                     content.getInt("startday", startWesternTime.getDay()));

            GPVedicTime startVedicTime, endVedicTime;
            int         unitType = content.getInt("endperiodtype", 3);
            int         nCount   = content.getInt("endperiodlength", 1);

            GPEngine.VCTIMEtoVATIME(startWesternTime, out startVedicTime, locProv);

            GPEngine.CalcEndDate(locProv, startWesternTime, startVedicTime, out endWesternTime, out endVedicTime, unitType, GPEngine.CorrectedCount(unitType, nCount));

            SetData(locProv, startWesternTime, endWesternTime);
            SyncExecute();

            StringBuilder sb = new StringBuilder();

            FormaterHtml.WriteCalendarPlusCoreHTML_BodyTable(CalculatedObject as GPCalendarPlusEventsResults, sb);
            HtmlText = sb.ToString();
        }
        public CELGenerateCalendarTwoLocs(GCAL.ContentServer content)
        {
            GPLocationProvider locProvA         = null;
            GPLocationProvider locProvB         = null;
            GPGregorianTime    startWesternTime = null;
            GPGregorianTime    endWesternTime   = null;

            locProvA = content.getLocationWithPostfix("a");

            if (locProvA == null)
            {
                locProvA = GPAppHelper.getMyLocation();
            }

            locProvB = content.getLocationWithPostfix("b");

            if (locProvB == null)
            {
                locProvB = GPAppHelper.getMyLocation();
            }

            startWesternTime = new GPGregorianTime(locProvA);
            startWesternTime.setDate(content.getInt("startyear", startWesternTime.getYear()),
                                     content.getInt("startmonth", startWesternTime.getMonth()),
                                     content.getInt("startday", startWesternTime.getDay()));

            GPVedicTime startVedicTime, endVedicTime;
            int         unitType = content.getInt("endperiodtype", 3);
            int         nCount   = content.getInt("endperiodlength", 1);

            GPEngine.VCTIMEtoVATIME(startWesternTime, out startVedicTime, locProvA);

            GPEngine.CalcEndDate(locProvA, startWesternTime, startVedicTime, out endWesternTime, out endVedicTime, unitType, GPEngine.CorrectedCount(unitType, nCount));

            nCount = Convert.ToInt32(endWesternTime.getJulianGreenwichNoon() - startWesternTime.getJulianGreenwichNoon());

            SetData(locProvA, locProvB, startWesternTime, nCount);
            SyncExecute();

            StringBuilder sb = new StringBuilder();

            FormaterHtml.WriteCompareCalendarHTML_BodyTable(CalculatedObject as GPCalendarTwoLocResults, sb);
            HtmlText = sb.ToString();
        }
Example #4
0
        public CELGenerateCalendarTravelling(GCAL.ContentServer content)
        {
            GPLocationProvider locProvA         = null;
            GPLocationProvider locProvB         = null;
            GPGregorianTime    startWesternTime = null;

            //GPGregorianTime endWesternTime = null;

            locProvA = content.getLocationWithPostfix("a");

            if (locProvA == null)
            {
                locProvA = GPAppHelper.getMyLocation();
            }

            locProvB = content.getLocationWithPostfix("b");

            if (locProvB == null)
            {
                locProvB = GPAppHelper.getMyLocation();
            }

            startWesternTime = new GPGregorianTime(locProvA);
            startWesternTime.setDate(content.getInt("startyear", startWesternTime.getYear()),
                                     content.getInt("startmonth", startWesternTime.getMonth()),
                                     content.getInt("startday", startWesternTime.getDay()));

            double travelStart    = content.getInt("starttravelhr", 12) * 1.0 + content.getInt("starttravelmin", 0) / 60.0;
            double travelDuration = content.getInt("durtravelhr", 6) * 1.0 + content.getInt("durtravelmin", 0) / 60.0;

            startWesternTime.setDayHours(travelStart / 24.0);

            SetData(locProvA, locProvB, startWesternTime, travelDuration);
            SyncExecute();

            StringBuilder sb = new StringBuilder();

            FormaterHtml.WriteCalendarHTML(CalculatedObject as GPCalendarResults, sb);
            HtmlText = sb.ToString();
        }
Example #5
0
        public CELGenerateMasaList(GCAL.ContentServer content)
        {
            GPLocationProvider locProv = null;

            locProv = content.getLocationWithPostfix("");

            if (locProv == null)
            {
                locProv = GPAppHelper.getMyLocation();
            }

            SetData(locProv, content.getInt("startyear", 2015), content.getInt("yearcount", 1));
            SyncExecute();

            StringBuilder sb = new StringBuilder();

            FormaterHtml.WriteMasaListHTML_BodyTable(CalculatedObject as GPMasaListResults, sb);
            HtmlText = sb.ToString();
        }
Example #6
0
        public CELGenerateCoreEvents(GCAL.ContentServer content)
        {
            GPLocationProvider locProv          = null;
            GPGregorianTime    startWesternTime = null;
            GPGregorianTime    endWesternTime   = null;

            /*if (content.getString("locationtype") == "selected")
             * {
             *  GPLocation loc = GPLocationList.getShared().findLocationById(content.getInt("locationid"));
             *  if (loc != null)
             *      locProv = new GPLocationProvider(loc);
             * }*/

            locProv = content.getLocationWithPostfix("");

            if (locProv == null)
            {
                locProv = GPAppHelper.getMyLocation();
            }

            startWesternTime = new GPGregorianTime(locProv);
            startWesternTime.setDate(content.getInt("startyear", startWesternTime.getYear()),
                                     content.getInt("startmonth", startWesternTime.getMonth()),
                                     content.getInt("startday", startWesternTime.getDay()));

            GPVedicTime startVedicTime, endVedicTime;
            int         unitType = content.getInt("endperiodtype", 3);
            int         nCount   = content.getInt("endperiodlength", 1);

            GPEngine.VCTIMEtoVATIME(startWesternTime, out startVedicTime, locProv);

            GPEngine.CalcEndDate(locProv, startWesternTime, startVedicTime, out endWesternTime, out endVedicTime, unitType, GPEngine.CorrectedCount(unitType, nCount));

            nCount = Convert.ToInt32(endWesternTime.getJulianGreenwichNoon() - startWesternTime.getJulianGreenwichNoon());

            SetData(locProv, startWesternTime, endWesternTime);
            SyncExecute();

            StringBuilder sb = new StringBuilder();

            FormaterHtml.WriteEventsHTML_BodyTable(CalculatedObject as GPCoreEventResults, sb);
            HtmlText = sb.ToString();
        }