Пример #1
0
        public static void facultyConvert(out StaffFaculty sf, Faculty faculty)
        {
            sf = new StaffFaculty();
            sf.employeeType   = "Faculty";
            sf.id             = faculty.id;
            sf.date           = faculty.date;
            sf.date_gmt       = faculty.date_gmt;
            sf.guid           = faculty.guid;
            sf.modified       = faculty.modified;
            sf.modified_gmt   = faculty.modified_gmt;
            sf.slug           = faculty.slug;
            sf.status         = faculty.status;
            sf.type           = faculty.type;
            sf.link           = faculty.link;
            sf.title          = faculty.title;
            sf.author         = faculty.author;
            sf.template       = faculty.template;
            sf.affiliation    = faculty.affiliation;
            sf.department     = faculty.department;
            sf.group          = faculty.group;
            sf.interest       = faculty.interest;
            sf.netid          = faculty.netid;
            sf.email          = faculty.email;
            sf.firstname      = faculty.firstname;
            sf.nickname       = faculty.nickname;
            sf.middle_name    = faculty.middle_name;
            sf.lastname       = faculty.lastname;
            sf.user_image     = faculty.user_image;
            sf.phone_number   = faculty.phone_number;
            sf.fax            = faculty.fax;
            sf.user_title     = faculty.user_title;
            sf.isu_title      = faculty.isu_title;
            sf.hide_isu_title = faculty.hide_isu_title;
            sf.office         = (faculty.isu_office.Length - 1 > 4) ? faculty.isu_office.Remove(4) : faculty.isu_office;
            sf.isu_office     = faculty.isu_office;
            int tempint = faculty.isu_office.IndexOf('$');

            sf.isu_office      = faculty.isu_office.Substring(0, tempint >= 0 ? tempint - 1 : 0);
            sf.hide_isu_office = faculty.hide_isu_office;
            sf.external_link   = faculty.external_link;
            sf.info            = faculty.info;
            sf.publications    = faculty.publications;
            sf.links           = faculty.links;
        }
Пример #2
0
 /// <summary>
 /// Merges seperate classes Staff, Faculty into the master class, StaffFaculty
 /// </summary>
 /// <param name="staff"></param>
 /// <param name="faculty"></param>
 public void CombineStaffandFaculty(List <Staff> staff, List <Faculty> faculty)
 {
     //Convert all staff into StaffFaculty
     foreach (Staff s in staff)
     {
         StaffFaculty sf = new StaffFaculty();
         StaffFaculty.staffConvert(out sf, s);
         people.Add(sf);
         Staff.Add(sf);
     }
     //Convert all faculty into StaffFaculty
     foreach (Faculty f in faculty)
     {
         StaffFaculty sf = new StaffFaculty();
         StaffFaculty.facultyConvert(out sf, f);
         people.Add(sf);
         Faculty.Add(sf);
     }
 }
Пример #3
0
 public static void staffConvert(out StaffFaculty sf, Staff staff)
 {
     sf = new StaffFaculty();
     sf.employeeType = "Staff";
     sf.id           = staff.id;
     sf.date         = staff.date;
     //date_gmt = null;
     sf.guid = null;
     //modified = null;
     //modified_gmt = null;
     sf.slug            = staff.slug;
     sf.status          = null;
     sf.type            = staff.type;
     sf.link            = staff.link;
     sf.title           = staff.title;
     sf.author          = staff.author;
     sf.template        = null;
     sf.affiliation     = null;
     sf.department      = new List <int>();
     sf.group           = null;
     sf.interest        = null;
     sf.netid           = staff.netid;
     sf.email           = staff.email;
     sf.firstname       = staff.firstname;
     sf.nickname        = staff.nickname;
     sf.middle_name     = staff.middle_name;
     sf.lastname        = staff.lastname;
     sf.user_image      = staff.user_image;
     sf.phone_number    = staff.phone_number;
     sf.fax             = staff.fax;
     sf.user_title      = staff.user_title;
     sf.isu_title       = staff.isu_title;
     sf.hide_isu_title  = "false";
     sf.office          = (staff.isu_office.Length - 1 > 4) ? staff.isu_office.Remove(4) : staff.isu_office;
     sf.hide_isu_office = "false";
     sf.external_link   = staff.external_link;
     sf.info            = staff.info;
     sf.publications    = staff.publications;
     sf.links           = new Links();
 }