예제 #1
0
        public View(STUDENT stu)
        {
            this.ID       = stu.ID;
            this.FULLNAME = stu.FULLNAME;
            this.BIRTHDAY = stu.BIRTHDAY;
            string gen = "Female";

            if (stu.GENDER == true)
            {
                gen = "Male";
            }
            this.GENDER = gen;
            this.CLASS  = stu.CLASS.CLASSNAME;
        }
예제 #2
0
        public void CreateStudent(string name, bool gender, DateTime birth, int class_id)
        {
            var stu = new STUDENT();

            stu.FULLNAME = name;
            stu.GENDER   = gender;
            stu.BIRTHDAY = birth;
            stu.CLASS_ID = class_id;

            var db = new MyDatabaseEntities();

            db.STUDENTs.Add(stu);
            db.SaveChanges();
        }