Ejemplo n.º 1
0
        public T GetObjectByID <T>(CoreBase _Core)
        {
            DMLManager dml;

            if (_BLLCore.Action == InvokeOperation.Type.GS)
            {
                dml = new DMLManager(_BLLCore);
                dml.invoke();
                _BLLCore    = dml.DMLCore;
                dml.DMLCore = null;
                return(Cast <T>(_BLLCore));
            }
            // by shalin on 03.02.2011
            else if (_BLLCore.Action == InvokeOperation.Type.CQ)
            {
                dml = new DMLManager(_BLLCore);
                dml.invoke();
                _BLLCore    = dml.DMLCore;
                dml.DMLCore = null;
                return(Cast <T>(_BLLCore));
            }
            else
            {
                throw new Exception("Action is not Defined for the current Operation");;
            }
            //return _BLLCore;
        }
Ejemplo n.º 2
0
 private void GetParamFromReader(PropertyInfo[] properties, CoreBase clone, System.Data.IDataReader idr)
 {
     foreach (PropertyInfo info in properties)
     {
         if (!info.PropertyType.IsPrimitive && !info.PropertyType.IsValueType && info.PropertyType != typeof(System.String) && info.PropertyType != typeof(System.Text.StringBuilder) && info.Name.Substring(info.Name.Length - 2, 2) != "_P" && !info.PropertyType.IsGenericType)
         {
             if (info.PropertyType.ToString() == "System.Byte[]")
             {
                 //clone.GetType().GetProperty(info.Name).SetValue(clone, idr[info.Name], null);
             }
             else
             {
                 Type childType = info.PropertyType;
                 //CoreBase childClone = (CoreBase)Activator.CreateInstance(childType);
                 CoreBase childClone = GetParamFromReader(childType, idr);
                 //Type t1 = childClone.GetType();
                 //info.PropertyType.InvokeMember(
                 //clone.GetType().GetProperty(info.Name).SetValue(clone, ((childType)childClone), null);
                 MethodInfo castMethod = this.GetType().GetMethod("Cast").MakeGenericMethod(childType);
                 //object castedObject = castMethod.Invoke(null, new object[] { childClone });
                 clone.GetType().GetProperty(info.Name).SetValue(clone, castMethod.Invoke(null, new object[] { childClone }), null);
                 //clone.GetType().GetProperty(info.Name).SetValue(clone, Cast<XMBank.Core.CompanySetup.Company>(childClone), null);
             }
         }
         else
         {
             //info.Name  exists in dataReader
             if (DataRecordExtensions.HasColumn(idr, info.Name) && !DataRecordExtensions.IsNull(idr, info.Name))
             {
                 clone.GetType().GetProperty(info.Name).SetValue(clone, idr[info.Name], null);
             }
         }
     }
 }
Ejemplo n.º 3
0
        public IList <T> GetList <T>(CoreBase _Core)
        {
            //_Core = (CoreBase) HttpContext.Current.Session["Core"];
            DMLManager dml;

            try
            {
                dml = new DMLManager(_BLLCore);
                dml.invoke();
                _BLLCoreList    = dml.DMLCoreList;
                dml.DMLCoreList = null;
                dml             = null;
                if (_BLLCoreList != null)
                {
                    return(CastList <T>(_BLLCoreList));
                }
                else
                {
                    return(new List <T>());
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                //
            }
        }
Ejemplo n.º 4
0
 public DMLManager(CoreBase _DMLCore)
 {
     this._DMLCore = _DMLCore;
 }
Ejemplo n.º 5
0
 public ProcessManager(CoreBase _BLLCore)
 {
     this._BLLCore = _BLLCore;
 }
Ejemplo n.º 6
0
 public IList <CoreBase> GetListByCustomQuery(CoreBase _Core)
 {
     return(_BLLCoreList);
 }
Ejemplo n.º 7
0
 public IList <CoreBase> GetListWhere(CoreBase _Core)
 {
     return(_BLLCoreList);
 }