Exemplo n.º 1
0
        public override void Insert(IDictionary values, DataSourceViewOperationCallback callback)
        {
            try
            {
                ISoodaObjectFactory fact = SoodaTransaction.ActiveTransaction.GetFactory(_owner.ClassName);
                SoodaObject         obj  = fact.CreateNew(SoodaTransaction.ActiveTransaction);
                Type type = obj.GetType();

                foreach (DictionaryEntry v in values)
                {
                    PropertyInfo pi = type.GetProperty((string)v.Key, BindingFlags.Public | BindingFlags.Instance);
                    if (pi == null)
                    {
                        throw new SoodaException(v.Key + " not found in " + type.FullName);
                    }

                    pi.SetValue(obj, v.Value, null);
                }
                callback(1, null);
            }
            catch (Exception ex)
            {
                callback(0, ex);
            }
        }
Exemplo n.º 2
0
 private SoodaObject GetNewObject(ISoodaObjectFactory factory)
 {
     return factory.CreateNew(this);
 }
Exemplo n.º 3
0
 private SoodaObject GetNewObject(ISoodaObjectFactory factory)
 {
     return(factory.CreateNew(this));
 }