コード例 #1
0
        public GroupDetailModel AddGroups(GroupDetailModel groups, out Header header)
        {
            GroupDetailModel groupDetailModel = new GroupDetailModel();

            try
            {
                header           = GlobalHelper.ConstructHeader(Messages.GroupAddSucces);
                groupDetailModel = this.unitOfWork.GroupDetailRepository.AddGroups(groups);
                if (groupDetailModel == null)
                {
                    header = GlobalHelper.ConstructHeader(Messages.GroupAlready);
                }
                return(groupDetailModel);
            }
            catch (Exception ex)
            {
                logger.Error(ex.StackTrace.ToString());
                if (ex.Message.Contains("Adding Group Failed"))
                {
                    header = GlobalHelper.ConstructHeader(ex, Messages.GroupAddFailed);
                }
                else
                {
                    header = GlobalHelper.ConstructHeader(ex, Messages.Exception);
                }

                return(groupDetailModel);
            }
        }
コード例 #2
0
 public EventsSummaryDetails GetEventsSummaryListByUserId(int userId, out Header header)
 {
     try
     {
         header = GlobalHelper.ConstructHeader();
         var events = this.unitOfWork.EventsRepository.GetEventsSummaryListByUserId(userId);
         return(events);
     }
     catch (Exception ex)
     {
         header = GlobalHelper.ConstructHeader(ex, Messages.ExceptionLoad);
         logger.Error(ex.StackTrace.ToString());
         return(null);
     }
 }
コード例 #3
0
 public List <GroupDetailModel> GetGroupsById(int userId, int groupId, out Header header)
 {
     try
     {
         header = GlobalHelper.ConstructHeader();
         var groups = this.unitOfWork.GroupDetailRepository.GetGroupsById(userId, groupId);
         return(groups);
     }
     catch (Exception ex)
     {
         header = GlobalHelper.ConstructHeader(ex, Messages.ExceptionLoad);
         logger.Error(ex.StackTrace.ToString());
         return(null);
     }
 }
コード例 #4
0
 public ICollection <PlanEventModel> GetEventsSummaryList(int userId, int summaryId, out Header header)
 {
     try
     {
         header = GlobalHelper.ConstructHeader();
         var events = this.unitOfWork.EventsRepository.GetEventsSummaryList(userId, summaryId);
         return(events);
     }
     catch (Exception ex)
     {
         header = GlobalHelper.ConstructHeader(ex, Messages.ExceptionLoad);
         logger.Error(ex.StackTrace.ToString());
         return(null);
     }
 }
コード例 #5
0
        public GroupDetailModel DeactiveGroup(GroupDetailModel groups, out Header header)
        {
            GroupDetailModel groupDetailModel = new GroupDetailModel();

            try
            {
                header           = GlobalHelper.ConstructHeader();
                groupDetailModel = this.unitOfWork.GroupDetailRepository.DeactiveGroup(groups);
                return(groupDetailModel);
            }
            catch (Exception ex)
            {
                header = GlobalHelper.ConstructHeader(ex, Messages.DeleteData);
                logger.Error(ex.StackTrace.ToString());
                return(groupDetailModel);
            }
        }
コード例 #6
0
        public PlanEventModel ImportEventsAttendance(PlanEventModel model, out Header header)
        {
            PlanEventModel planEventModel = new PlanEventModel();

            try
            {
                header         = GlobalHelper.ConstructHeader();
                planEventModel = this.unitOfWork.EventsRepository.ImportEventsAttendance(model);
                return(planEventModel);
            }
            catch (Exception ex)
            {
                header = GlobalHelper.ConstructHeader(ex, Messages.Exception);
                logger.Error(ex.StackTrace.ToString());
                return(planEventModel);
            }
        }
コード例 #7
0
        public WelcomeEventsModel WelcomeEventsModel(int userId, out Header header)
        {
            WelcomeEventsModel model = new WelcomeEventsModel();

            try
            {
                header = GlobalHelper.ConstructHeader();
                model  = this.unitOfWork.EventsRepository.WelcomeEventsModel(userId);
                return(model);
            }
            catch (Exception ex)
            {
                header = GlobalHelper.ConstructHeader(ex, Messages.ExceptionLoad);
                logger.Error(ex.StackTrace.ToString());
                model = null;
                return(model);
            }
        }
コード例 #8
0
 public GroupDetailModel ImportGroupAttendance(GroupDetailModel lstgroups, out Header header)
 {
     try
     {
         header    = GlobalHelper.ConstructHeader(Messages.GroupAddSucces);
         lstgroups = this.unitOfWork.GroupDetailRepository.ImportGroupAttendance(lstgroups);
         if (lstgroups == null)
         {
             header = GlobalHelper.ConstructHeader(Messages.Failed);
         }
         return(lstgroups);
     }
     catch (Exception ex)
     {
         logger.Error(ex.StackTrace.ToString());
         header = GlobalHelper.ConstructHeader(ex, Messages.Exception);
         return(lstgroups);
     }
 }
コード例 #9
0
        public GroupDetailModel EditGroups(GroupDetailModel groups, out Header header)
        {
            GroupDetailModel groupDetailModel = new GroupDetailModel();

            try
            {
                header           = GlobalHelper.ConstructHeader(Messages.AddUserUpdatedMessage);
                groupDetailModel = this.unitOfWork.GroupDetailRepository.EditGroups(groups);
                if (groupDetailModel == null)
                {
                    header = GlobalHelper.ConstructHeader(Messages.GroupAlready);
                }
                return(groupDetailModel);
            }
            catch (Exception ex)
            {
                header = GlobalHelper.ConstructHeader(ex, Messages.Exception);
                logger.Error(ex.StackTrace.ToString());
                return(groupDetailModel);
            }
        }