예제 #1
0
        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);
        }