Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
        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();
        }