Example #1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            icons = ilIcons;
            Text  = menuTitle;
            if (canPaint)
            {
                arsPanelList.Clear();
                GetArsPanelList(this);

                ArsSQLQry qryEkranDizayn = new ArsSQLQry();
                qryEkranDizayn.SQLText = "SELECT * FROM [TBLEKRANDIZAYN] WHERE /*WS*/MENU_KODU = '" + menuKodu.Replace("'", "''") + "'/*WE*/";
                qryEkranDizayn.Open();

                foreach (ArsPanel arsPanel in arsPanelList)
                {
                    arsPanel.parentForm = this;

                    if (qryEkranDizayn.Found())
                    {
                        qryEkranDizayn.First();
                        for (int i = 0; i < qryEkranDizayn.DataCount(); i++)
                        {
                            if (qryEkranDizayn.GetString("PANEL_NAME") == arsPanel.Name)
                            {
                                foreach (Control ctrl in arsPanel.Controls)
                                {
                                    if (ctrl.Name == qryEkranDizayn.GetString("CONTROL_NAME"))
                                    {
                                        switch (ctrl)
                                        {
                                        case ArsLabel _:
                                            switch (qryEkranDizayn.GetString("PROPERTY"))
                                            {
                                            case "FullText":
                                                (ctrl as ArsLabel).FullText = qryEkranDizayn.GetString("STR_DEGER");
                                                break;
                                            }
                                            break;

                                        case ArsEdit _:
                                            switch (qryEkranDizayn.GetString("PROPERTY"))
                                            {
                                            case "ArVisible":
                                                (ctrl as ArsEdit).ArVisible = qryEkranDizayn.GetString("BOOL_DEGER") == "True";
                                                break;
                                            }
                                            break;

                                        case ArsMaskEdit _:
                                            switch (qryEkranDizayn.GetString("PROPERTY"))
                                            {
                                            case "ArVisible":
                                                (ctrl as ArsMaskEdit).ArVisible = qryEkranDizayn.GetString("BOOL_DEGER") == "True";
                                                break;
                                            }
                                            break;

                                        case ArsDateTime _:
                                            switch (qryEkranDizayn.GetString("PROPERTY"))
                                            {
                                            case "ArVisible":
                                                (ctrl as ArsDateTime).ArVisible = qryEkranDizayn.GetString("BOOL_DEGER") == "True";
                                                break;
                                            }
                                            break;

                                        case ArsComboBox _:
                                            switch (qryEkranDizayn.GetString("PROPERTY"))
                                            {
                                            case "ArVisible":
                                                (ctrl as ArsComboBox).ArVisible = qryEkranDizayn.GetString("BOOL_DEGER") == "True";
                                                break;
                                            }
                                            break;

                                        case ArsCheck _:
                                            switch (qryEkranDizayn.GetString("PROPERTY"))
                                            {
                                            case "ArVisible":
                                                (ctrl as ArsCheck).ArVisible = qryEkranDizayn.GetString("BOOL_DEGER") == "True";
                                                break;
                                            }
                                            break;
                                        }
                                        break;
                                    }
                                }
                            }
                            qryEkranDizayn.Next();
                        }
                    }

                    if (arsPanel.CanPaint)
                    {
                        arsPanel.Setup();
                    }
                }
            }
            base.OnPaint(e);
        }
Example #2
0
        private void ArsEkranDizayn_Load(object sender, EventArgs e)
        {
            Text           = menuName + " Ekran Dizayn";
            lblHeader.Text = menuName + " Ekran Dizayn";
            lbComps.Items.Clear();
            if (pnlList != null)
            {
                ArsSQLQry qryEkranDizayn = new ArsSQLQry();
                qryEkranDizayn.SQLText = "SELECT * FROM [TBLEKRANDIZAYN] WHERE /*WS*/MENU_KODU = '" + menuKodu.Replace("'", "''") + "'/*WE*/";
                qryEkranDizayn.Open();

                foreach (ArsPanel pnl in pnlList)
                {
                    foreach (Control ctrl in pnl.Controls)
                    {
                        if (ctrl.Name == "")
                        {
                            continue;
                        }
                        bool ctrlCheck = false;
                        qryEkranDizayn.First();
                        for (int i = 0; i < qryEkranDizayn.DataCount(); i++)
                        {
                            if (qryEkranDizayn.GetString("CONTROL_NAME") == ctrl.Name)
                            {
                                ctrlCheck = true;
                                break;
                            }
                            qryEkranDizayn.Next();
                        }
                        switch (ctrl)
                        {
                        case ArsLabel _:
                            if ((ctrl as ArsLabel).FullText == "")
                            {
                                break;
                            }
                            Comp compLbl = new Comp();
                            compLbl.type     = 0;
                            compLbl.name     = ctrl.Name;
                            compLbl.fullText = (ctrl as ArsLabel).FullText;
                            compLbl.baslik   = (ctrl as ArsLabel).FullText + " (ArsLabel)";
                            compLbl.pnlName  = pnl.Name;
                            if (ctrlCheck)
                            {
                                compLbl.fullText = qryEkranDizayn.GetString("STR_DEGER");
                                compLbl.baslik   = qryEkranDizayn.GetString("STR_DEGER") + " (ArsLabel)";
                            }
                            compList.Add(compLbl);
                            break;

                        case ArsEdit _:
                            if (!(ctrl as ArsEdit).CanNull)
                            {
                                break;
                            }
                            Comp compEdit = new Comp();
                            compEdit.type      = 1;
                            compEdit.name      = ctrl.Name;
                            compEdit.arVisible = (ctrl as ArsEdit).ArVisible;

                            /*if ((ctrl as ArsEdit).focusLabel != null && (ctrl as ArsEdit).focusLabel.FullText != "") compEdit.baslik = (ctrl as ArsEdit).focusLabel.FullText + " (ArsEdit)";
                             * else */compEdit.baslik  = ctrl.Name + " (ArsEdit)";
                            compEdit.pnlName = pnl.Name;
                            if (ctrlCheck)
                            {
                                compEdit.arVisible = qryEkranDizayn.GetString("BOOL_DEGER") == "True";
                            }
                            compList.Add(compEdit);
                            break;

                        case ArsMaskEdit _:
                            if (!(ctrl as ArsMaskEdit).CanNull)
                            {
                                break;
                            }
                            Comp compMEdit = new Comp();
                            compMEdit.type      = 2;
                            compMEdit.name      = ctrl.Name;
                            compMEdit.arVisible = (ctrl as ArsMaskEdit).ArVisible;

                            /*if ((ctrl as ArsMaskEdit).focusLabel != null && (ctrl as ArsMaskEdit).focusLabel.FullText != "") compMEdit.baslik = (ctrl as ArsMaskEdit).focusLabel.FullText + " (ArsDateTime)";
                             * else */compMEdit.baslik  = ctrl.Name + " (ArsDateTime)";
                            compMEdit.pnlName = pnl.Name;
                            if (ctrlCheck)
                            {
                                compMEdit.arVisible = qryEkranDizayn.GetString("BOOL_DEGER") == "True";
                            }
                            compList.Add(compMEdit);
                            break;

                        case ArsDateTime _:
                            if (!(ctrl as ArsDateTime).CanNull)
                            {
                                break;
                            }
                            Comp compDateTime = new Comp();
                            compDateTime.type      = 3;
                            compDateTime.name      = ctrl.Name;
                            compDateTime.arVisible = (ctrl as ArsDateTime).ArVisible;

                            /*if ((ctrl as ArsDateTime).focusLabel != null && (ctrl as ArsDateTime).focusLabel.FullText != "") compDateTime.baslik = (ctrl as ArsDateTime).focusLabel.FullText + " (ArsDateTime)";
                             * else */compDateTime.baslik  = ctrl.Name + " (ArsDateTime)";
                            compDateTime.pnlName = pnl.Name;
                            if (ctrlCheck)
                            {
                                compDateTime.arVisible = qryEkranDizayn.GetString("BOOL_DEGER") == "True";
                            }
                            compList.Add(compDateTime);
                            break;

                        case ArsComboBox _:
                            if (!(ctrl as ArsComboBox).CanNull)
                            {
                                break;
                            }
                            Comp compCombo = new Comp();
                            compCombo.type      = 4;
                            compCombo.name      = ctrl.Name;
                            compCombo.arVisible = (ctrl as ArsComboBox).ArVisible;

                            /*if ((ctrl as ArsComboBox).focusLabel != null && (ctrl as ArsComboBox).focusLabel.FullText != "") compCombo.baslik = (ctrl as ArsComboBox).focusLabel.FullText + " (ArsComboBox)";
                             * else */compCombo.baslik  = ctrl.Name + " (ArsComboBox)";
                            compCombo.pnlName = pnl.Name;
                            if (ctrlCheck)
                            {
                                compCombo.arVisible = qryEkranDizayn.GetString("BOOL_DEGER") == "True";
                            }
                            compList.Add(compCombo);
                            break;

                        case ArsCheck _:
                            if (!(ctrl as ArsCheck).CanNull)
                            {
                                break;
                            }
                            Comp compCheck = new Comp();
                            compCheck.type      = 5;
                            compCheck.name      = ctrl.Name;
                            compCheck.arVisible = (ctrl as ArsCheck).ArVisible;

                            /*if ((ctrl as ArsCheck).focusLabel != null && (ctrl as ArsCheck).focusLabel.FullText != "") compCheck.baslik = (ctrl as ArsCheck).focusLabel.FullText + " (ArsCheck)";
                             * else */compCheck.baslik  = ctrl.Name + " (ArsCheck)";
                            compCheck.pnlName = pnl.Name;
                            if (ctrlCheck)
                            {
                                compCombo.arVisible = qryEkranDizayn.GetString("BOOL_DEGER") == "True";
                            }
                            compList.Add(compCheck);
                            break;
                        }
                    }
                }

                if (compList.Count > 0)
                {
                    foreach (Comp comp in compList)
                    {
                        lbComps.Items.Add(comp.baslik);
                    }
                    lbComps.SelectedIndex = 0;
                }
            }
        }