コード例 #1
0
        public static void BirthdayHint(object sender, EventArgs e)
        {
            BaseMainForm    form    = sender as BaseMainForm;
            CarStartSetting setting = FT.Commons.Cache.StaticCacheManager.GetConfig <CarStartSetting>();

            if (setting.BirthDayHint)
            {
                DateTime before = System.DateTime.Now;
                DateTime end    = System.DateTime.Now.AddDays(setting.Days);
                //c_birthday
                IDataAccess access    = DataAccessFactory.GetDataAccess();
                string      condition = access.BetweenDateString(
                    "c_birthday", before, end);
                DataTable dt = access.SelectDataTable("select * from table_cards where " + condition, "tmp");
                if (dt != null && dt.Rows.Count > 0)
                {
                    if (MessageBoxHelper.Confirm("有" + dt.Rows.Count + "人将在最近" + setting.Days + "天内过生日,是否查看?"))
                    {
                        form.GetSimpleTabControl().TabPages.Add("将过生日人员    ");
                        //TabPage tb = new TabPage();
                        //this.form.GetSimpleTabControl().TabPages.Add(tb);
                        TabPage tb = form.GetSimpleTabControl().TabPages[form.GetSimpleTabControl().TabPages.Count - 1];

                        //object paneltmp = ReflectHelper.CreateInstance(typeof(FT.Lottery.LotteryParse));

                        PersonCardSearch panel = new PersonCardSearch();
                        panel.SetConditions(condition);
                        panel.Dock = DockStyle.Fill;
                        tb.Controls.Add(panel);
                        form.GetSimpleTabControl().SelectedIndex =
                            form.GetSimpleTabControl().TabCount - 1;
                    }
                }
            }
        }