public static TopTenDelete GetModelView(TopTen topTen) { if (topTen == null) return null; var topTenDelete = new TopTenDelete(topTen); return topTenDelete; }
/// <summary> /// Deletes the specified db. /// </summary> /// <param name="db">The db.</param> /// <param name="topTenId">The top ten id.</param> /// <param name="fromUserId">From user id.</param> /// <param name="topTen">The top ten.</param> /// <returns>DeleteResult.</returns> public static DeleteResult Delete(DefaultContext db, int topTenId, int fromUserId, out TopTen topTen) { topTen = GetDetail(db, topTenId, fromUserId); if (topTen == null) return DeleteResult.AuthorizationFailed; try { db.TopTens.Remove(topTen); db.SaveChanges(); return DeleteResult.Ok; } catch (Exception e) { Logger.SetLog(e); return DeleteResult.DbFailed; } }
private TopTenDetails(TopTen topTen) { TopTenId = topTen.TopTenId; ToUser = UserProfileDetails.GetModelView(topTen.ToUser); Status = topTen.Status; RoleLocalized = topTen.RoleLocalized; ShortTermCareerGoal = topTen.ShortTermCareerGoal; LongTermCareerGoal = topTen.LongTermCareerGoal; TrainingPhone = topTen.TrainingPhone; TrainingVideo = topTen.TrainingVideo; TrainingBiPresentation = topTen.TrainingBiPresentation; TrainingStLecture = topTen.TrainingStLecture; Od1 = topTen.Od1; Od2 = topTen.Od2; Rhetoric = topTen.Rhetoric; TeamLeadershipping = topTen.TeamLeadershipping; ConductingMeetings = topTen.ConductingMeetings; Sns = topTen.Sns; AdditionalTraining = topTen.AdditionalTraining; ActualCareerStage = topTen.ActualCareerStage; LastContact = topTen.LastContact; Note = topTen.Note; Tasks = topTen.Tasks; }
/// <summary> /// Prevents a default instance of the <see cref="TopTenIndex"/> class from being created. /// </summary> private TopTenIndex(TopTen topTen) { TopTenId = topTen.TopTenId; FirstName = topTen.ToUser.FirstName; LastName = topTen.ToUser.LastName; Status = topTen.Status; LastContact = topTen.LastContact; ActualCareerStage = topTen.ActualCareerStage; Role = topTen.Role; LyonessId = topTen.ToUser.LyonessId; }
public TopTen GetModel() { var topTen = new TopTen { TopTenId = TopTenId, ToUserId = ToUserId, LastContact = LastContact, ShortTermCareerGoal = ShortTermCareerGoal, LongTermCareerGoal = LongTermCareerGoal, TrainingPhone = TrainingPhone, TrainingVideo = TrainingVideo, TrainingBiPresentation = TrainingBiPresentation, TrainingStLecture = TrainingStLecture, Od1 = Od1, Od2 = Od2, Rhetoric = Rhetoric, TeamLeadershipping = TeamLeadershipping, ConductingMeetings = ConductingMeetings, Sns = Sns, AdditionalTraining = AdditionalTraining, ActualCareerStage = ActualCareerStage, Tasks = Tasks, Note = Note, Status = Status }; return topTen; }
public static TopTenEdit GetModelView(TopTen topTen) { if (topTen == null) return null; var topTenEdit = new TopTenEdit(topTen); return topTenEdit; }
public TopTenDelete(TopTen topTen) { ToUser = UserProfileDetails.GetModelView(topTen.ToUser); }
public static TopTenDetails GetModelView(TopTen topTen) { if (topTen == null) return null; var topTenDetail = new TopTenDetails(topTen); return topTenDetail; }
private bool IsAccess(TopTen topTen) { return topTen != null; }
public void CopyFrom(TopTen topTen) { LastContact = topTen.LastContact; ShortTermCareerGoal = topTen.ShortTermCareerGoal; LongTermCareerGoal = topTen.LongTermCareerGoal; TrainingPhone = topTen.TrainingPhone; TrainingVideo = topTen.TrainingVideo; TrainingBiPresentation = topTen.TrainingBiPresentation; TrainingStLecture = topTen.TrainingStLecture; Od1 = topTen.Od1; Od2 = topTen.Od2; Rhetoric = topTen.Rhetoric; TeamLeadershipping = topTen.TeamLeadershipping; ConductingMeetings = topTen.ConductingMeetings; Sns = topTen.Sns; AdditionalTraining = topTen.AdditionalTraining; ActualCareerStage = topTen.ActualCareerStage; Tasks = topTen.Tasks; Note = topTen.Note; Status = topTen.Status; }
/// <summary> /// Updates the specified db. /// </summary> /// <param name="db">The db.</param> /// <param name="fromUserId">From user id.</param> /// <param name="topTen">The top ten.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns> public static bool Update(DefaultContext db, int fromUserId, ref TopTen topTen) { TopTen dbTopTen = GetDetail(db, topTen.TopTenId, fromUserId); if (dbTopTen == null) return false; dbTopTen.CopyFrom(topTen); db.SaveChanges(); topTen = dbTopTen; return true; }
/// <summary> /// Inserts the specified db. /// </summary> /// <param name="db">The db.</param> /// <param name="fromUserId">From user id.</param> /// <param name="topTen">The top ten.</param> public static void Insert(DefaultContext db, int fromUserId, ref TopTen topTen) { topTen.FromUserId = fromUserId; db.TopTens.Add(topTen); db.SaveChanges(); }