public void DeleteGroup(GroupTemplates groupTemplates) { var group = Groups.SingleOrDefault(x => x.Id.Equals(groupTemplates.Id)); if (group != null) { Groups.Remove(group); } Save(); }
public void DeleteTemplate(GroupTemplates groupTemplates, TemplateSettings template) { var group = Groups.SingleOrDefault(x => x.Id.Equals(groupTemplates.Id)); var tmplt = group.Templates.SingleOrDefault(x => x.Id.Equals(template.Id)); if (tmplt != null) { group.Templates.Remove(tmplt); } Save(); }
public int SaveGroup(GroupTemplates groupTemplates) { var group = Groups.SingleOrDefault(x => x.Id.Equals(groupTemplates.Id)); if (group == null) { Groups.Add(groupTemplates); } else { group.Name = groupTemplates.Name; group.Enabled = groupTemplates.Enabled; } Save(); return(Groups.FindIndex(x => x.Id.Equals(groupTemplates.Id))); }
public int SaveTemplate(GroupTemplates groupTemplates, TemplateSettings template) { var tmplt = groupTemplates.Templates.SingleOrDefault(x => x.Id.Equals(template.Id)); if (tmplt == null) { groupTemplates.Templates.Add(template); } else { tmplt.Name = template.Name; tmplt.Enabled = template.Enabled; tmplt.PerEntity = template.PerEntity; tmplt.FileExt = template.FileExt; tmplt.Code = template.Code; tmplt.Language = template.Language; } Save(); return(groupTemplates.Templates.FindIndex(x => x.Id.Equals(template.Id))); }