Esempio n. 1
0
 public async Task <IActionResult> SetActivationDeActivationUser([FromBody] UserActivateModel obj)
 {
     if (ModelState.IsValid)
     {
         return(Ok(await _userService.ActivateDeactivateUser(obj)));
     }
     else
     {
         return(UnprocessableEntity());
     }
 }
Esempio n. 2
0
        //Created By : Ashwajit Bansod to acitvate deactivate user
        public async Task <int> ActivateDeactivateUser(UserActivateModel obj)
        {
            try
            {
                var sp     = StringGenerator.GetProcedureParameter(obj, SPConstants.spSetActivationDeActivationUser);
                var result = await _connectContext.spSetActivationDeActivationUser
                             .FromSqlRaw(sp, obj.UID_UserId, obj.IsActive)
                             .ToListAsync();

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