public async Task <IActionResult> NozzleRegistration([FromBody] NozzleRegistrationModel obj)
 {
     if (ModelState.IsValid)
     {
         return(Ok(await _pumpService.NozzleRegistration(obj)));
     }
     else
     {
         return(UnprocessableEntity());
     }
 }
Beispiel #2
0
        public async Task <int> NozzleRegistration(NozzleRegistrationModel obj)
        {
            try
            {
                var spExecue = Helpers.StringGenerator.GetProcedureParameter(obj, SPConstants.spSetNozzleRegistration);
                var res      = await _connectContext.spSetNozzleRegistration
                               .FromSqlRaw(spExecue, obj.Action, obj.NZL_Id, obj.NZL_UID_UserId, obj.NZL_TNK_Id, obj.NZL_MCN_Id, obj.NZL_Name, obj.NZL_IsActive)
                               .ToListAsync();

                return(res.FirstOrDefault().Result);
            }
            catch (Exception ex)
            {
                _ILogger.Log(LogLevel.Critical, "Exception while calling NozzleRegistration ", ex);
                return(0);
            }
        }