コード例 #1
0
ファイル: frmSzallito.cs プロジェクト: hayrettinbebek/e-cafe
        private void loadData()
        {
            Partner_list szall = new Partner_list(new SqlConnection(DEFS.ConSTR));
            szallitoBindingSource.Clear();

            foreach (var c in szall.lSzallitok)
            {
                szallitoBindingSource.Add(c);
            }

            dynComboBindingSource.Clear();

            StringEnum ct = new StringEnum(typeof(CimTipus));
            for (int cy = 0; cy <= Enum.GetValues(typeof(CimTipus)).Length - 1; cy++)
            {
                int value = (int)Enum.Parse(typeof(CimTipus), Enum.GetName(typeof(CimTipus), cy + 1));
                dynComboBindingSource.Add(new DynCombo(ct.GetStringValue(Enum.GetName(typeof(CimTipus), cy + 1)), value.ToString()));
            }

            dynComboBindingSource1.Clear();
            StringEnum mt = new StringEnum(typeof(MobilTipus));
            for (int cy = 0; cy <= Enum.GetValues(typeof(MobilTipus)).Length - 1; cy++)
            {

                int value = (int)Enum.Parse(typeof(MobilTipus), Enum.GetName(typeof(MobilTipus), cy + 1));
                dynComboBindingSource1.Add(new DynCombo(mt.GetStringValue(Enum.GetName(typeof(MobilTipus), cy + 1)), value.ToString()));
            }
        }
コード例 #2
0
ファイル: MMPartnerek.cs プロジェクト: hayrettinbebek/e-cafe
        private void loadPartnerek(string pPartnerType)
        {
            flpPartner.Controls.Clear();
            Partner_list pl = new Partner_list(new SqlConnection(DEFS.ConSTR));
            switch (pPartnerType)
            {
                case "T":
                    {
                        for (int i = 0; i < pl.lVevok.Count; i++)
                        {
                            if (((Partner)pl.lVevok[i]).P_TIPUS == pPartnerType)
                            {
                                PartnerButton pb = new PartnerButton();
                                pb.fPARTNER = (Partner)pl.lVevok[i];
                                pb.Click += ShowPartner;
                                pb.pnlRendel.Click += RendelToPartner;
                                if (((Partner)pl.lVevok[i]).RENDELES_ID > 0)
                                {
                                    pb.VAN_RENDEL = true;
                                }
                                flpPartner.Controls.Add(pb);
                            }

                        }
                        break;
                    }
                case "V":
                    {
                        for (int i = 0; i < pl.lVevok.Count; i++)
                        {
                            PartnerButton pb = new PartnerButton();
                            pb.fPARTNER = (Partner)pl.lVevok[i];
                            pb.Click += ShowPartner;

                            if (((Partner)pl.lVevok[i]).RENDELES_ID > 0)
                            {
                                pb.VAN_RENDEL = true;
                            }
                            pb.pnlRendel.Click += RendelToPartner;
                            flpPartner.Controls.Add(pb);

                        }

                        break;
                    }

                case "D":
                    {
                        for (int i = 0; i < pl.lVevok.Count; i++)
                        {
                            if (((Partner)pl.lVevok[i]).P_TIPUS == pPartnerType)
                            {
                                PartnerButton pb = new PartnerButton();
                                pb.fPARTNER = (Partner)pl.lVevok[i];
                                pb.Click += ShowPartner;
                                pb.pnlRendel.Click += RendelToPartner;
                                if (((Partner)pl.lVevok[i]).RENDELES_ID > 0)
                                {
                                    pb.VAN_RENDEL = true;
                                }
                                flpPartner.Controls.Add(pb);
                            }

                        }

                        break;
                    }

            }
        }