Example #1
0
        private void saleCheckChanged(object sender, EventArgs e)
        {
            if (Convert.ToInt32(((CheckBox)sender).Tag) == whichCheckBoxShouldUncheck) // eğer checkbox zaten seçiliyse birşey yapmadan dön
                return;

            leftPanelView.Nodes.Clear();
            splitPanel.Panel2.Controls.Clear();

            switch (whichCheckBoxShouldUncheck) // önceden seçili olan checkboxı kaldır
            {
                #region
                case 1:
                    reportCheckBox.Image = global::ROPv1.Properties.Resources.reportscolor;
                    reportCheckBox.ImageAlign = ContentAlignment.TopCenter;
                    reportCheckBox.ForeColor = SystemColors.ActiveCaption;
                    break;
                case 2:
                    stokCheckBox.Image = global::ROPv1.Properties.Resources.stockcolor;
                    stokCheckBox.ImageAlign = ContentAlignment.TopCenter;
                    stokCheckBox.ForeColor = SystemColors.ActiveCaption;
                    break;
                case 3:
                    ayarCheckBox.Image = global::ROPv1.Properties.Resources.settingscolor;
                    ayarCheckBox.ImageAlign = ContentAlignment.TopCenter;
                    ayarCheckBox.ForeColor = SystemColors.ActiveCaption;
                    break;
                case 4:
                    anketCheckBox.Image = global::ROPv1.Properties.Resources.anket;
                    anketCheckBox.ImageAlign = ContentAlignment.TopCenter;
                    anketCheckBox.ForeColor = SystemColors.ActiveCaption;
                    break;
                default:
                    break;
                #endregion
            }

            switch (Convert.ToInt32(((CheckBox)sender).Tag)) // yeni seçilen checkboxı işaretle ve gerekli işlemleri yap
            {
                #region
                case 1:
                    if (pinForm != null)
                    {
                        if (pinForm.Visible)
                        {
                            this.Invoke((MethodInvoker)delegate
                            {
                                pinForm.Close();
                            });
                            pinForm = null;
                        }
                    }
                    reportCheckBox.Image = global::ROPv1.Properties.Resources.reportsback;
                    buttonBilgiAktar.Visible = false;
                    //report işlemlerini split panelin 1. kısmına koy, seçili işlemi 2. kısma yok
                    leftPanelView.Nodes.Add("Gün Sonu Raporu");
                    leftPanelView.Nodes.Add("İptal Edilen Ürünler");
                    leftPanelView.SelectedNode = leftPanelView.Nodes[0];
                    break;
                case 2:
                    if (pinForm != null)
                    {
                        if (pinForm.Visible)
                        {
                            this.Invoke((MethodInvoker)delegate
                            {
                                pinForm.Close();
                            });
                            pinForm = null;
                        }
                    }
                    stokCheckBox.Image = global::ROPv1.Properties.Resources.stockback;
                    buttonBilgiAktar.Visible = false;
                    //stok işlemlerini split panelin 1. kısmına koy, seçili işlemi 2. kısma yok
                    break;
                case 3:
                    ayarCheckBox.Image = global::ROPv1.Properties.Resources.settingsback;

                    if (pinForm != null)
                    {
                        if (pinForm.Visible)
                        {
                            pinForm.BringToFront();
                            return;
                        }
                    }

                    pinForm = new PinKoduFormu("Ayar Görüntüleme", this);
                    pinForm.Show();
                    break;
                case 4:
                    if (pinForm != null)
                    {
                        if (pinForm.Visible)
                        {
                            this.Invoke((MethodInvoker)delegate
                            {
                                pinForm.Close();
                            });
                            pinForm = null;
                        }
                    }
                    anketCheckBox.Image = global::ROPv1.Properties.Resources.anketBack;
                    buttonBilgiAktar.Visible = false;

                    leftPanelView.Nodes.Add("Değerlendirme(SS)"); // ( Alınan oyların sayısı, alınan tam puanlar , genel puanlama vs. )
                    leftPanelView.Nodes.Add("Değerlendirme(YS)");
                    leftPanelView.Nodes.Add("Anket Sonuçları"); // ( Yapılan anketleri görüntüleme )
                    leftPanelView.Nodes.Add("Kullanıcı Bilgileri"); // ( Kullanıcı bilgileri )
                    leftPanelView.Nodes.Add("Anket Ayarları"); // ( Anket ayarları )

                    leftPanelView.SelectedNode = leftPanelView.Nodes[0];
                    break;
                default:
                    if (pinForm != null)
                    {
                        if (pinForm.Visible)
                        {
                            this.Invoke((MethodInvoker)delegate
                            {
                                pinForm.Close();
                            });
                            pinForm = null;
                        }
                    }
                    break;
                #endregion
            }
            // yeni seçilen checkboxı işaretlemenin kalan kısmı
            ((CheckBox)sender).ImageAlign = ContentAlignment.MiddleCenter;
            ((CheckBox)sender).ForeColor = Color.White;

            //Nodeların eklenmesinden sonra taşma varsa bile ekrana sığması için font boyutunu küçültüyoruz
            foreach (TreeNode node in leftPanelView.Nodes)
            {
                while (leftPanelView.Width - 12 < System.Windows.Forms.TextRenderer.MeasureText(node.Text, new Font(leftPanelView.Font.FontFamily, leftPanelView.Font.Size, leftPanelView.Font.Style)).Width)
                {
                    leftPanelView.Font = new Font(leftPanelView.Font.FontFamily, leftPanelView.Font.Size - 0.5f, leftPanelView.Font.Style);
                }
            }

            //yeni seçilen checkboxı son seçilen checkbox yap
            whichCheckBoxShouldUncheck = Convert.ToInt32(((CheckBox)sender).Tag);

            leftPanelView.Focus();

            if(pinForm != null && pinForm.Visible)
                pinForm.Focus();
        }
Example #2
0
        private void siparisButonuBasildi(object sender, EventArgs e)
        {
            if (pinForm != null)
            {
                if (pinForm.Visible)
                {
                    pinForm.BringToFront();
                    return;
                }
            }

            if (dialog2 != null)
            {
                if (dialog2.Visible)
                {
                    dialog2.BringToFront();
                    return;
                }
            }

            if (acikMasaVarsaYapma)
            {
                acikMasaVarsaUyariVerFormuOneGetir();
                return;
            }

            pinForm = new PinKoduFormu("Masa Görüntüleme", this);
            pinForm.Show();

            hangiMasaButonunaBasildi = sender as Button;
            hangiMasa = ((Button)sender).Text;
        }