Advertisement
Guest User

Untitled

a guest
May 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. IList<Template> templates = new List<Template>();
  2.             foreach (string allowedTemplate in documentTypeModel.AllowedTemplates)
  3.             {
  4.                if(Convert.ToInt32(allowedTemplate) == -1)
  5.                {
  6.                   Template template = new Template(documentType.Title, DateTime.Now);
  7.                   templates.Add(template);
  8.                } else
  9.                {
  10.                   Template template = TemplateRepository.Get(Convert.ToInt32(allowedTemplate));
  11.                   templates.Add(template);
  12.                }  
  13.             }
  14.  
  15.             documentType.SetAllowedTemplates(templates);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement