コード例 #1
0
        public Olustur FactoryMethod(Bolumler bolumTip)
        {
            Olustur olustur = null;

            switch (bolumTip)
            {
            case Bolumler.bolum1:
                olustur = new bolum1();
                break;

            case Bolumler.bolum2:
                olustur = new bolum2();
                break;

            case Bolumler.bolum3:
                olustur = new bolum3();
                break;

            case Bolumler.bolum4:
                olustur = new bolum4();
                break;

            case Bolumler.bolum5:

                break;
            }
            return(olustur);
        }
コード例 #2
0
        public override List <Olustur> kartOlustur(string kID, string Aciklama)
        {
            olustur = new bolum1();


            olustur.KartId       = kID;
            olustur.KartAciklama = Aciklama;
            Kart1.Add(olustur);
            return(Kart1);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: incikucuk/SinamaProjesi
        public void ProgramYenile()
        {
            connect();
            Creater creater = new Creater();

            SqlCommand    command = new SqlCommand("Select * From tbl_card", _baglan);
            SqlDataReader reader  = command.ExecuteReader();
            Olustur       panel1  = new bolum1();
            Olustur       panel2  = new bolum2();
            Olustur       panel3  = new bolum3();
            Olustur       panel4  = new bolum4();
            Olustur       panel5  = new bolum5();

            List <Olustur> pnl1  = new List <Olustur>();
            List <Olustur> pnl2  = new List <Olustur>();
            List <Olustur> pnl3  = new List <Olustur>();
            List <Olustur> pnl4  = new List <Olustur>();
            List <Olustur> pnl5  = new List <Olustur>();
            List <Olustur> pnl51 = new List <Olustur>();

            while (reader.Read())
            {
                string PanelID = reader["KartListNo"].ToString();
                switch (PanelID)
                {
                case "1":
                    pnl1 = panel1.kartOlustur(reader["KartNo"].ToString(), reader["ProjeAd"].ToString());

                    break;

                case "2":
                    pnl2 = panel2.kartOlustur(reader["KartNo"].ToString(), reader["ProjeAd"].ToString());

                    break;

                case "3":
                    pnl3 = panel3.kartOlustur(reader["KartNo"].ToString(), reader["ProjeAd"].ToString());

                    break;

                case "4":
                    pnl4 = panel4.kartOlustur(reader["KartNo"].ToString(), reader["ProjeAd"].ToString());

                    break;

                case "5":
                    pnl5 = panel5.kartOlustur(reader["KartNo"].ToString(), reader["ProjeAd"].ToString());


                    break;
                }
            }
            reader.Close();
            _baglan.Close();
            dGVlist1.DataSource = pnl1;
            dGVlist2.DataSource = pnl2;
            dGVlist3.DataSource = pnl3;
            dGVlist4.DataSource = pnl4;
            dGVlist5.DataSource = pnl5;
            metroComboBox1.Items.Add(1);
            metroComboBox1.Items.Add(2);
            metroComboBox1.Items.Add(3);
            metroComboBox1.Items.Add(4);
            metroComboBox1.Items.Add(5);
        }