Beispiel #1
0
        public void pakage_Click(object sender, EventArgs m)
        {
            MessPakageChooser mpc = new MessPakageChooser();

            PushPakageName = ((Button)sender).Text;
            String[] weekdays = new string[] {
                "Sunday",
                "Monday",
                "Tuesday",
                "Wednesday",
                "Thursday",
                "Friday",
                "Saturday"
            };

            for (int i = 0; i < weekdays.Length; i++)
            {
                DataTable getallsunday = Bllbreakfast.getallBreakfastsforfromPakage(PushPakageName, weekdays[i].ToString());
                if (getallsunday.Rows.Count > 0)
                {
                    for (int sun = 0; sun < getallsunday.Rows.Count; sun++)
                    {
                        Label[] sunLabels = new Label[getallsunday.Rows.Count];
                        sunLabels[sun]           = new Label();
                        sunLabels[sun].Name      = getallsunday.Rows[sun]["br_id"].ToString();
                        sunLabels[sun].Text      = getallsunday.Rows[sun]["itemname"].ToString();
                        sunLabels[sun].Height    = 30;
                        sunLabels[sun].Width     = 70;
                        sunLabels[sun].Font      = new Font("", 10, FontStyle.Bold);
                        sunLabels[sun].ForeColor = Color.Black;


                        if (weekdays[i].ToString() == "Sunday")
                        {
                            mpc.flp_breakfast_sunday.Controls.Add(sunLabels[sun]);
                            mpc.flp_breakfast_sunday.HorizontalScroll.Visible = false;
                        }

                        if (weekdays[i].ToString() == "Monday")
                        {
                            mpc.flp_breakfast_mon.Controls.Add(sunLabels[sun]);
                            mpc.flp_breakfast_mon.HorizontalScroll.Visible = false;
                        }
                        if (weekdays[i].ToString() == "Tuesday")
                        {
                            mpc.flp_breakfast_tue.Controls.Add(sunLabels[sun]);
                            mpc.flp_breakfast_tue.HorizontalScroll.Visible = false;
                        }

                        if (weekdays[i].ToString() == "Wednesday")
                        {
                            mpc.flp_breakfast_wed.Controls.Add(sunLabels[sun]);
                            mpc.flp_breakfast_wed.HorizontalScroll.Visible = false;
                        }
                        if (weekdays[i].ToString() == "Thursday")
                        {
                            mpc.flp_breakfast_thur.Controls.Add(sunLabels[sun]);
                            mpc.flp_breakfast_thur.HorizontalScroll.Visible = false;
                        }
                        if (weekdays[i].ToString() == "Friday")
                        {
                            mpc.flp_breakfast_fri.Controls.Add(sunLabels[sun]);
                            mpc.flp_breakfast_fri.HorizontalScroll.Visible = false;
                        }
                        if (weekdays[i].ToString() == "Saturday")
                        {
                            mpc.flp_break_sat.Controls.Add(sunLabels[sun]);
                            mpc.flp_break_sat.HorizontalScroll.Visible = false;
                        }
                    }
                }
                //breakfast finish
                DataTable getallLunch = Bllbreakfast.getallLunchforfromPakage(PushPakageName, weekdays[i].ToString());
                if (getallLunch.Rows.Count > 0)
                {
                    for (int sun = 0; sun < getallLunch.Rows.Count; sun++)
                    {
                        Label[] sunLabels = new Label[getallLunch.Rows.Count];
                        sunLabels[sun]           = new Label();
                        sunLabels[sun].Name      = getallLunch.Rows[sun]["br_id"].ToString();
                        sunLabels[sun].Text      = getallLunch.Rows[sun]["itemname"].ToString();
                        sunLabels[sun].Height    = 30;
                        sunLabels[sun].Width     = 70;
                        sunLabels[sun].Font      = new Font("", 10, FontStyle.Bold);
                        sunLabels[sun].ForeColor = Color.Black;


                        if (weekdays[i].ToString() == "Sunday")
                        {
                            mpc.flp_lunch_sun.Controls.Add(sunLabels[sun]);
                        }

                        if (weekdays[i].ToString() == "Monday")
                        {
                            mpc.flp_lunch_mon.Controls.Add(sunLabels[sun]);
                        }
                        if (weekdays[i].ToString() == "Tuesday")
                        {
                            mpc.flp_lunch_tue.Controls.Add(sunLabels[sun]);
                        }

                        if (weekdays[i].ToString() == "Wednesday")
                        {
                            mpc.flp_lunch_wed.Controls.Add(sunLabels[sun]);
                        }
                        if (weekdays[i].ToString() == "Thursday")
                        {
                            mpc.flp_lunch_thur.Controls.Add(sunLabels[sun]);
                        }
                        if (weekdays[i].ToString() == "Friday")
                        {
                            mpc.flp_lunch_fri.Controls.Add(sunLabels[sun]);
                        }
                        if (weekdays[i].ToString() == "Saturday")
                        {
                            mpc.flp_lunch_sat.Controls.Add(sunLabels[sun]);
                        }
                    }
                }//lunch finish
                DataTable getallsnacks = Bllbreakfast.getallSnacksforfromPakage(PushPakageName, weekdays[i].ToString());
                if (getallsnacks.Rows.Count > 0)
                {
                    for (int sun = 0; sun < getallsnacks.Rows.Count; sun++)
                    {
                        Label[] sunLabels = new Label[getallsnacks.Rows.Count];
                        sunLabels[sun]           = new Label();
                        sunLabels[sun].Name      = getallsnacks.Rows[sun]["br_id"].ToString();
                        sunLabels[sun].Text      = getallsnacks.Rows[sun]["itemname"].ToString();
                        sunLabels[sun].Height    = 30;
                        sunLabels[sun].Width     = 70;
                        sunLabels[sun].Font      = new Font("", 10, FontStyle.Bold);
                        sunLabels[sun].ForeColor = Color.Black;


                        if (weekdays[i].ToString() == "Sunday")
                        {
                            mpc.flp_snacks_sun.Controls.Add(sunLabels[sun]);
                        }

                        if (weekdays[i].ToString() == "Monday")
                        {
                            mpc.flp_snacks_mon.Controls.Add(sunLabels[sun]);
                        }
                        if (weekdays[i].ToString() == "Tuesday")
                        {
                            mpc.flp_snacks_tue.Controls.Add(sunLabels[sun]);
                        }

                        if (weekdays[i].ToString() == "Wednesday")
                        {
                            mpc.flp_snacks_wed.Controls.Add(sunLabels[sun]);
                        }
                        if (weekdays[i].ToString() == "Thursday")
                        {
                            mpc.flp_snacks_thur.Controls.Add(sunLabels[sun]);
                        }
                        if (weekdays[i].ToString() == "Friday")
                        {
                            mpc.flp_snacks_fri.Controls.Add(sunLabels[sun]);
                        }
                        if (weekdays[i].ToString() == "Saturday")
                        {
                            mpc.flp_snacks_sat.Controls.Add(sunLabels[sun]);
                        }
                    }
                }//snacks finish
                DataTable getallDinner = Bllbreakfast.getallDinnerforfromPakage(PushPakageName, weekdays[i].ToString());
                if (getallDinner.Rows.Count > 0)
                {
                    for (int sun = 0; sun < getallDinner.Rows.Count; sun++)
                    {
                        Label[] sunLabels = new Label[getallDinner.Rows.Count];
                        sunLabels[sun]           = new Label();
                        sunLabels[sun].Name      = getallDinner.Rows[sun]["br_id"].ToString();
                        sunLabels[sun].Text      = getallDinner.Rows[sun]["itemname"].ToString();
                        sunLabels[sun].Height    = 30;
                        sunLabels[sun].Width     = 70;
                        sunLabels[sun].Font      = new Font("", 10, FontStyle.Bold);
                        sunLabels[sun].ForeColor = Color.Black;


                        if (weekdays[i].ToString() == "Sunday")
                        {
                            mpc.flp_dinner_sun.Controls.Add(sunLabels[sun]);
                            mpc.flp_dinner_sun.HorizontalScroll.Visible = false;
                        }

                        if (weekdays[i].ToString() == "Monday")
                        {
                            mpc.flp_dinner_mon.Controls.Add(sunLabels[sun]);
                            mpc.flp_dinner_mon.HorizontalScroll.Visible = false;
                        }
                        if (weekdays[i].ToString() == "Tuesday")
                        {
                            mpc.flp_dinner_tue.Controls.Add(sunLabels[sun]);
                            mpc.flp_dinner_tue.HorizontalScroll.Visible = false;
                        }

                        if (weekdays[i].ToString() == "Wednesday")
                        {
                            mpc.flp_dinner_wed.Controls.Add(sunLabels[sun]);
                            mpc.flp_dinner_wed.HorizontalScroll.Visible = false;
                        }
                        if (weekdays[i].ToString() == "Thursday")
                        {
                            mpc.flp_dinner_thur.Controls.Add(sunLabels[sun]);
                            mpc.flp_dinner_thur.HorizontalScroll.Visible = false;
                        }
                        if (weekdays[i].ToString() == "Friday")
                        {
                            mpc.flp_dinner_fri.Controls.Add(sunLabels[sun]);
                            mpc.flp_dinner_fri.HorizontalScroll.Visible = false;
                        }
                        if (weekdays[i].ToString() == "Saturday")
                        {
                            mpc.flp_dinner_sat.Controls.Add(sunLabels[sun]);
                            mpc.flp_dinner_sat.HorizontalScroll.Visible = false;
                        }
                    }
                } //Dinner finish
            }     //forloop
            mpc.ShowDialog();
        }
Beispiel #2
0
        private void dgv_customers_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            MessPakageChooser mpc = new MessPakageChooser();

            if (e.ColumnIndex == dgv_customers.Columns["colview"].Index && e.RowIndex >= 0)
            {
                DataTable getpakageNameFromCustomer = bllmess.getPakageNameFromCustomer(dgv_customers.CurrentRow.Cells["colID"].Value.ToString());
                if (getpakageNameFromCustomer.Rows.Count > 0)
                {
                    String   CusPakageName = getpakageNameFromCustomer.Rows[0]["pakage_name"].ToString();
                    String[] weekdays      = new string[] {
                        "Sunday",
                        "Monday",
                        "Tuesday",
                        "Wednesday",
                        "Thursday",
                        "Friday",
                        "Saturday"
                    };

                    for (int i = 0; i < weekdays.Length; i++)
                    {
                        DataTable getallsunday = Bllbreakfast.getallBreakfastsforfromPakage(CusPakageName, weekdays[i].ToString());
                        if (getallsunday.Rows.Count > 0)
                        {
                            for (int sun = 0; sun < getallsunday.Rows.Count; sun++)
                            {
                                Label[] sunLabels = new Label[getallsunday.Rows.Count];
                                sunLabels[sun]           = new Label();
                                sunLabels[sun].Name      = getallsunday.Rows[sun]["br_id"].ToString();
                                sunLabels[sun].Text      = getallsunday.Rows[sun]["itemname"].ToString();
                                sunLabels[sun].Height    = 30;
                                sunLabels[sun].Width     = 100;
                                sunLabels[sun].Font      = new Font("", 11, FontStyle.Bold);
                                sunLabels[sun].ForeColor = Color.Black;



                                if (weekdays[i].ToString() == "Sunday")
                                {
                                    mpc.flp_breakfast_sunday.Controls.Add(sunLabels[sun]);
                                    mpc.flp_breakfast_sunday.HorizontalScroll.Visible = false;
                                }

                                if (weekdays[i].ToString() == "Monday")
                                {
                                    mpc.flp_breakfast_mon.Controls.Add(sunLabels[sun]);
                                    mpc.flp_breakfast_mon.HorizontalScroll.Visible = false;
                                }
                                if (weekdays[i].ToString() == "Tuesday")
                                {
                                    mpc.flp_breakfast_tue.Controls.Add(sunLabels[sun]);
                                    mpc.flp_breakfast_tue.HorizontalScroll.Visible = false;
                                }

                                if (weekdays[i].ToString() == "Wednesday")
                                {
                                    mpc.flp_breakfast_wed.Controls.Add(sunLabels[sun]);
                                    mpc.flp_breakfast_wed.HorizontalScroll.Visible = false;
                                }
                                if (weekdays[i].ToString() == "Thursday")
                                {
                                    mpc.flp_breakfast_thur.Controls.Add(sunLabels[sun]);
                                    mpc.flp_breakfast_thur.HorizontalScroll.Visible = false;
                                }
                                if (weekdays[i].ToString() == "Friday")
                                {
                                    mpc.flp_breakfast_fri.Controls.Add(sunLabels[sun]);
                                    mpc.flp_breakfast_fri.HorizontalScroll.Visible = false;
                                }
                                if (weekdays[i].ToString() == "Saturday")
                                {
                                    mpc.flp_break_sat.Controls.Add(sunLabels[sun]);
                                    mpc.flp_break_sat.HorizontalScroll.Visible = false;
                                }
                            }
                        }
                        //breakfast finish
                        DataTable getallLunch = Bllbreakfast.getallLunchforfromPakage(CusPakageName, weekdays[i].ToString());
                        if (getallLunch.Rows.Count > 0)
                        {
                            for (int sun = 0; sun < getallLunch.Rows.Count; sun++)
                            {
                                Label[] sunLabels = new Label[getallLunch.Rows.Count];
                                sunLabels[sun]           = new Label();
                                sunLabels[sun].Name      = getallLunch.Rows[sun]["br_id"].ToString();
                                sunLabels[sun].Text      = getallLunch.Rows[sun]["itemname"].ToString();
                                sunLabels[sun].Height    = 30;
                                sunLabels[sun].Width     = 100;
                                sunLabels[sun].Font      = new Font("", 11, FontStyle.Bold);
                                sunLabels[sun].ForeColor = Color.Black;


                                if (weekdays[i].ToString() == "Sunday")
                                {
                                    mpc.flp_lunch_sun.Controls.Add(sunLabels[sun]);
                                }

                                if (weekdays[i].ToString() == "Monday")
                                {
                                    mpc.flp_lunch_mon.Controls.Add(sunLabels[sun]);
                                }
                                if (weekdays[i].ToString() == "Tuesday")
                                {
                                    mpc.flp_lunch_tue.Controls.Add(sunLabels[sun]);
                                }

                                if (weekdays[i].ToString() == "Wednesday")
                                {
                                    mpc.flp_lunch_wed.Controls.Add(sunLabels[sun]);
                                }
                                if (weekdays[i].ToString() == "Thursday")
                                {
                                    mpc.flp_lunch_thur.Controls.Add(sunLabels[sun]);
                                }
                                if (weekdays[i].ToString() == "Friday")
                                {
                                    mpc.flp_lunch_fri.Controls.Add(sunLabels[sun]);
                                }
                                if (weekdays[i].ToString() == "Saturday")
                                {
                                    mpc.flp_lunch_sat.Controls.Add(sunLabels[sun]);
                                }
                            }
                        }//lunch finish
                        DataTable getallsnacks = Bllbreakfast.getallSnacksforfromPakage(CusPakageName, weekdays[i].ToString());
                        if (getallsnacks.Rows.Count > 0)
                        {
                            for (int sun = 0; sun < getallsnacks.Rows.Count; sun++)
                            {
                                Label[] sunLabels = new Label[getallsnacks.Rows.Count];
                                sunLabels[sun]           = new Label();
                                sunLabels[sun].Name      = getallsnacks.Rows[sun]["br_id"].ToString();
                                sunLabels[sun].Text      = getallsnacks.Rows[sun]["itemname"].ToString();
                                sunLabels[sun].Height    = 30;
                                sunLabels[sun].Width     = 100;
                                sunLabels[sun].Font      = new Font("", 11, FontStyle.Bold);
                                sunLabels[sun].ForeColor = Color.Black;


                                if (weekdays[i].ToString() == "Sunday")
                                {
                                    mpc.flp_snacks_sun.Controls.Add(sunLabels[sun]);
                                }

                                if (weekdays[i].ToString() == "Monday")
                                {
                                    mpc.flp_snacks_mon.Controls.Add(sunLabels[sun]);
                                }
                                if (weekdays[i].ToString() == "Tuesday")
                                {
                                    mpc.flp_snacks_tue.Controls.Add(sunLabels[sun]);
                                }

                                if (weekdays[i].ToString() == "Wednesday")
                                {
                                    mpc.flp_snacks_wed.Controls.Add(sunLabels[sun]);
                                }
                                if (weekdays[i].ToString() == "Thursday")
                                {
                                    mpc.flp_snacks_thur.Controls.Add(sunLabels[sun]);
                                }
                                if (weekdays[i].ToString() == "Friday")
                                {
                                    mpc.flp_snacks_fri.Controls.Add(sunLabels[sun]);
                                }
                                if (weekdays[i].ToString() == "Saturday")
                                {
                                    mpc.flp_snacks_sat.Controls.Add(sunLabels[sun]);
                                }
                            }
                        }//snacks finish
                        DataTable getallDinner = Bllbreakfast.getallDinnerforfromPakage(CusPakageName, weekdays[i].ToString());
                        if (getallDinner.Rows.Count > 0)
                        {
                            for (int sun = 0; sun < getallDinner.Rows.Count; sun++)
                            {
                                Label[] sunLabels = new Label[getallDinner.Rows.Count];
                                sunLabels[sun]           = new Label();
                                sunLabels[sun].Name      = getallDinner.Rows[sun]["br_id"].ToString();
                                sunLabels[sun].Text      = getallDinner.Rows[sun]["itemname"].ToString();
                                sunLabels[sun].Height    = 30;
                                sunLabels[sun].Width     = 100;
                                sunLabels[sun].Font      = new Font("", 11, FontStyle.Bold);
                                sunLabels[sun].ForeColor = Color.Black;


                                if (weekdays[i].ToString() == "Sunday")
                                {
                                    mpc.flp_dinner_sun.Controls.Add(sunLabels[sun]);
                                    mpc.flp_dinner_sun.HorizontalScroll.Visible = false;
                                }

                                if (weekdays[i].ToString() == "Monday")
                                {
                                    mpc.flp_dinner_mon.Controls.Add(sunLabels[sun]);
                                    mpc.flp_dinner_mon.HorizontalScroll.Visible = false;
                                }
                                if (weekdays[i].ToString() == "Tuesday")
                                {
                                    mpc.flp_dinner_tue.Controls.Add(sunLabels[sun]);
                                    mpc.flp_dinner_tue.HorizontalScroll.Visible = false;
                                }

                                if (weekdays[i].ToString() == "Wednesday")
                                {
                                    mpc.flp_dinner_wed.Controls.Add(sunLabels[sun]);
                                    mpc.flp_dinner_wed.HorizontalScroll.Visible = false;
                                }
                                if (weekdays[i].ToString() == "Thursday")
                                {
                                    mpc.flp_dinner_thur.Controls.Add(sunLabels[sun]);
                                    mpc.flp_dinner_thur.HorizontalScroll.Visible = false;
                                }
                                if (weekdays[i].ToString() == "Friday")
                                {
                                    mpc.flp_dinner_fri.Controls.Add(sunLabels[sun]);
                                    mpc.flp_dinner_fri.HorizontalScroll.Visible = false;
                                }
                                if (weekdays[i].ToString() == "Saturday")
                                {
                                    mpc.flp_dinner_sat.Controls.Add(sunLabels[sun]);
                                    mpc.flp_dinner_sat.HorizontalScroll.Visible = false;
                                }
                            }
                        } //Dinner finish
                    }     //forloop
                    mpc.ShowDialog();
                }
            }
        }