Exemplo n.º 1
0
 public static void initmp(Template.ImportTemplate tmp)
 {
     if (noindex.Count == 0)
     {
         foreach (var x in tmp.ColumnMapping.Values)
         {
             if (x.Tablename.ToUpper() == "ST_DT")
             {
                 string colname = x.SystemColumnShowName;
                 if (noindex.ContainsKey(colname)) continue;
                 noindex.Add(colname, false);
             }
         }
     }
 }
Exemplo n.º 2
0
 public Boolean RemoveTemplate(Template templateName)
 {
     InitDB();
     using (var session = documentStore.OpenSession())
     {
         if (templateName.Zonename == "_template")
         {
             var tc = from x in session.Query<Template>()
                      where x.Name == templateName.Name
                      select x;
             session.Delete(tc);
         }
         else
         {
             Template newTemplate = new Template();
             newTemplate = session.Load<Template>(templateName.Id);
             session.Delete(newTemplate);
         }
         session.SaveChanges();
         return true;
     }
     return false;
 }
Exemplo n.º 3
0
 public Boolean InsertTemplate(Template template)
 {
     InitDB();
     using (var session = documentStore.OpenSession())
     {
         Template newTemplate = new Template();
         newTemplate.Name = template.Name;
         newTemplate.Description = template.Description;
         newTemplate.Created = DateTime.Now;
         newTemplate.Zonename = template.Zonename;
         newTemplate.Zonedescription = template.Zonedescription;
         newTemplate.Opacity = template.Opacity;
         newTemplate.X = template.X;
         newTemplate.Y = template.Y;
         newTemplate.Width = template.Width;
         newTemplate.Height = template.Height;
         if (template.Zonename == "_template")
         {
             Template newZone = new Template();
             newZone.Name = template.Name;
             newZone.X = 0;
             newZone.Y = 0;
             newZone.Width = 1024;
             newZone.Height = 768;
             newZone.Opacity = 1;
             newZone.Zonename = "Background";
             newZone.Zonedescription = "Template Background";
             session.Store(newZone);
         }
         session.Store(newTemplate);
         session.SaveChanges();
         return true;
     }
     return false;
 }
Exemplo n.º 4
0
 public ObservableCollection<Template> CollectZonesForTemplate(Template zone)
 {
     InitDB();
     try
     {
         using (var session = documentStore.OpenSession())
         {
             var lc = from x in session.Query<Template>()
                      where x.Name == zone.Name &&
                      x.Zonename != "_template"
                      select x;
             return new ObservableCollection<Template>(lc);
         }
     }
     catch (Exception ex)
     {
     }
     return null;
 }
Exemplo n.º 5
0
 public ObservableCollection<LoopContent> CollectLoopContentForZone(Template zone, Loop loop)
 {
     InitDB();
     using (var session = documentStore.OpenSession())
     {
         var lc = from x in session.Query<LoopContent>()
                  where x.Zoneid == zone.Id && x.Loopid == loop.Id
                  select x;
         return new ObservableCollection<LoopContent>(lc);
     }
     return null;
 }
Exemplo n.º 6
0
 public Boolean ChangeTemplate(Template templateName)
 {
     InitDB();
     Template newTemplate = new Template();
     using (var session = documentStore.OpenSession())
     {
         newTemplate = session.Load<Template>(templateName.Id);
         newTemplate.Name = templateName.Name;
         newTemplate.Description = templateName.Description;
         newTemplate.Zonename = templateName.Zonename;
         newTemplate.Zonedescription = templateName.Zonedescription;
         newTemplate.X = templateName.X;
         newTemplate.Y = templateName.Y;
         newTemplate.Width = templateName.Width;
         newTemplate.Height = templateName.Height;
         newTemplate.Opacity = templateName.Opacity;
         session.Store(newTemplate);
         session.SaveChanges();
         return true;
     }
     return false;
 }
Exemplo n.º 7
0
        public string ChangeMedia(Content mediaName)
        {
            InitDB();

            Template newTemplate = new Template();
            Content newMedia = new Content();
            string functionResult = "0";
            using (var session = documentStore.OpenSession())
            {
                newMedia = session.Load<Content>(mediaName.Id);
                newMedia.Contenttype = mediaName.Contenttype;
                newMedia.Metadata1 = mediaName.Metadata1;
                newMedia.Metadata2 = mediaName.Metadata2;
                newMedia.Metadata3 = mediaName.Metadata3;
                newMedia.Metadata4 = mediaName.Metadata4;
                newMedia.Metadata5 = mediaName.Metadata5;
                newMedia.Metadata6 = mediaName.Metadata6;
                newMedia.Metadata7 = mediaName.Metadata7;
                newMedia.Metadata8 = mediaName.Metadata8;
                newMedia.Metadata9 = mediaName.Metadata9;
                newMedia.Importdate = mediaName.Importdate;
                newMedia.Filesize = mediaName.Filesize;
                newMedia.Filelocation = mediaName.Filelocation;
                newMedia.Description = mediaName.Description;
                newMedia.Name = mediaName.Name;
                newMedia.Snapshot = mediaName.Snapshot;
                newMedia.Uploadstatus = mediaName.Uploadstatus;
                session.Store(newMedia);
                functionResult = newMedia.Id;
            }
            //newMedia.LoadByPrimaryKey((long)mediaName.Id);
            //AddUpdateDelta("content");
            return functionResult;
        }