public SortView(STAFF staff) { this.id = staff.ID; this.Code = staff.CODE; this.Name = staff.NAME; this.Birthday = staff.BIRTHDAY; this.Hometown = staff.HOMETOWN; this.Room = staff.ROOM.NAME; this.Salary = staff.SALARY; }
public void AddStaff(string CODE, string NAME, DateTime BIRTHDAY, string HOMETOWN, int ROOM_ID, int SALARY) { var newClass = new STAFF(); newClass.CODE = CODE; newClass.NAME = NAME; newClass.BIRTHDAY = BIRTHDAY; newClass.HOMETOWN = HOMETOWN; newClass.ROOM_ID = ROOM_ID; newClass.SALARY = SALARY; var db = new MyRoomEntities(); db.STAFFs.Add(newClass); db.SaveChanges(); }