Example #1
0
        public RpcRecord(RpcConnection rpcConnection, string model, int?id, IEnumerable <RpcField> fieldsTemplate,
                         XmlRpcStruct vals = null)
        {
            _model         = model;
            _rpcConnection = rpcConnection;
            if (id == null)
            {
                _id = -1;
            }
            else
            {
                _id = (int)id;
            }

            if (id != null)
            {
                _fieldsResult = new List <RpcField>();
                foreach (var rpcField in fieldsTemplate)
                {
                    _fieldsResult.Add(new RpcField
                    {
                        FieldName = rpcField.FieldName,
                        Type      = rpcField.Type,
                        String    = rpcField.String,
                        Help      = rpcField.Help,
                        Changed   = false,
                        Value     = vals?[rpcField.FieldName]
                    });
                }
            }
            else
            {
                _fieldsResult = fieldsTemplate.ToList();
            }
        }
Example #2
0
        public RpcContext(RpcConnection rpcConnection, string modelName)
        {
            _rpcConnection = rpcConnection;
            _rpcModel      = new RpcModel(modelName, _rpcConnection);

            _records    = new List <RpcRecord>();
            RpcFilter   = new RpcFilter();
            _fieldNames = new List <string>();
        }
 public RpcModel(string modelName, RpcConnection rpcConnection)
 {
     _rpcConnection = rpcConnection;
     _modelName     = modelName;
     _fields        = new List <string>();
 }
Example #4
0
 public RpcService(RpcConnection connection, string model)
 {
     this.connection = connection;
     this.model      = model;
     propertiesName  = typeof(TEntity).GetPropertiesName();
 }