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; }
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(); }