Beispiel #1
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();
        }
Beispiel #2
0
        public CELGenerateCalendar(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()));

            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, nCount);
            SyncExecute();

            StringBuilder sb = new StringBuilder();

            FormaterHtml.WriteCalendarHTML_BodyTable(CalculatedObject as GPCalendarResults, sb);
            HtmlText = sb.ToString();
        }