Пример #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();
        }
Пример #2
0
        private void Recalculatedate()
        {
            GPEngine.CalcEndDate(location, startWesternTime, startVedicTime, out endWesternTime, out endVedicTime, unitType, CorrectedCount(nCount));

            string template = "Start date: [start.western] - [start.vedic]\nEnddate: [end.western] - [end.vedic]";

            template = template.Replace("[start.western]", startWesternTime.ToString());
            template = template.Replace("[start.vedic]", startVedicTime.ToString());
            template = template.Replace("[end.western]", endWesternTime.ToString());
            template = template.Replace("[end.vedic]", endVedicTime.ToString());

            label3.Text = startWesternTime.ToString();
            label4.Text = startVedicTime.ToString();

            label6.Text = endWesternTime.ToString();
            label7.Text = endVedicTime.ToString();
        }
Пример #3
0
 private void VedicChanged()
 {
     if (keepSycnhro)
     {
         int gyear;
         keepSycnhro = false;
         if (location != null && int.TryParse(textBox2.Text, out gyear))
         {
             GPGregorianTime vc = null;
             GPVedicTime     va = new GPVedicTime(comboBox3.SelectedIndex, GPAppHelper.ComboMasaToMasa(comboBox4.SelectedIndex), gyear);
             GPEngine.VATIMEtoVCTIME(va, out vc, location);
             comboBox2.SelectedIndex = vc.getMonth() - 1;
             textBox1.Text           = vc.getYear().ToString();
             comboBox1.SelectedIndex = vc.getDay() - 1;
         }
         keepSycnhro = true;
     }
 }
Пример #4
0
        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();
        }
Пример #5
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();
        }
Пример #6
0
 private void WesternChanged()
 {
     if (keepSycnhro)
     {
         int year;
         keepSycnhro = false;
         if (location != null && int.TryParse(textBox1.Text, out year))
         {
             GPVedicTime     va = null;
             GPGregorianTime vc = new GPGregorianTime(location);
             vc.setDate(year, comboBox2.SelectedIndex + 1, comboBox1.SelectedIndex + 1);
             vc.setDayHours(0.0);
             GPEngine.VCTIMEtoVATIME(vc, out va, location);
             comboBox3.SelectedIndex = va.tithi;
             comboBox4.SelectedIndex = GPAppHelper.MasaToComboMasa(va.masa);
             textBox2.Text           = va.gyear.ToString();
         }
         keepSycnhro = true;
     }
 }