Exemplo n.º 1
0
        /// <summary>
        /// 查看班级列表
        /// </summary>
        public ActionResult ClassesList(int id)
        {
            NotifyViewData viewData = new NotifyViewData();

            List<Classes> TempList = null;
            if (GetOrg().OrgType.ToString().Equals("1"))
            {
                TempList = (from c in CQGJ.Classes
                            select c).ToList();
            }
            if (GetOrg().OrgType.ToString().Equals("3"))
            {
                int OrgID = GetOrg().OrgID;

                TempList = (from c in CQGJ.Classes
                            where c.Org.OrgID == OrgID
                            select c).ToList();

            }
            //取出了所有的列表
            //下步是取出实际的列表
            viewData.ClassesList = TempList.Skip((id - 1) * 20).Take(20).ToList();

            UrlManager urlManager = new DefaultUrlManager(TempList.Count(), 20);
            Pager pager = new Pager(urlManager);
            viewData.PagerString = pager.PagerString;

            return View("ClassesList", viewData);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 添加班级与单位通知
        /// </summary>
        public ActionResult ClassNotifyAdd()
        {
            NotifyViewData viewData = new NotifyViewData();
            viewData.NotifyList = (from n in CQGJ.Notify
                                   select n).ToList();

            viewData.OrgList = from o in CQGJ.Org
                               where o.OrgType == 2
                               select o;

            if (GetOrg().OrgType.ToString().Equals("1"))
            {
                viewData.ClassesList = (from c in CQGJ.Classes
                                        select c).ToList();
            }
            if (GetOrg().OrgType.ToString().Equals("3"))
            {
                int OrgID = GetOrg().OrgID;

                viewData.ClassesList = (from c in CQGJ.Classes
                                        where c.Org.OrgID == OrgID
                                        select c).ToList();
            }
            return View("NotifyAdd", viewData);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 查看单位通知列表
        /// </summary>
        public ActionResult OrgNotifyList(string id, int page)
        {
            NotifyViewData viewData = new NotifyViewData();
            int OrgID = GetOrg().OrgID;

            List<Notify> TempList = null;
            if (GetOrg().OrgType.ToString().Equals("1"))
            {
                TempList = (from n in CQGJ.Notify
                            from nm in CQGJ.NotifyMap
                            from o in CQGJ.Org
                            where nm.Notify.NotifyID == n.NotifyID && n.NotifyType == 2 && nm.ObjectID == o.OrgID && o.OrgCode == id
                            select n).ToList();
                viewData.NotifyList = TempList.Skip((page - 1) * 20).Take(20).ToList();
                UrlManager urlManager = new DefaultUrlManager(TempList.Count(), 20);
                Pager pager = new Pager(urlManager);
                viewData.PagerString = pager.PagerString;

                return View("OrgNotifyList", viewData);
            }
            if (GetOrg().OrgType.ToString().Equals("2"))
            {
                // 取出发给ORG的Notify列表
                TempList = (from n in CQGJ.Notify
                            from nm in CQGJ.NotifyMap
                            from o in CQGJ.Org
                            where nm.Notify.NotifyID == n.NotifyID && n.NotifyType == 2 && nm.ObjectID == o.OrgID
                            select n).AsEnumerable().Distinct().ToList();
                viewData.NotifyList = TempList.Skip((page - 1) * 20).Take(20).ToList();
                UrlManager urlManager = new DefaultUrlManager(TempList.Count(), 20);
                Pager pager = new Pager(urlManager);
                viewData.PagerString = pager.PagerString;

                return View("Org2NotifyList", viewData);
            }
            return null;
        }
Exemplo n.º 4
0
 public ActionResult OrgNotifyAdd()
 {
     NotifyViewData viewData = new NotifyViewData();
     viewData.NotifyList = (from n in CQGJ.Notify
                            select n).ToList();
     viewData.OrgList = from o in CQGJ.Org
                        where o.OrgType == 2
                        select o;
     return View("OrgNotifyAdd", viewData);
 }
Exemplo n.º 5
0
        /// <summary>
        /// 查看单位列表
        /// </summary>
        public ActionResult OrgList(int id)
        {
            NotifyViewData viewData = new NotifyViewData();
            var TempList = from o in CQGJ.Org
                           where o.OrgType == 2
                           orderby o.OrgID
                           select o;
            viewData.OrgList = TempList.Skip((id - 1) * 20).Take(20);
            UrlManager urlManager = new DefaultUrlManager(TempList.Count(), 20);
            Pager pager = new Pager(urlManager);
            viewData.PagerString = pager.PagerString;

            return View("OrgList", viewData);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 查看班级通知列表
        /// </summary>
        public ActionResult NotifyList(int id, int page)
        {
            NotifyViewData viewData = new NotifyViewData();
            //int ClassID = GetInt("ClassID");
            List<Notify> TempList = null;
            TempList = (from n in CQGJ.Notify
                        from nm in CQGJ.NotifyMap
                        where n.NotifyID == nm.Notify.NotifyID && nm.ObjectID == id
                        select n).ToList();
            viewData.NotifyList = TempList.Skip((page - 1) * 20).Take(20).ToList();
            UrlManager urlManager = new DefaultUrlManager(TempList.Count(), 20);
            Pager pager = new Pager(urlManager);
            viewData.PagerString = pager.PagerString;

            return View("NotifyList", viewData);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 查看班级通知
        /// </summary>
        /// <param name="id">班级通知ID</param>
        public ActionResult NotifyEdit(int id)
        {
            NotifyViewData viewData = new NotifyViewData();
            viewData.Notify = (from n in CQGJ.Notify where n.NotifyID == id select n).First();

            int? notifyType = viewData.Notify.NotifyType;
            if (notifyType == 1)
            {
                if (GetOrg().OrgType.ToString().Equals("1"))
                {
                    viewData.ClassesList = (from c in CQGJ.Classes
                                            select c).ToList();

                    // modified by 陈建平 2008.7.14
                    // 获取所有班级, 若该班级存在ID为id的班级通知,
                    // 则ClassNotify的MapNotifyMap属性为ID=id的NotifyMap,
                    // 否则ClassNotifyMap的MapNotifyMap为null
                    viewData.ClassNotifyList = (from c in CQGJ.Classes
                                                join nm in CQGJ.NotifyMap on c.ClassID equals nm.ObjectID into o
                                                select new ClassNotifyMap { Class = c, NotifyMap = o.Where(n => n.Notify.NotifyID == id).FirstOrDefault() }).ToList();
                }
                if (GetOrg().OrgType.ToString().Equals("3"))
                {
                    int OrgID = GetOrg().OrgID;

                    viewData.ClassesList = (from c in CQGJ.Classes
                                            where c.Org.OrgID == OrgID
                                            select c).ToList();

                    // modified by 陈建平 2008.7.14
                    // 获取所有班级, 若该班级存在ID为id的班级通知,
                    // 则ClassNotify的MapNotifyMap属性为ID=id的NotifyMap,
                    // 否则ClassNotifyMap的MapNotifyMap为null
                    viewData.ClassNotifyList = (from c in CQGJ.Classes
                                                join nm in CQGJ.NotifyMap on c.ClassID equals nm.ObjectID into o
                                                where c.Org.OrgID == OrgID
                                                select new ClassNotifyMap { Class = c, NotifyMap = o.Where(n => n.Notify.NotifyID == id).FirstOrDefault() }).ToList();
                }
            }
            else
            {
                viewData.OrgNotifyMapList = (from o in CQGJ.Org
                                             join nm in CQGJ.NotifyMap on o.OrgID equals nm.ObjectID into a
                                             select new OrgNotifyMap { Org = o, NotifyMap = a.Where(n => n.Notify.NotifyID == id).FirstOrDefault() }).ToList();

            }
            return View("NotifyEdit", viewData);
        }