public void New(int TemplateID) { TemplateDataAdapter adapter = new TemplateDataAdapter(); try { this.Template = adapter.GetTemplate(TemplateID); } catch (Exception ex) { throw new Exception("Error trying to load teamplate in Template.New(). See inner exception for details.", ex); } try { this.Sections = Template.Sections; } catch (Exception ex) { throw new Exception("Error trying to load form in Template.New(). See inner exception for details.", ex); } }
public void Load(int ID, bool Recursive = true) { this.ID = ID; //getFormStructure(comm); TemplateDataAdapter adapter = new TemplateDataAdapter(); Template newTemp = adapter.GetTemplate(ID, Recursive); this.ID = newTemp.ID; this.Description = newTemp.Description; this.CreatedDate = newTemp.CreatedDate; this.Name = newTemp.Name; this.Sections = newTemp.Sections; }
public void Save() { //TODO: validation before attempting to save try { TemplateDataAdapter adapter = new TemplateDataAdapter(); adapter.SaveTemplate(this); } catch (Exception ex) { throw ex; } }