Example #1
0
        public BusinessEntity.Result DeleteMeetingFollowup(BusinessEntity.Meeting.MeetingFollowupEntity MeetingFollowup)
        {
            BusinessEntity.Result result = new BusinessEntity.Result();
            try
            {
                SchoolInformationManagementSystemDBEntities e = new SchoolInformationManagementSystemDBEntities();
                var original = e.tblMeetingFollowups.Find(MeetingFollowup.ID);
                if (original != null)
                {
                    e.tblMeetingFollowups.Remove(e.tblMeetingFollowups.Where(x => x.ID == MeetingFollowup.ID).First());
                    e.SaveChanges();

                    result.Message = "Deleted Successfully.";
                    result.Status  = true;
                    return(result);
                }
                else
                {
                    result.Message = "Failed to delete";
                    result.Status  = false;
                    return(result);
                }
            }
            catch (Exception)
            {
                result.Message = "Failed to delete";
                result.Status  = false;
                return(result);
            }
        }
Example #2
0
        public BusinessEntity.Result UpdateMeetingFollowup(BusinessEntity.Meeting.MeetingFollowupEntity MeetingFollowup)
        {
            BusinessEntity.Result result = new BusinessEntity.Result();
            try
            {
                SchoolInformationManagementSystemDBEntities e = new SchoolInformationManagementSystemDBEntities();
                var original = e.tblMeetingFollowups.Find(MeetingFollowup.ID);
                if (original != null)
                {
                    e.Entry(original).CurrentValues.SetValues(MeetingFollowup);
                    e.SaveChanges();

                    result.Message = "Updated Successfully.";
                    result.Status  = true;
                    return(result);
                }
                else
                {
                    result.Message = "Failed to update";
                    result.Status  = false;
                    return(result);
                }
            }
            catch (Exception)
            {
                result.Message = "Failed to update";
                result.Status  = false;
                return(result);
            }
        }
Example #3
0
        public Models.Meeting.MeetingFollowupModel GetMeetingFollowupByID(int MeetingFollowupID)
        {
            BusinessLogic.Meeting.MeetingFollowupManager MeetingFollowupManager = new BusinessLogic.Meeting.MeetingFollowupManager();
            BusinessEntity.Meeting.MeetingFollowupEntity MeetingFollowup        = MeetingFollowupManager.GetMeetingFollowupByID(MeetingFollowupID);

            return(new Models.Meeting.MeetingFollowupModel(MeetingFollowup));
        }
        public MeetingFollowupModel(BusinessEntity.Meeting.MeetingFollowupEntity meetingFollowup)
        {
            this.ID           = meetingFollowup.ID;
            this.DetailMinute = meetingFollowup.DetailMinute;

            this.MeetingSchedule = new MeetingScheduleModel(meetingFollowup.MeetingSchedule);

            this.CreatedBy   = meetingFollowup.CreatedBy;
            this.CreatedDate = meetingFollowup.CreatedDate;
            this.UpdatedBy   = meetingFollowup.UpdatedBy;
            this.UpdatedDate = meetingFollowup.UpdatedDate;
        }
        public T MapToEntity <T>() where T : class
        {
            BusinessEntity.Meeting.MeetingFollowupEntity meetingFollowup = new BusinessEntity.Meeting.MeetingFollowupEntity();
            meetingFollowup.ID           = this.ID;
            meetingFollowup.DetailMinute = this.DetailMinute;

            meetingFollowup.MeetingSchedule = this.MeetingSchedule.MapToEntity <BusinessEntity.Meeting.MeetingScheduleEntity>();

            meetingFollowup.CreatedBy   = this.CreatedBy;
            meetingFollowup.CreatedDate = this.CreatedDate;
            meetingFollowup.UpdatedBy   = this.UpdatedBy;
            meetingFollowup.UpdatedDate = this.UpdatedDate;

            return(meetingFollowup as T);
        }
Example #6
0
        public BusinessEntity.Result SaveMeetingFollowup(BusinessEntity.Meeting.MeetingFollowupEntity MeetingFollowup)
        {
            BusinessEntity.Result result = new BusinessEntity.Result();
            try
            {
                SchoolInformationManagementSystemDBEntities e = new SchoolInformationManagementSystemDBEntities();
                e.tblMeetingFollowups.Add(MeetingFollowup.MapToModel <DataAccessLogic.tblMeetingFollowup>());
                e.SaveChanges();

                result.Message = "Saved Successfully.";
                result.Status  = true;
                return(result);
            }
            catch (Exception)
            {
                result.Message = "Failed to save";
                result.Status  = false;
                return(result);
            }
        }