Exemplo n.º 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);
        }
Exemplo n.º 2
0
 private void btn_ViewOrder_Click(object sender, EventArgs e)
 {
     Screen[] sc;
     sc                   = Screen.AllScreens;
     frm[3].Left          = sc[0].Bounds.Left;
     frm[3].Top           = sc[0].Bounds.Top;
     frm[3].StartPosition = FormStartPosition.Manual;
     try
     {
         frm[3].Show();
     } catch {
         frm[3] = new kitchenView(login);
         frm[3].Show();
     }
 }
Exemplo n.º 3
0
 public Reprint(kitchenView kv)
 {
     InitializeComponent();
     this.kv = kv;
 }