Exemplo n.º 1
0
 public void DisplayChineseDate()
 {
     if (Vaildate() == 0)
     {
         return;
     }
     dt = Convert.ToDateTime(cbNewYear.SelectedItem.ToString() + "-" + cbNewMonth.SelectedItem.ToString() + "-" + cbNewDay.SelectedItem.ToString());
     cc = new ChineseCalendar(dt);
     InitOldCalendar();
 }
Exemplo 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;
        }
Exemplo n.º 3
0
        private void FrmDou_Load(object sender, EventArgs e)
        {
            int i, j, k;

            List <User> userlist = UserList.FindAll();

            dgvUserInfoList.DataSource = userlist;

            for (i = 0; i < userlist.Count; i++)
            {
                //
            }


            cc = new ChineseCalendar(dt);

            //性别
            for (i = 0; i < DouSource.SEX.Length; i++)
            {
                cbSex.Items.Add(DouSource.SEX[i]);
            }

            // LoadSex();

            //公历年
            for (i = 0; i < 145; i++)
            {
                cbNewYear.Items.Add(1901 + i);
                cbLiuYear.Items.Add(1901 + i);
            }



            //公历月
            for (i = 0; i < 12; i++)
            {
                cbNewMonth.Items.Add(i + 1);
            }

            //公历日
            for (i = 0; i < 31; i++)
            {
                cbNewDay.Items.Add(i + 1);
            }

            //农历年
            for (i = 0; i < DouSource.SKY.Length; i++)
            {
                cbYesrSky.Items.Add(DouSource.SKY[i]);
            }

            for (i = 0; i < DouSource.EARTH.Length; i++)
            {
                cbYearEarth.Items.Add(DouSource.EARTH[i]);
            }

            //农历月
            for (i = 0; i < 12; i++)
            {
                cbMonth.Items.Add(i + 1);
            }

            //农历日
            for (i = 0; i < 31; i++)
            {
                cbDay.Items.Add(i + 1);
            }

            // 农历时辰
            string temp = "";

            for (i = 0; i < DouSource.HourContent.Length; i++)
            {
                temp = DouSource.HourContent[i];
                cbHour.Items.Add(temp);
            }

            InitNewCalendar();
            InitOldCalendar();
            InitLiu();
            DisplayChineseDate();
            LoadUserList();
        }