示例#1
0
        public Main(Login login)
        {
            InitializeComponent();
            this.login      = login;
            this.db         = login.database;
            this.KeyPreview = true;
            updateMenu();

            AddValue        addValue = new AddValue(this);
            MaintainMenu    mMenu    = new MaintainMenu(this);
            MaintainMenu_v2 mMenu_v2 = new MaintainMenu_v2(this);
            MaintainUser    mUser    = new MaintainUser(this);

            kitchenView kcv = new kitchenView(login);

            Form[] temp = { addValue, mMenu_v2, mUser, kcv };
            frm = temp;
            int       count      = 0;
            DataTable dt_student = db.getDb("student where status not in('refund','freeze')");

            for (int i = 0; i < dt_student.Rows.Count; i++)
            {
                DateTime create = DateTime.Parse(dt_student.Rows[i]["createAt"].ToString());
                if (create.AddYears(2).ToShortDateString().Equals(DateTime.Now.ToShortDateString()))
                {
                    String s = "Update student set status ='refund' where stuid='" + dt_student.Rows[i]["stuid"].ToString() + "'";
                    db.queny(s);
                    count++;
                }
            }
            MessageBox.Show("There are " + count + " students' status change to refund.");

            string subPath = "Menu"; // your code goes here

            System.IO.Directory.CreateDirectory(subPath);
            string menuday = "1Monday";

            System.IO.Directory.CreateDirectory(subPath + "\\" + menuday);
            menuday = "2Tuesday";
            System.IO.Directory.CreateDirectory(subPath + "\\" + menuday);
            menuday = "3Wednesday";
            System.IO.Directory.CreateDirectory(subPath + "\\" + menuday);
            menuday = "4Thursday";
            System.IO.Directory.CreateDirectory(subPath + "\\" + menuday);
            menuday = "5Friday";
            System.IO.Directory.CreateDirectory(subPath + "\\" + menuday);
            menuday = "6Saturday";
            System.IO.Directory.CreateDirectory(subPath + "\\" + menuday);
            menuday = "7Sunday";
            System.IO.Directory.CreateDirectory(subPath + "\\" + menuday);
        }
示例#2
0
        private void btn_foodlist_Click(object sender, EventArgs e)
        {
            MaintainMenu menu = new MaintainMenu(main);

            menu.ShowDialog();
        }
示例#3
0
 public FoodType(MaintainMenu menu)
 {
     InitializeComponent();
     this.menu = menu;
     db        = menu.db;
 }