示例#1
0
 public Template Save()
 {
     var db = new DataProcess();
     if (History == null)
     {
         throw new TemplateException("Template should have a history reference.");
     }
     else
     {
         if (Id == null)
         {
             Id = db.saveTemplate(this);
         }
         else
         {
             db.updateTemplate(this);
         }
         return this;
     }
 }
示例#2
0
        public Template Save()
        {
            var db = new DataProcess();

            if (History == null)
            {
                throw new TemplateException("Template should have a history reference.");
            }
            else
            {
                if (Id == null)
                {
                    Id = db.saveTemplate(this);
                }
                else
                {
                    db.updateTemplate(this);
                }
                return(this);
            }
        }