public OUTemplateViewModel(LcpsDbContext context, Guid id)
        {
            _dbContext = context;
            _currentTemplate = _dbContext.OUTemplates.Find(id);

            LcpsAdsDomain dom = LcpsAdsDomain.Default;
            string d = dom.Name;
        }
        public ActionResult CreateOuTemplate(Guid id)
        {
            try
            {
                LcpsAdsOu ou = new LcpsAdsOu(id);
                OUTemplate t = new OUTemplate();
                t.OUId = id;
                t.TemplateName = ou.Name;
                t.Description = ou.Description;
                DbContext.OUTemplates.Add(t);
                DbContext.SaveChanges();

                return Content("Success", "text/html");
            }
            catch (Exception ex)
            {
                AnvilExceptionCollector ec = new AnvilExceptionCollector(ex);
                return Content(ec.ToUL(), "text/html");
            }
        }
        public ActionResult EditTemplate(OUTemplate m)
        {
            OUTemplateViewModel oum = new OUTemplateViewModel(DbContext);

            try
            {
                if (ModelState.IsValid)
                {
                    DbContext.Entry(m).State = System.Data.Entity.EntityState.Modified;
                    DbContext.SaveChanges();

                    return RedirectToAction("Index");
                }
                else
                {
                    return View();
                }
            }
            catch (Exception ex)
            {
                oum.Exception = ex;
                return View(oum);

            }
        }