Beispiel #1
0
 public async Task <IActionResult> SetShiftSchecdule([FromBody] ShiftScheduleModal obj)
 {
     if (ModelState.IsValid)
     {
         return(Ok(await _INozzleService.SetShiftSchecdule(obj)));
     }
     else
     {
         return(UnprocessableEntity());
     }
 }
Beispiel #2
0
        public async Task <int> SetShiftSchecdule(ShiftScheduleModal obj)
        {
            try
            {
                var sp = PetroConnect.API.Helpers.StringGenerator.GetProcedureParameter(obj, SPConstants.spSetShiftSchecdule);

                var res = await _connectContext.spSetShiftSchecdule
                          .FromSqlRaw(sp, obj.Action, obj.SSH_Id, obj.SSH_UID_UserId, obj.SSH_ULA_LoginId, obj.SSH_SSL_Id, obj.SSH_IsActive, obj.SchedulefromDate, obj.ScheduleToDate)
                          .ToListAsync();

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