コード例 #1
0
        public void GetDataForPersonalHome(HttpRequestBase req, Container_Notices_MyWorks_TeamWorks_Activities
                                           conTa_Notices_MyWorks_TeamWorks_Activities)
        {
            NoticeDAL noticeDal = new NoticeDAL();
            bool      isResume  = true;

            noticeDal.GetNotices(isResume, null, NoticeType.NONE);
            noticeDal.ReturnUnitToPool();
            conTa_Notices_MyWorks_TeamWorks_Activities.list_Notice = noticeDal.ListNotice;
            Container_List_Activity conta_Activity = new Container_List_Activity();
            ActivityDAL             activityDal    = new ActivityDAL();

            activityDal.GetActivities(conta_Activity, false, true);
            activityDal.ReturnUnitToPool();
            conTa_Notices_MyWorks_TeamWorks_Activities.list_Activity = conta_Activity.activities;
            List <Work> works   = new List <Work>();
            List <Work> m_works = new List <Work>();
            WorkDAL     workDal = new WorkDAL();

            for (int i = 0; i < req.Cookies.Count; ++i)
            {
                if (req.Cookies[i].Name.Contains(GLB.activity))
                {
                    workDal.GetWorks(Convert.ToInt32(req.Cookies[GLB.depId].Value), Convert.ToInt32(req.Cookies[i].Value), works, null);
                    workDal.GetWorks(Convert.ToInt32(req.Cookies[GLB.depId].Value), Convert.ToInt32(req.Cookies[i].Value),
                                     m_works, Convert.ToInt32(req.Cookies[GLB.id].Value));
                }
            }
            workDal.ReturnUnitToPool();
            conTa_Notices_MyWorks_TeamWorks_Activities.list_TeamWork = works;
            conTa_Notices_MyWorks_TeamWorks_Activities.list_MyWork   = m_works;
        }
コード例 #2
0
ファイル: WorkService.cs プロジェクト: Wright52/PublicWelfare
        public ResponseStatus GetWorks(HttpRequestBase req, ActivityWorks activityWorks, int id)
        {
            ResponseStatus resp = ResponseStatus.NONE;

            activityDal           = new ActivityDAL();
            activityWorks.id      = id;
            activityWorks.Content = activityDal.GetActivityContent(id);
            activityDal.ReturnUnitToPool();

            #region

            /*for (int i = 0; i < req.Cookies.Count; ++i)
             * {
             *   if (req.Cookies[i].Name.StartsWith(GLB.activity))
             *   {
             *       int activityId = Convert.ToInt32(req.Cookies[i].Value);
             *       int depId = Convert.ToInt32(req.Cookies[GLB.depId].Value);
             *       ActivityWorks aws = new ActivityWorks()
             *       {
             *           Content = activityDal.GetActivityContent(activityId)
             *       };
             *       List<Work> list_work = new List<Work>();
             *       resp = workDal.GetWorks(depId, activityId, list_work);
             *       if(resp == ResponseStatus.SUCCESS)
             *       {
             *           for (int n = 0; n < list_work.Count; ++n)
             *           {
             *               switch (list_work[n].Status)
             *               {
             *                   case WorkStatus.PROCESS:
             *                       aws.processWorks.Add(list_work[n]);
             *                       break;
             *                   case WorkStatus.WAITPASS:
             *                       aws.waitPassWorks.Add(list_work[n]);
             *                       break;
             *                   case WorkStatus.IMPROVE:
             *                       aws.improveWorks.Add(list_work[n]);
             *                       break;
             *                   case WorkStatus.FINISH:
             *                       aws.finishWorks.Add(list_work[n]);
             *                       break;
             *                   default:
             *                       break;
             *               }
             *           }
             *           activityworks.Add(aws);
             *       }
             *       else
             *       {
             *           break;
             *       }
             *    }
             * }*/
            #endregion

            workDal = new WorkDAL();
            int         depId     = Convert.ToInt32(req.Cookies[GLB.depId].Value);
            List <Work> list_work = new List <Work>();
            resp = workDal.GetWorks(depId, id, list_work, null);
            workDal.ReturnUnitToPool();

            //activityWorks.list_Works = resp == ResponseStatus.SUCCESS ? list_work : null;
            activityWorks.list_Works = list_work;

            return(resp);
        }