Beispiel #1
0
        public GenXlsx(String fileName, Main main, String dayOfweek, MaintainMenu_v2 m_v2)
        {
            InitializeComponent();
            this.fileName  = fileName;
            this.main      = main;
            this.dayOfweek = dayOfweek;
            this.m_v2      = m_v2;
            tableLayoutPanel1.AutoScroll = true;
            label1.Text = "This menu will be named :" + fileName;
            label1.Font = new Font("Comic Sans MS", 12);
            DataTable dt = main.db.getDb("foodType");
            int       x  = 50;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                Label  lab    = new Label();
                String hidden = dt.Rows[i]["ftypeid"].ToString();
                lab.Text       = dt.Rows[i]["name"].ToString();
                lab.Tag        = hidden;
                lab.Location   = new Point(500, x);
                lab.Font       = new Font("Comic Sans MS", 12);
                lab.MouseDown += new MouseEventHandler(labMouseDown);
                x             += 30;
                tabControl1.TabPages[0].Controls.Add(lab);
            }
        }
Beispiel #2
0
        public addMenuType(Main main, MaintainMenu_v2 m_v2)

        {
            InitializeComponent();
            this.main       = main;
            this.m_v2       = m_v2;
            dt_menuCategory = main.db.getDb("menucategory");
        }
Beispiel #3
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);
        }
Beispiel #4
0
        public addFood(String fid, Main main, DateTime date, MaintainMenu_v2 m_v2)
        {
            InitializeComponent();
            this.fid  = fid;
            this.main = main;
            this.date = date;
            this.m_v2 = m_v2;

            dt_foodtype = main.db.getDb("foodtype");
            for (int i = 0; i < dt_foodtype.Rows.Count; i++)
            {
                combo_FoodType.Items.Add(dt_foodtype.Rows[i]["name"].ToString());
            }

            /*if (date.ToShortDateString().Equals(DateTime.Today.ToShortDateString()))
             * {
             *  dt_foodtype = main.db.getDb("foodtype");
             *  for (int i = 0; i < dt_foodtype.Rows.Count; i++)
             *  {
             *      combo_FoodType.Items.Add(dt_foodtype.Rows[i]["name"].ToString());
             *  }
             * }
             * else {
             *  String dd = date.Day.ToString();
             *  String mm = date.Month.ToString();
             *  String yyyy = date.Year.ToString();
             *  String fileName = "";
             *  String[] temp = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
             *  for (int i = 0; i < temp.Length; i++)
             *  {
             *      if (temp[i].Equals(date.DayOfWeek.ToString()))
             *      {
             *          fileName = i + 1 + temp[i];
             *      }
             *  }
             *  fileName += "\\" + dd + "_" + mm + "_" + yyyy + ".xlsx";
             *
             *  dt_foodtype = readXlsx(fileName, "foodtype");
             *  for (int i = 0; i < dt_foodtype.Rows.Count; i++)
             *  {
             *      String name = dt_foodtype.Rows[i]["name"].ToString();
             *      combo_FoodType.Items.Add(dt_foodtype.Rows[i]["name"].ToString());
             *  }
             *
             * }*/
        }