Пример #1
0
        async public Task Insert(POSInvoice entity)
        {
            string record = toJson(entity);

            ServiceLayerResponse response = await _serviceLayerConnector.Post(SL_TABLE_NAME, record, false, true);

            if (!response.success)
            {
                string message = $"Erro ao enviar transação de '{entity.EntityName}': {response.errorCode}-{response.errorMessage}";
                Console.WriteLine(message);
                throw new ApplicationException(message);
            }
        }
Пример #2
0
        async public Task <POSInvoice> Find(List <Criteria> criterias)
        {
            POSInvoice result = null;

            List <POSInvoice> lista = await this.List(criterias);

            if (lista != null && lista.Count != 0)
            {
                result = lista[0];
            }
            ;

            return(result);
        }
Пример #3
0
        async Task <POSInvoice> IEntityServiceWithReturn <POSInvoice> .Insert(POSInvoice entity)
        {
            POSInvoice result = null;

            string record = toJson(entity);

            ServiceLayerResponse response = await _serviceLayerConnector.Post(SL_TABLE_NAME, record, false, true);

            if (!response.success)
            {
                string message = $"Erro ao enviar transação de '{entity.EntityName}': {response.errorCode}-{response.errorMessage}";
                Console.WriteLine(message);
                throw new ApplicationException(message);
            }
            else
            {
                ExpandoObject responseData = Global.parseQueryToObject(response.data);
                result = toRecord(responseData);
            }

            return(result);
        }
Пример #4
0
 public Task Delete(POSInvoice entity)
 {
     throw new NotImplementedException();
 }