public ActionResult Edit(LocationBase location) { var previousRecord = _repository.GetLocation(location.ConferenceId, location.LocationId); if (previousRecord == null) { _repository.AddLocation(ref location, User.UserID); } else { location.CreatedOnDate = previousRecord.CreatedOnDate; location.CreatedByUserID = previousRecord.CreatedByUserID; _repository.UpdateLocation(location, User.UserID); } return ReturnRoute(location.ConferenceId, View("View", _repository.GetLocation(location.ConferenceId, location.LocationId))); }
public LocationBase GetLocationBase() { LocationBase res = new LocationBase(); res.LocationId = LocationId; res.ConferenceId = ConferenceId; res.Name = Name; res.Description = Description; res.Capacity = Capacity; res.Sort = Sort; res.BackgroundColor = BackgroundColor; res.CreatedByUserID = CreatedByUserID; res.CreatedOnDate = CreatedOnDate; res.LastModifiedByUserID = LastModifiedByUserID; res.LastModifiedOnDate = LastModifiedOnDate; return res; }
public LocationBase GetLocationBase() { LocationBase res = new LocationBase(); res.LocationId = LocationId; res.ConferenceId = ConferenceId; res.Name = Name; res.Description = Description; res.Capacity = Capacity; res.Sort = Sort; res.BackgroundColor = BackgroundColor; res.CreatedByUserID = CreatedByUserID; res.CreatedOnDate = CreatedOnDate; res.LastModifiedByUserID = LastModifiedByUserID; res.LastModifiedOnDate = LastModifiedOnDate; return(res); }
public void ReadLocationBase(LocationBase location) { if (location.LocationId > -1) { LocationId = location.LocationId; } if (location.ConferenceId > -1) { ConferenceId = location.ConferenceId; } if (!String.IsNullOrEmpty(location.Name)) { Name = location.Name; } if (!String.IsNullOrEmpty(location.Description)) { Description = location.Description; } if (location.Capacity > -1) { Capacity = location.Capacity; } if (location.Sort > -1) { Sort = location.Sort; } if (!String.IsNullOrEmpty(location.BackgroundColor)) { BackgroundColor = location.BackgroundColor; } }
public void ReadLocationBase(LocationBase location) { if (location.LocationId > -1) LocationId = location.LocationId; if (location.ConferenceId > -1) ConferenceId = location.ConferenceId; if (!String.IsNullOrEmpty(location.Name)) Name = location.Name; if (!String.IsNullOrEmpty(location.Description)) Description = location.Description; if (location.Capacity > -1) Capacity = location.Capacity; if (location.Sort > -1) Sort = location.Sort; if (!String.IsNullOrEmpty(location.BackgroundColor)) BackgroundColor = location.BackgroundColor; }