private void BannerListele()
    {
        try
        {
            SqlParameter parametre = new SqlParameter("@paremetre", "flash");

            using (SqlDataReader dr = SqlHelper.ExecuteReader("resim_Listele", parametre))
            {
                List<Pannel> bannerTablo = new List<Pannel>();
                string gosterimAd = null;
                while (dr.Read())
                {
                    gosterimAd = dr.GetString(dr.GetOrdinal("parametre"));

                    switch (gosterimAd)
                    {
                        case "solPanel": gosterimAd = "Sol Panel Flash "; break;
                        case "popUp": gosterimAd = "Anasayfa Pop Up "; break;
                        case "sagKargo": gosterimAd = "Sağ Kargo Alanı"; break;
                        case "sagAlt": gosterimAd = "Sağ Alt Resim Alanı"; break;
                        case "sagFlash": gosterimAd = "Sağ Panel Flash"; break;
                        case "hediye": gosterimAd = "Hediye Kapanya Resim"; break;
                    }

                    Pannel info = new Pannel(
                        dr.GetString(dr.GetOrdinal("resim_adi")),
                        dr.GetInt32(dr.GetOrdinal("id")),
                        dr.GetString(dr.GetOrdinal("resim_baslik")),
                        dr.GetBoolean(dr.GetOrdinal("durum")),
                        gosterimAd);

                    bannerTablo.Add(info);
                }

                gvwPaneller.DataSource = bannerTablo;
                gvwPaneller.DataBind();
            }
        }
        catch (Exception ex)
        {
            mesajGosterSis("Banner Listeleme Hatası", ex);
        }
    }
Exemple #2
0
 void Awake()
 {
     _pannel = GetComponent <Pannel>();
 }
Exemple #3
0
        public void testsInitialize()
        {
            cupboard1 = new Cupboard();
            cupboard2 = new Cupboard();

            angleBracketParam1 = new AngleBracket(100, "null", "0000", new Size(45, 0, 0), false, 45, Color.white);
            angleBracketParam2 = new AngleBracket(25, "null", "0000", new Size(0, 0, 0), false, 5, Color.white);

            locker1 = new Locker();
            locker2 = new Locker();
            locker3 = new Locker();
            locker4 = new Locker();

            crossBar1          = new CrossBar();
            crossBar2          = new CrossBar();
            crossBar3          = new CrossBar();
            crossBar4          = new CrossBar();
            crossBar5          = new CrossBar();
            crossBar6          = new CrossBar();
            crossBar7          = new CrossBar();
            crossBar8          = new CrossBar();
            crossBarWithParam1 = new CrossBar(10, "referenceTest", "1", new Size(21, 0, 0), false, 0, Color.white);
            crossBarWithParam2 = new CrossBar(20, "referenceTest", "2", new Size(11, 0, 0), false, 0, Color.white);
            crossBarWithParam3 = new CrossBar(20, "referenceTest", "3", new Size(8, 0, 0), false, 0, Color.white);

            pannel1         = new Pannel();
            pannel2         = new Pannel();
            pannel3         = new Pannel();
            pannel4         = new Pannel();
            pannel5         = new Pannel();
            pannelWithPara1 = new Pannel(10, "referenceTest", "1", new Size(23, 0, 0), false, 0, Color.white);

            cleat1         = new Cleat();
            cleat2         = new Cleat();
            cleat3         = new Cleat();
            cleat4         = new Cleat();
            cleatWithPara1 = new Cleat(10, "referenceTest", "1", new Size(10, 0, 0), false, 0, Color.white);

            catalogueComponentsListFull = new List <CatalogueComponents>()
            {
                crossBar1, crossBar2, crossBar3, crossBar4, crossBar5, crossBar6, crossBar7, crossBar8,
                cleat1, cleat2, cleat3, cleat4,
                pannel1, pannel2, pannel3, pannel4, pannel5
            };

            catalogueComponentsListWith13 = new List <CatalogueComponents>()
            {
                crossBar1, crossBar2, crossBar3, crossBar4, crossBar5, crossBar6, crossBar7, crossBar8,
                cleat1, cleat2, cleat3, cleat4,
                pannel1
            };

            catalogueComponentsListWith5WithParam = new List <CatalogueComponents>()
            {
                crossBarWithParam1, crossBarWithParam2, crossBarWithParam3,
                cleatWithPara1,
                pannelWithPara1
            };

            catalogueComponentsListWith2WithParam = new List <CatalogueComponents>()
            {
                cleatWithPara1, pannelWithPara1
            };

            cupboardComponentsListWith3 = new List <ICupboardComponents>()
            {
                locker1, locker2, locker3
            };
        }
 void Awake()
 {
     _pannel   = GetComponent <Pannel>();
     _instance = this;
 }
        private void Init()
        {
            var fields = setting.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);

            pairList = new List <FieldControlPair>();
            var pannelObject = Instantiate(prefabSetting.PannelPrefab) as GameObject;

            pannelObject.transform.SetParent(parent, false);
            pannelObject.name   = "EasyUGUIPannel(" + Id + ")";
            Pannel              = pannelObject.GetComponent <EasyUGUIPannel>();
            Pannel.Title        = Id;
            Pannel.SaveEvent   += Pannel_SaveEvent;
            Pannel.ReloadEvent += Pannel_ReloadEvent;

            foreach (var field in fields)
            {
                var type           = field.FieldType;
                var rangeAttribute = field.GetCustomAttribute <RangeAttribute>();

                if (type.IsEnum)
                {
                    var list = new List <string>();
                    foreach (var elm in Enum.GetValues(type))
                    {
                        list.Add(elm.ToString());
                    }
                    var go        = Instantiate(prefabSetting.DropdownPrefab) as GameObject;
                    var component = go.GetComponent <EasyUGUIDropdown>();
                    component.Id = field.Name;
                    component.Init(list, field.FieldType);
                    pairList.Add(new FieldControlPair(field, component));
                    Pannel.AddControl(go);
                }
                else if (type.Name == typeof(float).Name)
                {
                    if (rangeAttribute != null)
                    {
                        var go        = Instantiate(prefabSetting.FloatSliderPrefab) as GameObject;
                        var component = go.GetComponent <EasyUGUIFloatSlider>();
                        component.MinValue = rangeAttribute.min;
                        component.MaxValue = rangeAttribute.max;
                        component.Id       = field.Name;
                        pairList.Add(new FieldControlPair(field, component));
                        Pannel.AddControl(go);
                    }
                    else
                    {
                        var go        = Instantiate(prefabSetting.FloatInputFieldPrefab) as GameObject;
                        var component = go.GetComponent <EasyUGUIFloatInputField>();
                        component.Id = field.Name;
                        pairList.Add(new FieldControlPair(field, component));
                        Pannel.AddControl(go);
                    }
                }
                else if (type.Name == typeof(int).Name)
                {
                    if (rangeAttribute != null)
                    {
                        var go        = Instantiate(prefabSetting.IntSliderPrefab) as GameObject;
                        var component = go.GetComponent <EasyUGUIIntSlider>();
                        component.Id       = field.Name;
                        component.MinValue = (int)rangeAttribute.min;
                        component.MaxValue = (int)rangeAttribute.max;
                        pairList.Add(new FieldControlPair(field, component));
                        Pannel.AddControl(go);
                    }
                    else
                    {
                        var go        = Instantiate(prefabSetting.IntInputFieldPrefab) as GameObject;
                        var component = go.GetComponent <EasyUGUIIntInputField>();
                        component.Id = field.Name;
                        pairList.Add(new FieldControlPair(field, component));
                        Pannel.AddControl(go);
                    }
                }
                else if (type.Name == typeof(string).Name)
                {
                    var multilineAttribute = field.GetCustomAttribute <MultilineTextAttribute>();
                    if (multilineAttribute != null)
                    {
                        var go        = Instantiate(prefabSetting.MultilineTextInputFieldPrefab) as GameObject;
                        var component = go.GetComponent <EasyUGUITextInputField>();
                        component.Id = field.Name;
                        pairList.Add(new FieldControlPair(field, component));
                        Pannel.AddControl(go);
                    }
                    else
                    {
                        var go        = Instantiate(prefabSetting.TextInputFieldPrefab) as GameObject;
                        var component = go.GetComponent <EasyUGUITextInputField>();
                        component.Id = field.Name;
                        pairList.Add(new FieldControlPair(field, component));
                        Pannel.AddControl(go);
                    }
                }
                else if (type.Name == typeof(bool).Name)
                {
                    var go        = Instantiate(prefabSetting.TogglePrefab) as GameObject;
                    var component = go.GetComponent <EasyUGUIToggle>();
                    component.Id = field.Name;
                    pairList.Add(new FieldControlPair(field, component));
                    Pannel.AddControl(go);
                }
            }

            foreach (var pair in pairList)
            {
                pair.easyUGUIControl.ValueChangedEvent += Control_ValueChangedEvent;
            }
        }