Ejemplo n.º 1
0
        public FormMain()
        {
            InitializeComponent();
            administrator.Id = "1";
            user1.Id         = "2";
            user2.Id         = "3";
            user3.Id         = "4";
            if (currentClient == null)
            {
                this.signOutButton.Visible = false;
                this.signOutButton.Enabled = false;
            }
            if (ClientService.AllClients().Count == 0)
            {
                ClientService.AddAdministrator(administrator);
                ClientService.AddAdministrator(user1);
                ClientService.AddAdministrator(user2);
                ClientService.AddAdministrator(user3);
            }
            this.managePictureBox.Visible = false;
            this.accountButton.Visible    = false;
            this.libraryButton.Visible    = false;
            //this.managePictureBox.Enabled = false;
            if (BookShelfService.AllBooks().Count == 0)//设置初始值
            {
                Test.Test1();
                Test.Test2();
            }
            //MessageBox.Show("1");
            Year  = DateTime.Now.Year;
            Month = DateTime.Now.Month;
            String time = DateTime.Now.ToLongDateString().ToString();
            int    m    = time.IndexOf("月");
            int    d    = time.IndexOf("日");

            Day = DateTime.Now.Day;
            BookShelfService.Check(Year, Month, Day);
            recommendBooks = BookShelfService.getRecommend();
            recommendBindingSource.DataSource = recommendBooks;
        }
Ejemplo n.º 2
0
 public void resetRecommend()
 {
     this.recommendBindingSource.DataSource = BookShelfService.getRecommend();
 }