protected override void LoadViewState(object savedState)
 {
     base.LoadViewState(savedState);
     if (ViewState["Attendance"] != null)
     {
         string json = ViewState["Attendance"] as string;
         _attendance = Attendance.FromJsonAsList(json) ?? new List <Attendance>();
         foreach (var attendee in _attendance)
         {
             attendee.PersonAlias = _personAliasService.Get(attendee.PersonAliasId.Value);
         }
     }
     else
     {
         _attendance = new List <Attendance>();
     }
 }
Esempio n. 2
0
 protected override void LoadViewState(object savedState)
 {
     base.LoadViewState(savedState);
     if (ViewState["CampusId"] != null)
     {
         _campusId = ViewState["CampusId"] as int?;
     }
     if (ViewState["GroupId"] != null)
     {
         _groupId = ViewState["GroupId"] as int?;
     }
     if (ViewState["LocationId"] != null)
     {
         _locationId = ViewState["LocationId"] as int?;
     }
     if (ViewState["StartDateTime"] != null)
     {
         _startDateTime = ViewState["StartDateTime"] as DateTime?;
     }
     if (ViewState["ScheduleId"] != null)
     {
         _scheduleId = ViewState["ScheduleId"] as int?;
     }
     if (ViewState["Attendance"] != null)
     {
         string json = ViewState["Attendance"] as string;
         _attendance = Attendance.FromJsonAsList(json) ?? new List <Attendance>();
         foreach (var attendee in _attendance)
         {
             attendee.PersonAlias = _personAliasService.Get(attendee.PersonAliasId.Value);
         }
     }
     else
     {
         _attendance = new List <Attendance>();
     }
     if (ViewState["ToAdd"] != null)
     {
         string json = ViewState["ToAdd"] as string;
         _attendanceToAdd = Attendance.FromJsonAsList(json) ?? new List <Attendance>();
         foreach (var attendee in _attendanceToAdd)
         {
             attendee.PersonAlias = _personAliasService.Get(attendee.PersonAliasId.Value);
         }
     }
     else
     {
         _attendanceToAdd = new List <Attendance>();
     }
     if (ViewState["ToRemove"] != null)
     {
         _attendanceToRemove = ViewState["ToRemove"] as List <int>;
     }
     else
     {
         _attendanceToRemove = new List <int>();
     }
     if (ViewState["ToChange"] != null)
     {
         _attendanceToChange = ViewState["ToChange"] as List <int>;
     }
     else
     {
         _attendanceToChange = new List <int>();
     }
     if (ViewState["IsDirty"] != null)
     {
         hfIsDirty.Value = (ViewState["IsDirty"] as bool?).ToString();
     }
 }