Exemple #1
0
        public void Add(pub newPub)
        {
            using (DAO.adzadEntities adzadEntities = new DAO.adzadEntities())
            {
                adzadEntities.pubs.Add(newPub);
                adzadEntities.SaveChanges();

                int count = adzadEntities.pubs.Count();
            }
        }
Exemple #2
0
        public static List<v_WorkPlan> getWeekPlanByCondition(int indexPg, int pgSize, ref pub.PagerTClass pageT,int deptid, String content = "", String startTime = "", String endTime = "")
        {
            IEnumerable<v_WorkPlan> items;
            using (DataClassesEduDataContext dc = new DataClassesEduDataContext())
            {
                items = dc.v_WorkPlan;
                items = items.Where(i => i.detpId == deptid);
                if (!String.IsNullOrEmpty(content))
                    items = items.Where(i => i.content.Contains(content));
                if (!String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime))
                    items = items.Where(i => i.createTime >= Convert.ToDateTime(startTime) && i.createTime <= Convert.ToDateTime(endTime));
                else if (!String.IsNullOrEmpty(startTime))
                    items = items.Where(i => i.createTime >= Convert.ToDateTime(startTime));
                items = pageT.ShowPage(items, indexPg, pgSize);
                return items.ToList();

            }
        }
Exemple #3
0
        public static List<v_GZL_MyApplyItem> getApplyItemsByCondition(int indexPg,int pgSize,ref pub.PagerTClass pageT,String deptId="",String itemName="",String startTime="",String endTime="")
        {
            IEnumerable<v_GZL_MyApplyItem> items;
            using (DataClassesEduDataContext dc = new DataClassesEduDataContext())
            {
                items = dc.v_GZL_MyApplyItem;
                if (!String.IsNullOrEmpty(deptId))
                    items = items.Where(i => i.deptId == Convert.ToInt16(deptId));
                if (!String.IsNullOrEmpty(itemName))
                    items = items.Where(i => i.ItemName.Contains(itemName));
                if (!String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime))
                    items = items.Where(i => i.ApplyDate >= Convert.ToDateTime(startTime) && i.ApplyDate <= Convert.ToDateTime(endTime));
                else if (!String.IsNullOrEmpty(startTime))
                    items = items.Where(i => i.ApplyDate >= Convert.ToDateTime(startTime));
                items = pageT.ShowPage(items, indexPg, pgSize);
                return items.ToList();

            }
        }
Exemple #4
0
        public static List<Users> getUsers(int indexPg, int pgSize,ref pub.PagerTClass pageT,String XMPY = "")
        {
            IEnumerable<Users> u;

            using (DataClassesEduDataContext dc = new DataClassesEduDataContext())
            {
                if (!String.IsNullOrEmpty(XMPY))
                {
                    u = dc.Users.Where(us => us.XMPY.Contains(XMPY));
                }
                else
                {
                    u = dc.Users.OrderBy(a=>a.orderNo);
                }

                u = pageT.ShowPage(u, indexPg, pgSize);
                return u.ToList();
            }
        }
Exemple #5
0
 var(pub, sub) = scope.PubSub <(Option <T1>, Option <T2>, Option <T3>)>();