private void frmSiparis_Load(object sender, EventArgs e)
        {
            lblMasaNo.Text = cGenel._ButtonValue;

            cMasalar ms      = new cMasalar();
            int      tableId = ms.TableGetbyNumber(cGenel._ButtonName);

            if (ms.TableGetbyState(tableId, 2) == true || ms.TableGetbyState(tableId, 4) == true)
            {
                cAdisyon Ad         = new cAdisyon();
                int      AdditionId = Ad.getByAddition(tableId);
                cSiparis orders     = new cSiparis();
                orders.getByOrder(lvSiparisler, AdditionId);
            }

            btn11.Click += new EventHandler(islem);
            btn2.Click  += new EventHandler(islem);
            btn3.Click  += new EventHandler(islem);
            btn4.Click  += new EventHandler(islem);
            btn5.Click  += new EventHandler(islem);
            btn6.Click  += new EventHandler(islem);
            btn7.Click  += new EventHandler(islem);
            btn8.Click  += new EventHandler(islem);
            btn9.Click  += new EventHandler(islem);
            btn0.Click  += new EventHandler(islem);
        }
        private void frmMasalar_Load(object sender, EventArgs e)
        {
            MySqlConnection con = new MySqlConnection("Server=localhost;Database=itadakimasu;Uid=root;Pwd='';");

            con.Open();
            MySqlCommand    cmd = new MySqlCommand("Select DURUM,ID from Masalar", con);
            MySqlDataReader dr  = null;

            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                foreach (Control item in this.Controls)
                {
                    if (item is Button)
                    {
                        if (item.Name == "btnMasa" + dr["ID"].ToString() && dr["DURUM"].ToString() == "1")
                        {
                            item.BackgroundImage = (Image)(Properties.Resources.masaBos);
                        }
                        else if (item.Name == "btnMasa" + dr["ID"].ToString() && dr["DURUM"].ToString() == "2")
                        {
                            cMasalar ms  = new cMasalar();
                            DateTime dt1 = Convert.ToDateTime(ms.SessionSum(2));
                            DateTime dt2 = DateTime.Now;
                            string   st1 = Convert.ToDateTime(ms.SessionSum(2)).ToShortTimeString();
                            string   st2 = DateTime.Now.ToShortTimeString();

                            DateTime t1 = dt1.AddMinutes(DateTime.Parse(st1).TimeOfDay.TotalMinutes);
                            DateTime t2 = dt2.AddMinutes(DateTime.Parse(st2).TimeOfDay.TotalMinutes);

                            var fark = t2 - t1;

                            item.Text =
                                String.Format("{0}{1}{2}",
                                              fark.Days > 0 ? string.Format("{0} Gün", fark.Days) : "",
                                              fark.Hours > 0 ? string.Format("{0} Saat", fark.Hours) : "",
                                              fark.Minutes > 0 ? string.Format("{0} Dakika", fark.Minutes) : "").Trim() + "\n\n\nMasa" + dr["ID"].ToString();

                            item.BackgroundImage = (Image)(Properties.Resources.masaDolu);
                        }
                        else if (item.Name == "btnMasa" + dr["ID"].ToString() && dr["DURUM"].ToString() == "3")
                        {
                            item.BackgroundImage = (Image)(Properties.Resources.masaAcik);
                        }
                        else if (item.Name == "btnMasa" + dr["ID"].ToString() && dr["DURUM"].ToString() == "4")
                        {
                            item.BackgroundImage = (Image)(Properties.Resources.masaRezerve1);
                        }
                    }
                }
            }
        }