Beispiel #1
0
        public IList <TB_DailyPlanSign> QueryEntryByDate(DateTime dateTime)
        {
            IList <TB_DailyPlanSign> result = new List <TB_DailyPlanSign>();

            using (var db = this.dbFactory.OpenDefalutDataBase())
            {
                foreach (var item in db.GetEntities <TB_DailyPlanSign>(TB_DailyPlanSignSet.SelectAll().Where(TB_DailyPlanSignSet.Date.Equal(FormatDate(dateTime)))))
                {
                    result.Add(item);
                }
            }
            return(result);
        }
Beispiel #2
0
        public IList <TB_DailyPlanSign> QueryEntryByDateAndCatalog(DateTime startDate, DateTime endDate, long p)
        {
            IList <TB_DailyPlanSign> result = new List <TB_DailyPlanSign>();

            using (var db = this.dbFactory.OpenDefalutDataBase())
            {
                var q_Start   = TB_DailyPlanSignSet.Date.BiggerThan(FormatDate(startDate));
                var q_End     = TB_DailyPlanSignSet.Date.SmallerThan(FormatDate(endDate));
                var q_catalog = TB_DailyPlanSignSet.CatalogID.Equal(p);
                var q_sign    = TB_DailyPlanSignSet.IsSign.Equal("True");
                foreach (var item in db.GetEntities <TB_DailyPlanSign>(TB_DailyPlanSignSet.SelectAll().Where(q_Start.And(q_End).And(q_catalog).And(q_sign))))
                {
                    result.Add(item);
                }
            }
            return(result);
        }
Beispiel #3
0
        public DataTable CreateTable()
        {
            if (ResultTable != null)
            {
                ResultTable.Clear();
                ResultTable.Columns.Clear();
            }

            ResultTable = new DataTable();
            IDictionary <long, string> CatalogIDMaps = new Dictionary <long, string>();

            ResultTable.Columns.Add(new DataColumn("日期", typeof(string)));
            foreach (var item in new DailyPlanCatalogManageController().TravleAllEntities())
            {
                CatalogIDMaps.Add(item.ID, item.Name);
                ResultTable.Columns.Add(item.Name, typeof(object));
            }

            using (var db = GParam.Create().OpenDefalutDataBase())
            {
                DateTime currentDate = StartDate;

                while (currentDate.CompareTo(EndDate) <= 0)
                {
                    DataRow tempRow = ResultTable.NewRow();
                    IList <TB_DailyPlanSign> SignRecord = db.GetEntities <TB_DailyPlanSign>(TB_DailyPlanSignSet.SelectAll().Where(TB_DailyPlanSignSet.Date.Equal(currentDate.ToString("yyyy-MM-dd"))));
                    tempRow["日期"] = currentDate.ToString("yyyy年MM月dd日");
                    if (SignRecord != null && SignRecord.Count != 0)
                    {
                        foreach (var item in SignRecord)
                        {
                            if (Boolean.Parse(item.IsSign))
                            {
                                tempRow[CatalogIDMaps[item.CatalogID]] = item;
                            }
                        }
                    }
                    currentDate = currentDate.AddDays(1);
                    ResultTable.Rows.Add(tempRow);
                }
            }
            return(ResultTable);
        }
Beispiel #4
0
 protected override Moon.Orm.MQLBase onCreateMQL_QueryAllEntities()
 {
     return(TB_DailyPlanSignSet.SelectAll());
 }