示例#1
0
文件: DBLoader.cs 项目: CFLShine/CFL
        /// <summary>
        /// Les données sont extraites de la ligne en cours du reader.
        /// </summary>
        public void SetValuesToClassProxy(ClassProxy _proxy, DBRow _row)
        {
            _proxy.ID = _row.GetId();

            for (int _i = 0; _i < _row.Count; _i++)
            {
                DBField _field        = _row.GetField(_i);
                string  _propertyName = _field.PropertyName;

                PropertyProxy _prProxy = _proxy.GetPropertyProxy(_propertyName);

                if (_prProxy != null)
                {
                    SetValueToProperty(_prProxy, _field.Value);
                }
            }
        }
示例#2
0
文件: DBLoader.cs 项目: CFLShine/CFL
        private string IncludeQuery(ClassProxy _classProxy, string _memberName)
        {
            PropertyProxy _prProxy = _classProxy.GetPropertyProxy(_memberName);

            if (_prProxy is PropertyObjectProxy _prObjectProxy)
            {
                return(IncludeClassQuery(_prObjectProxy));
            }
            else
            if (_prProxy is PropertyListProxy _prListProxy)
            {
                return(IncludeListQuery(_prListProxy));
            }
            else
            {
                throw new Exception("Le type " + _prProxy.GetType().Name + " n'est pas prévu pour Include.");
            }
        }