Ejemplo n.º 1
0
        private void btnGoForLiuYear_Click(object sender, EventArgs e)
        {
            int year;
            int yearEarth;
            int cnt;

            year      = Convert.ToInt32(cbLiuYear.Text);
            yearEarth = cc.GetYearEarth(year);


            cnt = p.GetIDForLifeZone() - yearEarth;

            for (int i = 0; i < p.zone_list.Count; i++)
            {
                if (cnt >= 0)
                {
                    p.zone_list[i].dou = DouUtility.WiddershinsCountZone(p.zone_list[i].dou, cnt);
                }
                else
                {
                    p.zone_list[i].dou = DouUtility.DeasilCountZone(p.zone_list[i].dou, Math.Abs(cnt));
                }
            }

            p.LiuYearSky = cc.GetYearSky(Convert.ToInt32(this.cbLiuYear.SelectedItem));
            p.SetLiuYao();


            ucDouYear.LoadInfo(this.p);
            ucDouYear.DisplayBodyPlate();
            ucDouYear.DisplayAllLiuYao();
        }
Ejemplo n.º 2
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            //DouManager dm = new DouManager();
            //dm.CreatePlate(1983,5,13,5,1,1,"Ming","Deng");

            //MessageBox.Show(DouUtility.DeasilCountZone(0, 3).ToString());
            StarList.Load();

            p = new Plate();
            // p.LiuYear = Convert.ToInt32(this.cbLiuYear.SelectedItem);
            ChineseCalendar cc = new ChineseCalendar();

            p.LiuYearSky = cc.GetYearSky(Convert.ToInt32(this.cbLiuYear.SelectedItem));

            p.YearSky    = cbYesrSky.SelectedIndex;
            p.YearEarth  = cbYearEarth.SelectedIndex;
            p.month      = cbMonth.SelectedIndex;
            p.day        = cbDay.SelectedIndex;
            p.hour       = cbHour.SelectedIndex;
            p.Sex        = cbSex.SelectedIndex;
            p.Type       = 0;
            p.first_name = "";
            p.CreatePlate();


            //p.CreatePlate(cbYesrSky.SelectedIndex, cbYearEarth.SelectedIndex, cbMonth.SelectedIndex, cbDay.SelectedIndex, cbHour.SelectedIndex, cbSex.SelectedIndex, 0, tbName.Text, "");


            this.bodyDou.LoadInfo(p);
            this.bodyDou.DisplayBodyPlate();

            this.ucDouYear.LoadInfo(p);
            this.ucDouYear.DisplayBodyPlate();

            tabControl1.SelectedTab = tabPage1;
        }