Beispiel #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;
 }
Beispiel #2
0
 public ResponseStatus GetActivities(Container_List_Activity conta_Activity,bool isHasNoActive,bool isResume)
 {
     dalBase.sql = isHasNoActive ?
         "SELECT * FROM db_activity WHERE publishTime <= CURDATE() AND overEnd >=CURDATE() ORDER BY publishTime DESC" :
         "SELECT * FROM db_activity WHERE isactive=1 AND publishTime <= CURDATE() AND overEnd >=CURDATE() ORDER BY publishTime DESC";
     dalBase.sql += isResume ? " LIMIT 0,5" : "";
     bool isSuccess = dalBase.Run(Behavious.SELECT_WITHOUT_PARAM, false);
     return this.JudgeDBResult(isSuccess,
         () =>
         {
             conta_Activity.activities = new List<Activity>();
             while (dalBase.DataRead.Read())
             {
                 object a = dalBase.DataRead["preStart"];
                 conta_Activity.activities.Add(new Activity()
                 {
                     ID = Convert.ToInt32(dalBase.DataRead["id"]),
                     Content = dalBase.DataRead["content"].ToString(),
                     IsActive = Convert.ToByte(dalBase.DataRead["isactive"]),
                     IsVisitApply = Convert.ToByte(dalBase.DataRead["isVisitApply"]),
                     PublishTime = dalBase.DataRead["publishTime"] != DBNull.Value ? Convert.ToDateTime(dalBase.DataRead["publishTime"]) : GLB.initTime,
                     PreStart = dalBase.DataRead["preStart"] != DBNull.Value ? Convert.ToDateTime(dalBase.DataRead["preStart"]) : GLB.initTime,
                     OverEnd = dalBase.DataRead["overEnd"] != DBNull.Value ? Convert.ToDateTime(dalBase.DataRead["overEnd"]) : GLB.initTime,
                     ContentDetails = dalBase.DataRead["contentDetails"].ToString()
                 }
                );
             }
         },null);
 }
 public ResponseStatus GetActivities(Container_List_Activity conta_Activity,bool isHasNoActive)
 {
     activityDal = new ActivityDAL();
     ResponseStatus resp = activityDal.GetActivities(conta_Activity, isHasNoActive,false);
     activityDal.ReturnUnitToPool();
     return resp;
 }
 public ActivityController()
 {
     activityService = ServiceBuilder.BuildActivityService();
     conta_Activity = new Container_List_Activity();
 }