Beispiel #1
0
        public PinKoduFormu(string yapilacakIslemNe, SiparisMasaFormu siparisMasaFormu)
        {
            InitializeComponent();

            this.siparisMasaFormu = siparisMasaFormu;

            yapilacakIslem = yapilacakIslemNe;

            this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
            this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
        }
Beispiel #2
0
        public KontrolFormu(string textboxText, bool BoxType, SiparisMasaFormu masaFormuGelen)
        {
            InitializeComponent();

            if (masaFormuGelen != null)
                this.masaFormu = masaFormuGelen;

            this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
            this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;

            labelAciklama.Text = textboxText;
            buttonDevamEt.Visible = true;
            buttonDevamEtme.Visible = true;
            buttonNO.Visible = false;
            buttonYES.Visible = false;
            buttonTamam.Visible = false;
        }
Beispiel #3
0
        private void siparisButtonPressed(object sender, EventArgs e)
        {
            if (!File.Exists("restoran.xml") || !File.Exists("sonKullanici.xml") || !File.Exists("kategoriler.xml") || !File.Exists("masaDizayn.xml") || !File.Exists("menu.xml") || !File.Exists("urunler.xml"))
            {
                KontrolFormu dialog2 = new KontrolFormu("Lütfen önce programı ayarları kullanarak yapılandırın", false);
                dialog2.Show();
                return;
            }

            if (siparisForm == null)
            {
                //sipariş ekranına geçilecek

                //Task.Factory.StartNew(() => siparisForm.ShowDialog());
                try
                {
                    Task reportTask = Task.Factory.StartNew(
                        () =>
                        {
                            siparisForm = new SiparisMasaFormu(kullanicilar, this);

                            siparisForm.ShowDialog();
                        }
                        , CancellationToken.None
                        , TaskCreationOptions.None
                        , TaskScheduler.FromCurrentSynchronizationContext()
                        );

                    reportTask.Wait();
                }
                catch
                { }
            }
            else
            {
                this.SendToBack();
            }
        }
Beispiel #4
0
        public SiparisMenuFormu(SiparisMasaFormu masaFormu, string masaninAdi, Restoran butonBilgileri, string siparisiGirenKisi, bool masaAcikmi)
        {
            InitializeComponent();

            this.masaFormu = masaFormu;

            this.masaAcikMi = masaAcikmi;

            //siparişi vermek için pin giren kisinin bilgisi
            siparisiKimGirdi = siparisiGirenKisi;

            //hangi departmanda olduğumuzu tutan değişken
            hangiDepartman = butonBilgileri;

            XmlLoad<UItemp> loadInfoKullanicilar = new XmlLoad<UItemp>();
            infoKullanici = loadInfoKullanicilar.LoadRestoran("tempfiles.xml");

            int kullaniciYeri = 0;

            //kullanıcının yerini bul
            for (int i = 0; i < infoKullanici.Count(); i++)
            {
                if (siparisiKimGirdi == (new UnicodeEncoding()).GetString(infoKullanici[i].UIN) + " " + (new UnicodeEncoding()).GetString(infoKullanici[i].UIS))
                {
                    kullaniciYeri = i;
                    break;
                }
            }
            //yetkilerine göre işlemlere izin verme

            if (PasswordHash.ValidatePassword("false", infoKullanici[kullaniciYeri].UIY[4]))
            {
                buttonUrunIkram.Enabled = false;
                buttonUrunIptal.Enabled = false;
                iptalIkram = false;
            }

            if (PasswordHash.ValidatePassword("true", infoKullanici[kullaniciYeri].UIY[3]))
                adisyonDegistirebilirMi = true;

            if (PasswordHash.ValidatePassword("true", infoKullanici[kullaniciYeri].UIY[0]))
                satisYapabilirMi = true;

            MasaAdi = masaninAdi;
            labelMasa.Text = "Masa: " + MasaAdi;
            labelDepartman.Text = "Departman: " + hangiDepartman.departmanAdi;

            //labelların fontunu ayarlıyoruz
            while (labelDepartman.Width < System.Windows.Forms.TextRenderer.MeasureText(labelDepartman.Text, new Font(labelDepartman.Font.FontFamily, labelDepartman.Font.Size, labelDepartman.Font.Style)).Width)
            {
                labelDepartman.Font = new Font(labelDepartman.Font.FontFamily, labelDepartman.Font.Size - 0.5f, labelDepartman.Font.Style);
            }

            while (labelMasa.Width < System.Windows.Forms.TextRenderer.MeasureText(labelMasa.Text, new Font(labelMasa.Font.FontFamily, labelMasa.Font.Size, labelMasa.Font.Style)).Width)
            {
                labelMasa.Font = new Font(labelMasa.Font.FontFamily, labelMasa.Font.Size - 0.5f, labelMasa.Font.Style);
            }

            // Oluşturulmuş menüleri xml den okuyoruz
            XmlLoad<Menuler> loadInfo = new XmlLoad<Menuler>();
            Menuler[] infoMenu = loadInfo.LoadRestoran("menu.xml");

            //menüleri tutacak listemize atıyoruz
            menuListesi.AddRange(infoMenu);

            int hangiMenu = 0;
            while (menuListesi[hangiMenu].menuAdi != hangiDepartman.departmanMenusu)
                hangiMenu++;

            //kategorileri panele yerleştiriyoruz
            for (int i = 0; i < menuListesi[hangiMenu].menukategorileri.Count; i++)
            {
                Button menuBasliklariButonlari = new Button();
                menuBasliklariButonlari.Text = menuListesi[hangiMenu].menukategorileri[i];

                menuBasliklariButonlari.UseVisualStyleBackColor = false;
                menuBasliklariButonlari.BackColor = Color.White;
                menuBasliklariButonlari.ForeColor = SystemColors.ActiveCaption;
                menuBasliklariButonlari.TextAlign = ContentAlignment.MiddleCenter;
                menuBasliklariButonlari.Font = new Font("Arial", 18.00F, FontStyle.Bold);
                menuBasliklariButonlari.Tag = -1;
                menuBasliklariButonlari.Click += menuBasliklariButonlari_Click;
                menuBasliklariButonlari.Name = "" + i;

                flowPanelMenuBasliklari.Controls.Add(menuBasliklariButonlari);
            }

            XmlLoad<KategorilerineGoreUrunler> loadInfoUrun = new XmlLoad<KategorilerineGoreUrunler>();
            KategorilerineGoreUrunler[] infoUrun = loadInfoUrun.LoadRestoran("urunler.xml");

            urunListesi.AddRange(infoUrun);
        }