コード例 #1
0
        static void Main(string[] args)
        {
            List <Dier> dieren = new List <Dier>();

            Koe huisKoe = new Koe("Maggie")
            {
                Gewicht = new Random().Next(400, 700)
            };

            dieren.Add(huisKoe);

            Slang huisSlang = new Slang("Sir Hiss")
            {
                Gewicht = new Random().Next(1, 5)
            };

            dieren.Add(huisSlang);

            Varken huisVarken = new Varken("Hamm")
            {
                Gewicht = new Random().Next(45, 100)
            };

            dieren.Add(huisVarken);

            dieren.ForEach(a => Console.WriteLine($"{a} zegt: {a.Zeg()}"));
        }
コード例 #2
0
ファイル: Subject.aspx.cs プロジェクト: LudmylaKov/Cursova
        protected void Page_Load(object sender, EventArgs e)
        {
            string[] langs = new string[5];
            langs[0] = "Англійська";
            langs[1] = "Французька";
            langs[2] = "Українська";
            langs[3] = "Німецька";
            langs[4] = "Російська";

            Slang.DataSource = langs;
            Slang.DataBind();
            //texting
            Subject s = new Subject();

            s.SubjectName = "Literature";
            s.Degree      = "rty";
            s.Language    = "Українська";
            s.Status      = "wtqerg";
            Subject s2 = new Subject();

            s2.SubjectName = "Art";
            s2.Degree      = "ragdhafjty";
            s2.Language    = "Французька";
            s2.Status      = "agagn";
            AllSubjects.GetRepository().AddSubject(s);
            AllSubjects.GetRepository().AddSubject(s2);
        }
コード例 #3
0
        private void AssignToButtons()
        {
            button1.Text = "Laat horen";

            //Maak objecten aan van de HuisdierenLibrary. Geef elke radiobutton een referentie naar dit object.
            Koe    koe    = new Koe("Maggie");
            Slang  slang  = new Slang("Sir Hiss");
            Varken varken = new Varken("Hamm");

            radioButton1.Tag  = koe;
            radioButton1.Name = koe.Naam;
            radioButton1.Text = koe.ToString();

            radioButton2.Tag  = slang;
            radioButton2.Name = slang.Naam;
            radioButton2.Text = slang.ToString();

            radioButton3.Tag  = varken;
            radioButton3.Name = varken.Naam;
            radioButton3.Text = varken.ToString();
        }
コード例 #4
0
        public static bool Add(Slang slang)
        {
            if (!slang.IsNull())
            {
                string CommandText = "INSERT INTO `" + Data_Server.Table_Slang + "` (word ,explanation ,synonyms ,lang )VALUES (@WORD,@EXPLANATION,@SYNONYMS,@LANG);";

                MysqlHelper.Open();
                MysqlHelper.cmd = new MySqlCommand(CommandText, MysqlHelper.conn);
                //MysqlHelper.cmd.CommandType = CommandType.StoredProcedure;
                MysqlHelper.cmd.Parameters.Add("@WORD", MySqlDbType.Char, 255, "word").Value = "slang.word";
                MysqlHelper.cmd.Parameters.Add("@EXPLANATION", MySqlDbType.Text).Value       = "slang.explanation";
                MysqlHelper.cmd.Parameters.Add("@SYNONYMS", MySqlDbType.Char).Value          = "slang.synonyms";
                MysqlHelper.cmd.Parameters.Add("@LANG", MySqlDbType.Char).Value = "slang.lang";
                foreach (MySqlParameter p in MysqlHelper.cmd.Parameters)
                {
                    System.Windows.Forms.MessageBox.Show(p.Value.ToString() + p.ParameterName);
                }
                MysqlHelper.cmd.ExecuteNonQuery();
            }
            return(false);
        }
コード例 #5
0
 public static Slang[] select(Slang slang)
 {
     MysqlHelper.Open();
     return(null);
 }
コード例 #6
0
 public static bool update(Slang slang)
 {
     MysqlHelper.Open();
     return(false);
 }