Ejemplo n.º 1
0
 public JsonResult GetBalances([FromBody] ClientDetailsViewModel data)
 {
     if (data != null && data.No != null)
     {
         var result = DBNAV2017Clients.GetBalances(_config.NAVDatabaseName, _config.NAVCompanyName, data.No);
         return(Json(result));
     }
     return(Json(false));
 }
Ejemplo n.º 2
0
        public JsonResult UpdateBalances([FromBody] List <NAVClientesBalanceControlViewModel> listData, string CustomerNo)
        {
            var updateResult = 0;

            if (CustomerNo != null)
            {
                if (listData != null && listData.Count() > 0)
                {
                    listData.ForEach(line =>
                    {
                        var updated = DBNAV2017Clients.UpdateBalance(_config.NAVDatabaseName, _config.NAVCompanyName, CustomerNo, line.EntryNo.ToString(), line.SinalizacaoRec.ToString(), line.Obs);
                        if (updated != null)
                        {
                            updateResult += (int)updated;
                        }
                        ;
                    });
                }
                var result = DBNAV2017Clients.GetBalances(_config.NAVDatabaseName, _config.NAVCompanyName, CustomerNo);
                return(Json(result));
            }
            return(Json(false));
        }