Beispiel #1
0
        public object GetScaffold(Type type)
        {
            var obj = Activator.CreateInstance(type);

            var a1 = new ObjectEventArgs(type, obj);

            UIOMaticObjectService.OnScaffoldingObject(a1);

            return(a1.Object);
        }
Beispiel #2
0
        public string[] DeleteByIds(Type type, string[] ids)
        {
            var typeInfo = GetTypeInfo(type);
            var attri    = type.GetCustomAttribute <UIOMaticAttribute>();
            var repo     = Helper.GetRepository(attri, typeInfo);

            var a1 = new DeleteEventArgs(typeInfo.Type, ids);

            UIOMaticObjectService.OnDeletingObjects(a1);
            ids = a1.Ids;

            repo.Delete(ids);

            var a2 = new DeleteEventArgs(typeInfo.Type, ids);

            UIOMaticObjectService.OnDeletedObjects(a2);

            return(a2.Ids);
        }
Beispiel #3
0
        public object Update(Type type, IDictionary <string, object> values)
        {
            var obj = CreateAndPopulateType(type, values);

            var typeInfo = GetTypeInfo(type);
            var attri    = type.GetCustomAttribute <UIOMaticAttribute>();
            var repo     = Helper.GetRepository(attri, typeInfo);

            var a1 = new ObjectEventArgs(typeInfo.Type, obj);

            UIOMaticObjectService.OnUpdatingObject(a1);
            obj = a1.Object;

            obj = repo.Update(obj);

            var a2 = new ObjectEventArgs(typeInfo.Type, obj);

            UIOMaticObjectService.OnUpdatedObject(a2);

            return(a2.Object);
        }