コード例 #1
0
        public EntryBase GetEntry(SqlEntry sqle)
        {
            EntryBase entry = null;

            entry = EntryFactory.GetEntry(sqle);
            return(entry);
        }
コード例 #2
0
        public void RemoveEntry(EntryBase entry)
        {
            Entries.Remove(entry);

            //remove from DataBase
            //Procedures.RemoveEntry(entry.SqlItem.Id);
        }
コード例 #3
0
        public CategoryBasic(SqlCategory cat)
        {
            SqlItem = cat;
            SqlSingleText st = Procedures.SingleTexts[cat.SqlSingleText];
            //SqlColorable c = Procedures.Colorables[cat.SqlColorable];
            SqlIconable i = Procedures.Iconables[cat.SqlIconable];

            //SqlSingleText
            SqlSingleTextObject = st;
            Text = st.Text;

            //IIconable
            SqlIconableObject = i;
            ImageSource       = i.ImageSource;

            Entries = new List <EntryBase>();
            foreach (SqlEntryStorage s in Procedures.EntryStorages.Values)
            {
                if (s.CategoryId != SqlItem.Id)
                {
                    continue;
                }
                SqlEntry  sqle  = Procedures.Entries[s.EntryId];
                EntryBase entry = GetEntry(sqle);
                Entries.Add(entry);
            }
        }
コード例 #4
0
        public void AddEntry(EntryBase entry)
        {
            Entries.Add(entry);

            //save to DataBase
            SqlEntryStorage ses = new SqlEntryStorage()
            {
                CategoryId = SqlItem.Id,
                EntryId    = entry.SqlItem.Id
            };

            Procedures.Insert(ses);
        }