Exemplo n.º 1
0
        public static TopTenDelete GetModelView(TopTen topTen)
        {
            if (topTen == null)
                return null;

            var topTenDelete = new TopTenDelete(topTen);
            return topTenDelete;
        }
Exemplo n.º 2
0
        /// <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;
            }
        }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 /// <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;
 }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
        public static TopTenEdit GetModelView(TopTen topTen)
        {
            if (topTen == null)
                return null;

            var topTenEdit = new TopTenEdit(topTen);
            return topTenEdit;
        }
Exemplo n.º 7
0
 public TopTenDelete(TopTen topTen)
 {
     ToUser = UserProfileDetails.GetModelView(topTen.ToUser);
 }
Exemplo n.º 8
0
        public static TopTenDetails GetModelView(TopTen topTen)
        {
            if (topTen == null)
                return null;

            var topTenDetail = new TopTenDetails(topTen);
            return topTenDetail;
        }
Exemplo n.º 9
0
 private bool IsAccess(TopTen topTen)
 {
     return topTen != null;
 }
Exemplo n.º 10
0
 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;
 }
Exemplo n.º 11
0
        /// <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;
        }
Exemplo n.º 12
0
 /// <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();
 }