コード例 #1
0
 public async Task <IActionResult> SetActivationDeActivationUser([FromBody] UserActivateModel obj)
 {
     if (ModelState.IsValid)
     {
         return(Ok(await _userService.ActivateDeactivateUser(obj)));
     }
     else
     {
         return(UnprocessableEntity());
     }
 }
コード例 #2
0
ファイル: UserService.cs プロジェクト: rajat99938/PetroConNew
        //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);
            }
        }