예제 #1
0
        public void UpdateTemplatedDocumentData(TemplatedDocumentData data)
        {
            using (var db = new LogistoDb())
            {
                //db.TemplatedDocumentData.Where(w => w.ID == data.ID)
                //.Set(u => u.Data, data.Data)
                //.Update();

                File.WriteAllBytes(TEMPLATED_DOCUMENTS_ROOT + data.ID, data.Data);
            }
        }
예제 #2
0
        public int CreateTemplatedDocumentData(TemplatedDocumentData data)
        {
            using (var db = new LogistoDb())
            {
                var id = Convert.ToInt32(db.InsertWithIdentity(data));
                if (data.Data != null)
                {
                    File.WriteAllBytes(TEMPLATED_DOCUMENTS_ROOT + id, data.Data);
                }

                return(id);
            }
        }