public async Task <DataTable> GetNewOTP(NewOtpVM newotpmodel) { try { DataCommand dataCmd = new DataCommand(); dataCmd.Command = "SetOtpByOperator"; if (newotpmodel._userId > 0) { dataCmd.Parameters.Add(new SqlParameter("@operatorId", newotpmodel._userId)); } dataCmd.Type = CommandType.StoredProcedure; return(objCommonDB.GetDataTable(dataCmd)); } catch (Exception) { throw; } }
public async Task <ApiResponse> GetNewOTP(NewOtpVM _vmNewOtp) { ApiResponse apiResponse = new ApiResponse(); _INewOTP = new NewOtpRepo(); try { var result = await _INewOTP.GetNewOTP(_vmNewOtp); return(new ApiResponse { IsValidUser = true, Message = string.Empty, MessageType = 1, DataList = result }); } catch (Exception ex) { apiResponse = TaskUTL.GenerateExceptionResponse(ex, _pageName, true); return(apiResponse); } }