public List <string> SaveOrganisationUnit(OrganisationUnitJson ou)
        {
            List <string>  result = new List <string>();
            OrgUnitManager om     = new OrgUnitManager(this._uow);

            om.Save(new OrganisationUnitAssembler().ToEntity(ou, this._uow));
            return(result);
        }
        public OrganisationUnitJson TOJson(OrganizationUnit organ)
        {
            OrganisationUnitJson result = new OrganisationUnitJson();

            result.ID = organ.ID;
            result.ManagerFullName = organ.Manager.UserTitle;
            result.ManagerID       = organ.ManagerID;
            result.Title           = organ.Title;
            result.ParentId        = organ.ParentID;
            result.Users           = new UserAssembler().ToJsons(organ.Employees).ToList();
            return(result);
        }
        public OrganizationUnit ToEntity(OrganisationUnitJson orgjson, IUnitOfWork uow)
        {
            UserManager      um     = new UserManager(uow);
            OrganizationUnit result = new OrganizationUnit();

            result.Employees = new List <User>();
            result.ID        = orgjson.ID;
            result.ManagerID = orgjson.ManagerID;
            result.ParentID  = orgjson.ParentId;
            foreach (var user in orgjson.Users)
            {
                result.Employees.Add(um.GetByID(user.ID));
            }
            result.Title = orgjson.Title;
            return(result);
        }