public OperationResult Delete(int Id)
        {
            var model = SystemDepartments.FirstOrDefault(t => t.Id == Id);

            model.IsDeleted = true;
            SystemDepartmentRepository.Delete(model);
            return(new OperationResult(OperationResultType.Success, "删除成功"));
        }
        public OperationResult Update(SystemDepartmentsModel model)
        {
            var entity = SystemDepartments.First(t => t.Id == model.Id);

            entity.Name                 = model.Name;
            entity.ParentID             = model.ParentId;
            entity.OrderSort            = model.OrderSort;
            entity.Enabled              = model.Enabled;
            entity.ModifyId             = model.ModifyId;
            entity.ModifyBy             = model.ModifyBy;
            entity.ModifyTime           = model.ModifyTime;
            entity.SystemOragnizationID = model.SystemOragnizationID;
            SystemDepartmentRepository.Update(entity);
            return(new OperationResult(OperationResultType.Success, "更新成功"));
        }
        public OperationResult Insert(SystemDepartmentsModel model)
        {
            var entity = new SystemDepartment
            {
                Name                 = model.Name,
                ParentID             = model.ParentId,
                CreateId             = model.CreateId,
                CreateBy             = model.CreateBy,
                CreateTime           = DateTime.Now,
                ModifyId             = model.ModifyId,
                ModifyBy             = model.ModifyBy,
                ModifyTime           = DateTime.Now,
                OrderSort            = model.OrderSort,
                SystemOragnizationID = model.SystemOragnizationID,
                Enabled              = model.Enabled
            };

            SystemDepartmentRepository.Insert(entity);
            return(new OperationResult(OperationResultType.Success, "添加成功"));
        }